X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/waydroid.git/blobdiff_plain/20d3c5e2cf4fd91e35205a1abfae24456c05fc2e..2e4e921317903f5152ce17bc7aa9fdf278b45f15:/tools/helpers/drivers.py diff --git a/tools/helpers/drivers.py b/tools/helpers/drivers.py index 31005a5..3c0ea7a 100644 --- a/tools/helpers/drivers.py +++ b/tools/helpers/drivers.py @@ -12,16 +12,19 @@ import tools.helpers.run BINDER_DRIVERS = [ "anbox-binder", "puddlejumper", + "bonder", "binder" ] VNDBINDER_DRIVERS = [ "anbox-vndbinder", "vndpuddlejumper", + "vndbonder", "vndbinder" ] HWBINDER_DRIVERS = [ "anbox-hwbinder", "hwpuddlejumper", + "hwbonder", "hwbinder" ] @@ -58,7 +61,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 +89,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") @@ -104,11 +112,8 @@ def probeBinderDriver(args): def probeAshmemDriver(args): if not os.path.exists("/dev/ashmem"): - command = ["modprobe", "ashmem_linux"] - output = tools.helpers.run.user(args, command, check=False, output_return=True) - if output: - logging.error("Failed to load ashmem driver") - logging.error(output.strip()) + command = ["modprobe", "-q", "ashmem_linux"] + tools.helpers.run.user(args, command, check=False) if not os.path.exists("/dev/ashmem"): return -1 @@ -168,3 +173,6 @@ def loadBinderNodes(args): args.BINDER_DRIVER = cfg["waydroid"]["binder"] args.VNDBINDER_DRIVER = cfg["waydroid"]["vndbinder"] args.HWBINDER_DRIVER = cfg["waydroid"]["hwbinder"] + # These might not be in cfg on package upgrade + args.BINDER_PROTOCOL = cfg["waydroid"].get("binder_protocol") + args.SERVICE_MANAGER_PROTOCOL = cfg["waydroid"].get("service_manager_protocol")