aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/files/init-live.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/initrdscripts/files/init-live.sh')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-live.sh23
1 files changed, 19 insertions, 4 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index eb5ab5b7a5..737dae4cbc 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -7,6 +7,7 @@ ROOT_IMAGE="rootfs.img"
MOUNT="/bin/mount"
UMOUNT="/bin/umount"
ISOLINUX=""
+UNIONFS="no"
early_setup() {
mkdir /proc
@@ -89,17 +90,31 @@ case $label in
mkdir $ROOT_MOUNT
mknod /dev/loop0 b 7 0 2>/dev/null
- if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
- fatal "Couldnt mount rootfs image"
+
+ if [ "$UNIONFS" = "yes" ]; then
+ mkdir /rootfs-tmp
+
+ if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs-tmp ; then
+ fatal "Could not mount rootfs image"
+ else
+ mkdir /cow
+ mount -t tmpfs -o rw,noatime,mode=755 tmpfs /cow
+ mount -t unionfs -o dirs=/cow:/rootfs-tmp=ro unionfs $ROOT_MOUNT
+ boot_live_root
+ fi
else
- boot_live_root
+ if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
+ fatal "Could not mount rootfs image"
+ else
+ boot_live_root
+ fi
fi
;;
install)
if [ -f /media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
./install.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode
else
- fatal "Couldnt find install script"
+ fatal "Could not find install script"
fi
# If we're getting here, we failed...