]> glassweightruler.freedombox.rocks Git - waydroid.git/blobdiff - tools/helpers/drivers.py
net: Disable NFT by default
[waydroid.git] / tools / helpers / drivers.py
index 31005a546ac4608eff915d8c2b5c2b5c60c0d596..fa4d536d0a8469a56983a877e48c2ceebd223d7a 100644 (file)
@@ -58,7 +58,10 @@ def allocBinderNodes(args, binder_dev_nodes):
     for node in binder_dev_nodes:
         node_struct = struct.pack(
             '256sII', bytes(node, 'utf-8'), 0, 0)
-        fcntl.ioctl(binderctrlfd.fileno(), BINDER_CTL_ADD, node_struct)
+        try:
+            fcntl.ioctl(binderctrlfd.fileno(), BINDER_CTL_ADD, node_struct)
+        except FileExistsError:
+            pass
 
 def probeBinderDriver(args):
     binder_dev_nodes = []
@@ -83,7 +86,9 @@ def probeBinderDriver(args):
 
     if len(binder_dev_nodes) > 0:
         if not isBinderfsLoaded(args):
-            command = ["modprobe", "binder_linux"]
+            devices = ','.join(binder_dev_nodes)
+            command = ["modprobe", "binder_linux",
+                       "devices=\"{}\"".format(devices)]
             output = tools.helpers.run.user(args, command, check=False, output_return=True)
             if output:
                 logging.error("Failed to load binder driver")