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.
This commit is contained in:
Simon Fels 2016-12-13 13:50:04 +01:00
commit 7f564c55eb
5 changed files with 206 additions and 0 deletions

19
scripts/classic-reset Executable file
View file

@ -0,0 +1,19 @@
#!/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