]> glassweightruler.freedombox.rocks Git - waydroid.git/commitdiff
anbox: Add support for lxc 3 and greater
authorErfan Abdi <erfangplus@gmail.com>
Mon, 14 Jun 2021 06:15:41 +0000 (10:45 +0430)
committerErfan Abdi <erfangplus@gmail.com>
Wed, 16 Jun 2021 20:50:09 +0000 (01:20 +0430)
lxc-configs/config_1 [new file with mode: 0644]
lxc-configs/config_2 [new file with mode: 0644]
lxc-configs/config_nodes [moved from lxc-configs/config with 88% similarity]
scripts/install.sh

diff --git a/lxc-configs/config_1 b/lxc-configs/config_1
new file mode 100644 (file)
index 0000000..bbc03ac
--- /dev/null
@@ -0,0 +1,23 @@
+# Anbox LXC Config
+
+lxc.rootfs.path = /home/anbox/rootfs
+lxc.utsname = anbox
+lxc.arch = LXCARCH
+lxc.autodev = 0
+# lxc.autodev.tmpfs.size = 25000000
+lxc.aa_profile = unconfined
+
+lxc.init_cmd = /init
+
+lxc.mount.auto = cgroup:ro sys:ro proc
+
+lxc.network.type = veth
+lxc.network.flags = up
+lxc.network.link = anbox0
+lxc.network.name = eth0
+lxc.network.hwaddr = 00:16:3e:f9:d3:03
+lxc.network.mtu = 1500
+
+lxc.include = /var/lib/lxc/anbox/config_nodes
+
+lxc.hook.post-stop = /dev/null
diff --git a/lxc-configs/config_2 b/lxc-configs/config_2
new file mode 100644 (file)
index 0000000..8e709e3
--- /dev/null
@@ -0,0 +1,23 @@
+# Anbox LXC Config
+
+lxc.rootfs.path = /home/anbox/rootfs
+lxc.uts.name = anbox
+lxc.arch = LXCARCH
+lxc.autodev = 0
+# lxc.autodev.tmpfs.size = 25000000
+lxc.apparmor.profile = unconfined
+
+lxc.init.cmd = /init
+
+lxc.mount.auto = cgroup:ro sys:ro proc
+
+lxc.net.0.type = veth
+lxc.net.0.flags = up
+lxc.net.0.link = anbox0
+lxc.net.0.name = eth0
+lxc.net.0.hwaddr = 00:16:3e:f9:d3:03
+lxc.net.0.mtu = 1500
+
+lxc.include = /var/lib/lxc/anbox/config_nodes
+
+lxc.hook.post-stop = /dev/null
similarity index 88%
rename from lxc-configs/config
rename to lxc-configs/config_nodes
index 69da84ad9fc12e02c1c78b5fcc54598b5d8d8bbf..b6e2a16d3d6bf3cb79d7c09f694aca7adaecf56a 100644 (file)
@@ -1,23 +1,5 @@
 # Anbox LXC Config
 
-lxc.rootfs.path = /home/anbox/rootfs
-lxc.utsname = anbox
-lxc.arch = LXCARCH
-lxc.autodev = 0
-# lxc.autodev.tmpfs.size = 25000000
-lxc.aa_profile = unconfined
-
-lxc.init_cmd = /init
-
-lxc.mount.auto = cgroup:ro sys:ro proc
-
-lxc.network.type = veth
-lxc.network.flags = up
-lxc.network.link = anbox0
-lxc.network.name = eth0
-lxc.network.hwaddr = 00:16:3e:f9:d3:03
-lxc.network.mtu = 1500
-
 # Necessary dev nodes
 lxc.mount.entry = tmpfs dev tmpfs nosuid 0 0
 lxc.mount.entry = /dev/zero dev/zero none bind,create=file,optional 0 0
@@ -75,5 +57,3 @@ lxc.mount.entry = /dev/mtk_cmdq dev/mtk_cmdq none bind,create=file,optional 0 0
 # Media dev nodes (for Qcom)
 lxc.mount.entry = /dev/video32 dev/video32 none bind,create=file,optional 0 0
 lxc.mount.entry = /dev/video33 dev/video33 none bind,create=file,optional 0 0
-
-lxc.hook.post-stop = /dev/null
index 916df1bb5e5cfa4a36802b13e6dbb1f0fca9d049..330dfdbf530ff821903e9bf29e6349e3b32dddea 100644 (file)
@@ -118,9 +118,15 @@ chmod +x vendor-fixup.sh
 echo "Geting latest lxc config"
 mkdir /var/lib/lxc/anbox
 cd /var/lib/lxc/anbox
-rm -f config
-wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/lxc-configs/config
+rm -f config*
+if [ `lxc-info --version | cut -d "." -f 1` -gt 2 ]; then
+    wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/lxc-configs/config_2
+else
+    wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/lxc-configs/config_1
+fi
+mv config_* config
 sed -i "s/LXCARCH/$UNAME_ARCH/" config
+wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/lxc-configs/config_nodes
 
 if ! grep -q "module-native-protocol-unix auth-anonymous=1" /etc/pulse/touch-android9.pa; then
     echo "Pulseaudio config patching"