Add support for an overlayed Android root filesystem

This will allow users to extend the Android root filesystem with
additional system applications and changes.
This commit is contained in:
Simon Fels 2018-06-23 15:20:44 +02:00
commit 77a4cc7f3b
11 changed files with 98 additions and 17 deletions

View file

@ -10,6 +10,11 @@ DATA_PATH=$SNAP_COMMON/
ROOTFS_PATH=$DATA_PATH/rootfs
ANDROID_IMG=$SNAP/android.img
if [ "$(id -u)" != 0 ]; then
echo "ERROR: You need to run the container manager as root"
exit 1
fi
if [ ! -e $ANDROID_IMG ]; then
echo "ERROR: android image does not exist"
exit 1
@ -47,7 +52,14 @@ start() {
export ANBOX_LOG_LEVEL=debug
fi
EXTRA_ARGS=
enable_rootfs_overlay="$(snapctl get rootfs-overlay.enable)"
if [ "$enable_rootfs_overlay" = true ]; then
EXTRA_ARGS="$EXTRA_ARGS --use-rootfs-overlay"
fi
exec $AA_EXEC $SNAP/bin/anbox-wrapper.sh container-manager \
"$EXTRA_ARGS" \
--data-path=$DATA_PATH \
--android-image=$ANDROID_IMG \
--daemon