]> glassweightruler.freedombox.rocks Git - waydroid.git/commitdiff
lxc: Fixup LXC config versioning
authorAlessandro Astone <ales.astone@gmail.com>
Wed, 7 Dec 2022 19:00:24 +0000 (20:00 +0100)
committerAlessandro Astone <ales.astone@gmail.com>
Wed, 7 Dec 2022 19:00:26 +0000 (20:00 +0100)
What used to be called 'config_2' was actually meant to be used with
LXC 3.0 and later, so call it config_3 and fix the logic.

Also lxc.pty.max is an LXC 3.0 feature

data/configs/config_3 [moved from data/configs/config_2 with 95% similarity]
data/configs/config_base
tools/helpers/lxc.py

similarity index 95%
rename from data/configs/config_2
rename to data/configs/config_3
index dcc6fc4de25b6cb784a4283d9ba7999cdb423652..3c8222642fd543a41d29f55afd974d767dab6826 100644 (file)
@@ -14,3 +14,4 @@ lxc.net.0.name = eth0
 lxc.net.0.hwaddr = 00:16:3e:f9:d3:03
 lxc.net.0.mtu = 1500
 
 lxc.net.0.hwaddr = 00:16:3e:f9:d3:03
 lxc.net.0.mtu = 1500
 
+lxc.pty.max = 10
index 16b4ced3ba03ed4730860338d0e2ba882dbfa51e..f36a7a93758299b9fb5cff267acdba587affd9ea 100644 (file)
@@ -11,7 +11,6 @@ lxc.mount.auto = cgroup:ro sys:ro
 lxc.mount.entry = proc proc proc nodev,nosuid,noexec,hidepid=2 0 0
 
 lxc.console.path = none
 lxc.mount.entry = proc proc proc nodev,nosuid,noexec,hidepid=2 0 0
 
 lxc.console.path = none
-lxc.pty.max = 10
 
 lxc.include = /var/lib/waydroid/lxc/waydroid/config_nodes
 
 
 lxc.include = /var/lib/waydroid/lxc/waydroid/config_nodes
 
index fdea1fdf601f0eaf16c7b0c62fe8e4568ffd77e3..59b1c9112465b9e45ba6a95d10f643d4929e40f5 100644 (file)
@@ -150,11 +150,11 @@ def set_lxc_config(args):
     seccomp_profile = tools.config.tools_src + "/data/configs/waydroid.seccomp"
 
     config_snippets = [ config_paths + "base" ]
     seccomp_profile = tools.config.tools_src + "/data/configs/waydroid.seccomp"
 
     config_snippets = [ config_paths + "base" ]
-    # lxc v1 is a bit special because some options got renamed later
-    if lxc_ver == 1:
+    # lxc v1 and v2 are bit special because some options got renamed later
+    if lxc_ver <= 2:
         config_snippets.append(config_paths + "1")
     else:
         config_snippets.append(config_paths + "1")
     else:
-        for ver in range(2, 5):
+        for ver in range(3, 5):
             snippet = config_paths + str(ver)
             if lxc_ver >= ver and os.path.exists(snippet):
                 config_snippets.append(snippet)
             snippet = config_paths + str(ver)
             if lxc_ver >= ver and os.path.exists(snippet):
                 config_snippets.append(snippet)