You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1009 B
28 lines
1009 B
--- root.orig
|
|
+++ root
|
|
@@ -19,7 +19,23 @@ start()
|
|
|
|
ebegin "Remounting root filesystem read/write"
|
|
case "${RC_UNAME}" in
|
|
- Linux) mount -n -o remount,rw /;;
|
|
+ Linux) SCRATCH_ROOT=`sed -nr 's/(\S+)\s+\/newroot\s+.*/\1/p' /proc/mounts`
|
|
+ if [ "$SCRATCH_ROOT" -a "${SCRATCH_ROOT}" != "tmpfs" ];
|
|
+ then
|
|
+ mount -n $SCRATCH_ROOT /mnt/scratch
|
|
+ if [[ -n `cat /proc/mounts | grep "none / aufs"` ]];
|
|
+ then
|
|
+ mount -n -t aufs -o remount,rw none /
|
|
+ mount -n -t aufs -o remount,rw none /mnt/builder
|
|
+ else
|
|
+ mount -n -t unionfs -o remount,dirs=/mnt/scratch/workspace=rw:/mnt/scratch/delta=ro:/mnt/scratch/calculate=ro unionfs /
|
|
+ mount -n -t unionfs -o remount,dirs=/mnt/scratch/delta=rw:/mnt/scratch/calculate=ro unionfs /mnt/builder
|
|
+ fi
|
|
+ mount -o loop -t squashfs /mnt/scratch/livecd.squashfs /mnt/scratch/calculate
|
|
+ else
|
|
+ mount -n -o remount,rw /
|
|
+ fi
|
|
+ ;;
|
|
*) mount -u -o rw /;;
|
|
esac
|
|
if eend $? "Root filesystem could not be mounted read/write"; then
|