X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/waydroid.git/blobdiff_plain/0a1ad48a206fa0a86c80b5b818a05fbd93be4b8d..55e0266795bc09436ea45c3ead59d2925762d5c2:/tools/actions/container_manager.py diff --git a/tools/actions/container_manager.py b/tools/actions/container_manager.py index 520034d..9539394 100644 --- a/tools/actions/container_manager.py +++ b/tools/actions/container_manager.py @@ -7,6 +7,7 @@ import time import glob import signal import sys +import uuid import tools.config from tools import helpers from tools import services @@ -65,16 +66,18 @@ def start(args): "/dev/MTK_SMI", "/dev/mdp_sync", "/dev/mtk_cmdq", - "/dev/video32", - "/dev/video33", # Graphics "/dev/dri", "/dev/graphics", + "/dev/pvr_sync", + "/dev/ion", ] # Framebuffers perm_list.extend(glob.glob("/dev/fb*")) + # Videos + perm_list.extend(glob.glob("/dev/video*")) for path in perm_list: chmod(path, mode) @@ -122,12 +125,15 @@ def start(args): tools.helpers.run.user(args, command, check=False) # Sensors - tools.helpers.run.user( - args, ["waydroid-sensord", "/dev/" + args.HWBINDER_DRIVER], output="background") + if which("waydroid-sensord"): + tools.helpers.run.user( + args, ["waydroid-sensord", "/dev/" + args.HWBINDER_DRIVER], output="background") # Mount rootfs helpers.images.mount_rootfs(args, cfg["waydroid"]["images_path"]) + helpers.protocol.set_aidl_version(args) + # Mount data helpers.mount.bind(args, session_cfg["session"]["waydroid_data"], tools.config.defaults["data"]) @@ -136,7 +142,9 @@ def start(args): if which("start"): command = ["start", "cgroup-lite"] tools.helpers.run.user(args, command, check=False) - helpers.mount.umount_all(args, "/sys/fs/cgroup/schedtune") + if os.path.ismount("/sys/fs/cgroup/schedtune"): + command = ["umount", "-l", "/sys/fs/cgroup/schedtune"] + tools.helpers.run.user(args, command, check=False) #TODO: remove NFC hacks if which("stop"): @@ -202,11 +210,17 @@ def stop(args): # Sensors if which("waydroid-sensord"): command = ["pidof", "waydroid-sensord"] - pid = tools.helpers.run.user(args, command, check=False, output_return=True) + pid = tools.helpers.run.user(args, command, check=False, output_return=True).strip() if pid: command = ["kill", "-9", pid] tools.helpers.run.user(args, command, check=False) + # Umount rootfs + helpers.images.umount_rootfs(args) + + # Umount data + helpers.mount.umount_all(args, tools.config.defaults["data"]) + else: logging.error("WayDroid container is {}".format(status))