anbox/scripts/classic-reset
Simon Fels 7f564c55eb Build and load binder/ashmem kernel modules on service start
As both kernel modules are not part of the standard Ubuntu kernel we
need to build and load them at runtime. We bundle this together with
the container manager start and reuse the classic snap scripts to do
the actual build in a proper environment.
2016-12-13 13:51:40 +01:00

19 lines
313 B
Bash
Executable file

#!/bin/sh
set -eu
ROOT=$SNAP_COMMON/classic
if [ "$(id -u)" != "0" ]; then
echo "needs to run as root"
exit 1
fi
for d in /home /run /proc /sys /dev /var/lib/extrausers /etc/sudoers /etc/sudoers.d /snappy; do
if mountpoint -q "$ROOT/$d"; then
umount "$ROOT/$d"
fi
done
# cleanup
rm -rf $ROOT