]> glassweightruler.freedombox.rocks Git - waydroid.git/blobdiff - tools/actions/container_manager.py
Upver to 1.4.1
[waydroid.git] / tools / actions / container_manager.py
index 5a6fe71b3e0641e4ff0740992d7b7b4949a66324..1304b6264722128230b3aaf896fa8d6c61483e9e 100644 (file)
@@ -142,12 +142,6 @@ def do_start(args, session):
         tools.helpers.run.user(
             args, ["waydroid-sensord", "/dev/" + args.HWBINDER_DRIVER], output="background")
 
-    # Mount rootfs
-    cfg = tools.config.load(args)
-    helpers.images.mount_rootfs(args, cfg["waydroid"]["images_path"], session)
-
-    helpers.protocol.set_aidl_version(args)
-
     # Cgroup hacks
     if which("start"):
         command = ["start", "cgroup-lite"]
@@ -160,6 +154,9 @@ def do_start(args, session):
     if which("stop"):
         command = ["stop", "nfcd"]
         tools.helpers.run.user(args, command, check=False)
+    elif which("systemctl") and (tools.helpers.run.user(args, ["systemctl", "is-active", "-q", "nfcd"], check=False) == 0):
+        command = ["systemctl", "stop", "nfcd"]
+        tools.helpers.run.user(args, command, check=False)
 
     # Set permissions
     set_permissions(args)
@@ -172,6 +169,12 @@ def do_start(args, session):
             helpers.mount.bind(args, session["waydroid_data"],
                                tools.config.defaults["data"])
 
+    # Mount rootfs
+    cfg = tools.config.load(args)
+    helpers.images.mount_rootfs(args, cfg["waydroid"]["images_path"], session)
+
+    helpers.protocol.set_aidl_version(args)
+
     helpers.lxc.start(args)
     services.hardware_manager.start(args)
 
@@ -195,6 +198,9 @@ def stop(args, quit_session=True):
         if which("start"):
             command = ["start", "nfcd"]
             tools.helpers.run.user(args, command, check=False)
+        elif which("systemctl") and (tools.helpers.run.user(args, ["systemctl", "is-enabled", "-q", "nfcd"], check=False) == 0):
+            command = ["systemctl", "start", "nfcd"]
+            tools.helpers.run.user(args, command, check=False)
 
         # Sensors
         if which("waydroid-sensord"):