summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <hramrach@centrum.cz>2010-09-29 10:40:42 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 17:59:20 +0100
commit01c59547807b4fd1d7d9362b6e6bca2e038f5dec (patch)
tree3012b6bffcbeb2d86773b8c6fca8cd31bccfe99c
parenta569533b09c0aca215b8194f5d66790b51752edf (diff)
downloadlive-boot-01c59547807b4fd1d7d9362b6e6bca2e038f5dec.tar.gz
live-boot-01c59547807b4fd1d7d9362b6e6bca2e038f5dec.zip
Adding initial support for unionmount.
-rwxr-xr-xhooks/live7
-rwxr-xr-xscripts/live21
2 files changed, 25 insertions, 3 deletions
diff --git a/hooks/live b/hooks/live
index 85a98a3..93a2831 100755
--- a/hooks/live
+++ b/hooks/live
@@ -246,3 +246,10 @@ then
#mkdir -p $DESTDIR/etc
#cp -p /etc/nsswitch.conf $DESTDIR/etc
fi
+
+if [ "${LIVE_UNIONMOUNT}" = "true" ]
+then
+ # UnionMount
+ # only mount from patched util-linux can do this currently
+ copy_exec /bin/mount /bin/mount_full
+fi
diff --git a/scripts/live b/scripts/live
index ad2d48e..309d5aa 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1267,9 +1267,16 @@ setup_unionfs ()
log_warning_msg "Unknown file system type on ${backdev} (${image}), assuming ${fstype}."
fi
- mkdir -p "${croot}/${imagename}"
- log_begin_msg "Mounting \"${image}\" on \"${croot}${imagename}\" via \"${backdev}\""
- mount -t "${fstype}" -o ro,noatime "${backdev}" "${croot}/${imagename}" || panic "Can not mount ${backdev} (${image}) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
+ if [ "${UNIONTYPE}" != "unionmount" ]
+ then
+ mpoint="${croot}/${imagename}"
+ rofsstring="${mpoint}=${roopt}:${rofsstring}" && rofslist="${mpoint} ${rofslist}"
+ else
+ mpoint="${rootmnt}"
+ fi
+ mkdir -p "${mpoint}"
+ log_begin_msg "Mounting \"${image}\" on \"${mpoint}\" via \"${backdev}\""
+ mount -t "${fstype}" -o ro,noatime "${backdev}" "${mpoint}" || panic "Can not mount ${backdev} (${image}) on ${mpoint}"
log_end_msg
fi
done
@@ -1383,6 +1390,9 @@ setup_unionfs ()
cow_mountopt="rw,noatime,mode=755"
fi
+ if [ "${UNIONTYPE}" != "unionmount" ]
+ then
+
if [ "${cow_fstype}" = "nfs" ]
then
log_begin_msg \
@@ -1393,6 +1403,7 @@ setup_unionfs ()
mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || \
panic "Can not mount ${cowdevice} (o: ${cow_fstype}) on /cow"
fi
+ fi
rofscount=$(echo ${rofslist} |wc -w)
@@ -1437,6 +1448,10 @@ setup_unionfs ()
pidof unionfs-fuse >> /dev/.initramfs/varrun/sendsigs.omit || true
;;
+ unionmount)
+ mount_full -t ${cow_fstype} -o noatime,union,${cow_mountopt} ${cowdevice} "${rootmnt}" || panic "${UNIONTYPE} ${cowdevice} on ${rootmnt} failed with option noatime,union,${cow_mountopt}"
+ ;;
+
*)
mount -t ${UNIONTYPE} -o noatime,${noxino_opt}dirs=/cow=rw:${rofsstring} ${UNIONTYPE} "${rootmnt}" || panic "mount ${UNIONTYPE} on ${rootmnt} failed with option noatime,${noxino_opt}dirs=/cow=rw:${rofsstring}"
;;