提交 dd458efb 编写于 作者: S Simon Fels 提交者: GitHub

Merge pull request #13 from morphis/bind-mount-cache-data

Bind mount cache/data on startup from writable space
#!/bin/bash #!/bin/sh
# We need to put the rootfs somewhere where we can modify some # We need to put the rootfs somewhere where we can modify some
# parts of the content on first boot (namely file permissions). # parts of the content on first boot (namely file permissions).
...@@ -10,7 +10,6 @@ ROOTFS_PATH=$DATA_PATH/rootfs ...@@ -10,7 +10,6 @@ ROOTFS_PATH=$DATA_PATH/rootfs
RAMDISK_PATH=$DATA_PATH/ramdisk RAMDISK_PATH=$DATA_PATH/ramdisk
INITRD=$SNAP/ramdisk.img INITRD=$SNAP/ramdisk.img
SYSTEM_IMG=$SNAP/system.img SYSTEM_IMG=$SNAP/system.img
ANDROID_DATA_PATH=$DATA_PATH/android-data
if [ ! -e $INITRD ]; then if [ ! -e $INITRD ]; then
echo "ERROR: boot ramdisk does not exist" echo "ERROR: boot ramdisk does not exist"
...@@ -37,9 +36,11 @@ mkdir -p $ROOTFS_PATH ...@@ -37,9 +36,11 @@ mkdir -p $ROOTFS_PATH
mount -o bind,ro $RAMDISK_PATH $ROOTFS_PATH mount -o bind,ro $RAMDISK_PATH $ROOTFS_PATH
mount -o loop,ro $SYSTEM_IMG $ROOTFS_PATH/system mount -o loop,ro $SYSTEM_IMG $ROOTFS_PATH/system
# ... but we keep /data in the read/write space # but certain top-level directories need to be in a writable space
mkdir -p $ANDROID_DATA_PATH for dir in cache data; do
mount -o bind $ANDROID_DATA_PATH $ROOTFS_PATH/data mkdir -p $DATA_PATH/android-$dir
mount -o bind $DATA_PATH/android-$dir $ROOTFS_PATH/$dir
done
# Make sure our setup path for the container rootfs # Make sure our setup path for the container rootfs
# is present as lxc is statically configured for # is present as lxc is statically configured for
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册