X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/waydroid.git/blobdiff_plain/5eb95c31a8eb6c13d27dcceb5510f2d9c6a04d71..fcc88790b4b7959dbdd2af0b9bdfcd30edabb745:/tools/actions/container_manager.py diff --git a/tools/actions/container_manager.py b/tools/actions/container_manager.py index 0588939..9539394 100644 --- a/tools/actions/container_manager.py +++ b/tools/actions/container_manager.py @@ -82,43 +82,11 @@ def start(args): for path in perm_list: chmod(path, mode) - def set_aidl_version(): - cfg = tools.config.load(args) - android_api = 0 - try: - mnt = "/tmp/waydroid-" + str(uuid.uuid1()) - helpers.mount.mount(args, cfg["waydroid"]["images_path"] + "/system.img", mnt) - android_api = int(helpers.props.file_get(args, mnt + "/system/build.prop", - "ro.build.version.sdk")) - except: - logging.error("Failed to parse android version from system.img") - finally: - helpers.mount.umount_all(args, mnt); - - if android_api < 28: - binder_protocol = "aidl" - sm_protocol = "aidl" - elif android_api < 30: - binder_protocol = "aidl2" - sm_protocol = "aidl2" - elif android_api < 31: - binder_protocol = "aidl3" - sm_protocol = "aidl3" - else: - binder_protocol = "aidl3" - sm_protocol = "aidl4" - - cfg["waydroid"]["binder_protocol"] = binder_protocol - cfg["waydroid"]["service_manager_protocol"] = sm_protocol - tools.config.save(args, cfg) - def signal_handler(sig, frame): services.hardware_manager.stop(args) stop(args) sys.exit(0) - set_aidl_version() - status = helpers.lxc.status(args) if status == "STOPPED": # Load binder and ashmem drivers @@ -164,6 +132,8 @@ def start(args): # 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"]) @@ -172,8 +142,9 @@ def start(args): if which("start"): command = ["start", "cgroup-lite"] tools.helpers.run.user(args, command, check=False) - command = ["umount", "-l", "/sys/fs/cgroup/schedtune"] - tools.helpers.run.user(args, command, check=False) + 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"):