X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Fboot%2Fmountroot.sh;h=5383747ec418bf0a29b4e9c4c7c63fc307222387;hb=1faa69ad4719944a3ea9c7a02da21f7b5d0170d5;hp=bad0a783f5a33fb73c4bd1a44dc5d7ce04852703;hpb=c39c7e99d9ac6ff9907aebb7626fb606b232721e;p=live-boot-grml.git diff --git a/scripts/boot/mountroot.sh b/scripts/boot/mountroot.sh index bad0a78..5383747 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 ] @@ -184,18 +187,6 @@ mountroot () fi fi - # copy snapshot configuration if exists - if [ -f snapshot.conf ] - then - log_begin_msg "Copying snapshot.conf to ${rootmnt}/etc/live/boot.d" - if [ ! -d "${rootmnt}/etc/live/boot.d" ] - then - mkdir -p "${rootmnt}/etc/live/boot.d" - fi - cp snapshot.conf "${rootmnt}/etc/live/boot.d/" - log_end_msg - fi - if [ -f /etc/resolv.conf ] && [ ! -s ${rootmnt}/etc/resolv.conf ] then log_begin_msg "Copying /etc/resolv.conf to ${rootmnt}/etc/resolv.conf" @@ -208,7 +199,6 @@ mountroot () panic "A wrong rootfs was mounted." fi - persistence_exclude fstab Netbase @@ -218,10 +208,11 @@ 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>&-