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.
19 lines
313 B
Bash
Executable file
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
|