code: def persistent_modprobe(module):
      
      if not os.path.exists('/etc/rc.modules'):
          open('/etc/rc.modules', 'a')
          os.chmod('/etc/rc.modules', 111)
      with open('/etc/rc.modules', 'r+') as modules:
          if module not in modules.read():
              modules.write('modprobe %s\n' % module)
docs: Load a kernel module and configure for auto-load on reboot.