]> glassweightruler.freedombox.rocks Git - waydroid.git/blob - scripts/run-container.sh
anbox: Stop nfcd to avoid conflicting with host services
[waydroid.git] / scripts / run-container.sh
1 #!/bin/bash
2 cd /home/anbox
3
4 # just in case, stop Anbox 7
5 stop anbox-container || true
6
7 # start cgroup-lite, else container may fail to start.
8 start cgroup-lite
9
10 # start sensors hal
11 start anbox-sensors
12
13 # start lxc-net, that sets up lxc bridge
14 start lxc-net
15
16 # stop nfcd to not conflict with anbox
17 stop nfcd
18
19 # umount rootfs if it was mounted
20 umount -l rootfs || true
21
22 mkdir -p /home/anbox/rootfs
23 mkdir -p /home/anbox/data
24 mount anbox_arm64_system.img rootfs
25 mount -o remount,ro rootfs
26 mount anbox_arm64_vendor.img rootfs/vendor
27 mount -o remount,ro rootfs
28 mount -o bind anbox.prop rootfs/vendor/anbox.prop
29
30 if mountpoint -q -- /odm; then
31 mount -o bind /odm rootfs/odm_extra
32 else
33 if [ -d /vendor/odm ]; then
34 mount -o bind /vendor/odm rootfs/odm_extra
35 fi
36 fi
37
38 # Anbox binder permissions
39 chmod 666 /dev/anbox-*binder
40
41 # Wayland socket permissions
42 chmod 777 -R /run/user/32011
43
44 # Set sw_sync permissions
45 chmod 777 /dev/sw_sync
46 chmod 777 /sys/kernel/debug/sync/sw_sync
47
48 # Media nodes permissions
49 chmod 777 /dev/Vcodec
50 chmod 777 /dev/MTK_SMI
51 chmod 777 /dev/mdp_sync
52 chmod 777 /dev/mtk_cmdq
53 chmod 777 /dev/video32
54 chmod 777 /dev/video33
55
56 lxc-start -n anbox -F -- /init