mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-10-29 23:42:03 +01:00
Additionally - Drop old unneeded gbinder.conf - Probe "fuse" module mandatory for LXC container to boot successfully - Update Waydroid configuration on post-upgrade
43 lines
909 B
Bash
43 lines
909 B
Bash
#!/sbin/openrc-run
|
|
|
|
name="Waydroid Container Manager"
|
|
description="Waydroid Container Manager"
|
|
|
|
pidfile=/run/waydroid-container.pid
|
|
|
|
command=/usr/bin/waydroid
|
|
command_args="container start"
|
|
command_args_background="-p $pidfile"
|
|
|
|
depends() {
|
|
uses net
|
|
}
|
|
|
|
start_pre() {
|
|
# Avoid 'mount: /var/lib/waydroid/rootfs: mount failed: Operation not permitted.'
|
|
if [ ! -c /dev/loop-control ]; then
|
|
if ! modprobe loop; then
|
|
eerror "Loopback device support is not available in this kernel"
|
|
return 1
|
|
fi
|
|
fi
|
|
# Required to avoid /system/bin/vold crashing in LXC container
|
|
if [ ! -d /sys/fs/fuse/connections ]; then
|
|
if ! modprobe fuse; then
|
|
eerror "Filesystem in Userspace support is not available in this kernel"
|
|
return 1
|
|
fi
|
|
fi
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping Waydroid container..."
|
|
|
|
$supervisor $RC_SVCNAME \
|
|
--stop \
|
|
--pidfile $pidfile
|
|
$command container stop
|
|
$command session stop
|
|
eend $?
|
|
}
|