From: Alessandro Astone Date: Wed, 7 Dec 2022 19:00:24 +0000 (+0100) Subject: lxc: Fixup LXC config versioning X-Git-Tag: 1.3.4~7 X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/waydroid.git/commitdiff_plain/527f073e4ad4a7a31553493310db7459eaf8a751?ds=inline lxc: Fixup LXC config versioning 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 --- diff --git a/data/configs/config_2 b/data/configs/config_3 similarity index 95% rename from data/configs/config_2 rename to data/configs/config_3 index dcc6fc4..3c82226 100644 --- a/data/configs/config_2 +++ b/data/configs/config_3 @@ -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.pty.max = 10 diff --git a/data/configs/config_base b/data/configs/config_base index 16b4ced..f36a7a9 100644 --- a/data/configs/config_base +++ b/data/configs/config_base @@ -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.pty.max = 10 lxc.include = /var/lib/waydroid/lxc/waydroid/config_nodes diff --git a/tools/helpers/lxc.py b/tools/helpers/lxc.py index fdea1fd..59b1c91 100644 --- a/tools/helpers/lxc.py +++ b/tools/helpers/lxc.py @@ -150,11 +150,11 @@ def set_lxc_config(args): 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: - 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)