src_prepare-overlay/app-emulation/anbox/files/anbox-container-manager-r1.initd
Alfred Wingate bd146eccfa
app-emulation/anbox: revamp live ebuild, add 20211020
Changes include:
- remove excessive asterisk's around variables
- assume specific use flags are enabled if not available on boost and
  mesa
- update systemd dependency removal patch
- change ebuild version scheme from 0_preYYYYMMDD to just YYYYMMDD
- improve anbox init script
- general improvements to readability

Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Alfred Wingate <parona@protonmail.com>
2021-11-26 13:14:01 +02:00

47 lines
1.1 KiB
Plaintext

#!/sbin/openrc-run
supervisor=supervise-daemon
name="Anbox container manager"
ANDROID_IMAGE="${ANDROID_IMAGE:-"/usr/share/andbox/android.img"}"
DATA_PATH="${DATA_PATH:-"/var/lib/anbox"}"
command=/usr/bin/anbox
command_args="container-manager --daemon --privileged --data-path=${DATA_PATH} --android-image=${ANDROID_IMAGE}"
depend() {
need localmount sysfs cgroups fuse
use net
after firewall
}
start_pre() {
# that's all you need to avoid the lxc dependency
checkpath --directory /usr/lib/lxc
checkpath --directory /usr/lib/lxc/rootfs
modprobe loop
modprobe tun
modprobe binder_linux
if ! [[ -d /dev/binderfs ]] && grep -vq "binder on /dev/binderfs"; then
mkdir /dev/binderfs
mount -t binder binder /dev/binderfs
fi
if ip link show anbox0 >/dev/null 2>&1; then
ewarn "anbox0 network interface already exists"
else
ebegin "Creating anbox0 network interface"
/usr/share/anbox/anbox-bridge.sh start
eend $?
fi
}
stop_post() {
if ip link show anbox0 >/dev/null 2>&1; then
ebegin "Removing anbox0 network interface"
/usr/share/anbox/anbox-bridge.sh stop
eend $?
fi
}