X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Fboot%2Fmountroot.sh;h=69f6f0a5f8efca8b3558d0404a5d9d37e65b0294;hb=3cb6fa175301b22dba38a233582bfcc707f2822b;hp=dbc66d4d9356bdda11bbfa16b06af0ecb0a0bb9a;hpb=3a0869fa51f3f5cae45a15423cfd6fdd9cdd2278;p=live-boot-grml.git diff --git a/scripts/boot/mountroot.sh b/scripts/boot/mountroot.sh index dbc66d4..69f6f0a 100755 --- a/scripts/boot/mountroot.sh +++ b/scripts/boot/mountroot.sh @@ -4,8 +4,9 @@ mountroot () { - if [ -x /scripts/local-top/cryptroot ]; then - /scripts/local-top/cryptroot + if [ -x /scripts/local-top/cryptroot ] + then + /scripts/local-top/cryptroot fi exec 6>&1 @@ -136,7 +137,8 @@ mountroot () fi - if [ -n "${ROOT_PID}" ] ; then + if [ -n "${ROOT_PID}" ] + then echo "${ROOT_PID}" > "${rootmnt}"/live/root.pid fi @@ -144,10 +146,11 @@ mountroot () # unionfs-fuse needs /dev to be bind-mounted for the duration of # live-bottom; udev's init script will take care of things after that - if [ "${UNIONTYPE}" = unionfs-fuse ] - then - mount -n -o bind /dev "${rootmnt}/dev" - fi + case "${UNIONTYPE}" in + unionfs-fuse) + mount -n -o bind /dev "${rootmnt}/dev" + ;; + esac # Move to the new root filesystem so that programs there can get at it. if [ ! -d /root/live/image ] @@ -205,13 +208,14 @@ mountroot () ;; esac - if [ "${UNIONFS}" = unionfs-fuse ] - then - umount "${rootmnt}/dev" - fi + case "${UNIONFS}" in + unionfs-fuse) + umount "${rootmnt}/dev" + ;; + esac exec 1>&6 6>&- exec 2>&7 7>&- kill ${tailpid} - [ -w "${rootmnt}/var/log/" ] && mkdir -p /var/log/live && cp boot.log "${rootmnt}/var/log/live" 2>/dev/null + [ -w "${rootmnt}/var/log/" ] && mkdir -p "${rootmnt}/var/log/live" && cp boot.log "${rootmnt}/var/log/live" 2>/dev/null }