summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJesse Hathaway <jesse@mbuki-mvuki.org>2007-10-23 16:57:19 -0400
committerDaniel Baumann <daniel@debian.org>2011-03-09 17:31:06 +0100
commitfbef3170111b07655b5c0eff854b49fcbea60c4b (patch)
tree67db6303a12635e62b01dce738d0ef1e2eb2cd82 /scripts
parente5ed5f84c8dff7855284b6d37f14da6a2e85f1c5 (diff)
downloadlive-boot-fbef3170111b07655b5c0eff854b49fcbea60c4b.tar.gz
live-boot-fbef3170111b07655b5c0eff854b49fcbea60c4b.zip
add support for exposedroot option for live-helper
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/live40
1 files changed, 38 insertions, 2 deletions
diff --git a/scripts/live b/scripts/live
index b4254e1..8f84ed2 100755
--- a/scripts/live
+++ b/scripts/live
@@ -371,6 +371,11 @@ Arguments ()
export TORAM MODULETORAM
;;
+ exposedroot)
+ EXPOSED_ROOT="Yes"
+ export EXPOSED_ROOT
+ ;;
+
union=*)
UNIONTYPE="${ARGUMENT#union=}"
export UNIONTYPE
@@ -961,9 +966,40 @@ setup_unionfs ()
fi
fi
- mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || panic "Can not mount ${cowdevice} on /cow"
+ rofscount=$(echo ${rofslist} |wc -w)
+
+ if [ -n "${EXPOSED_ROOT}" ]
+ then
+ if [ ${rofscount} -ne 1 ]
+ then
+ panic "only one RO file system supported with exposedroot: ${rofslist}"
+ fi
+ exposedrootfs=${rofslist%% }
+
+ mount --bind ${exposedrootfs} ${rootmnt} || \
+ panic "bind mount of ${exposedrootfs} failed"
+
+ mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || \
+ panic "Can not mount ${cowdevice} on /cow"
+
+ cow_dirs='/tmp /var/tmp /var/lock /var/run /var/log /var/spool
+ /home /live /var/lib/live'
- mount -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} ${UNIONTYPE} "${rootmnt}" || panic "${UNIONTYPE} mount failed"
+ for dir in ${cow_dirs}; do
+ mkdir -p /cow${dir}
+ mount -t ${UNIONTYPE} \
+ -o rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro \
+ ${UNIONTYPE} "${rootmnt}${dir}" || \
+ panic "mount ${UNIONTYPE} on ${rootmnt}${dir} failed with option \
+ rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro"
+ done
+ else
+ mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow || \
+ panic "Can not mount ${cowdevice} on /cow"
+ mount -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} \
+ ${UNIONTYPE} "${rootmnt}" || panic "mount ${UNIONTYPE} on \
+ ${rootmnt} failed with option noatime,dirs=/cow=rw:${rofsstring}"
+ fi
# Adding other custom mounts
if [ -n "${PERSISTENT}" ]