X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Fboot%2F9990-main.sh;h=8776a7d47d54d9e539a69f21b4a8cf6ce37ecb45;hb=895b356b249e9b1196d180a43c2e6601fab1b158;hp=171d0ea76831bd5bdefa76ee8e5de92193b5c1fb;hpb=698de1fad6697ea3f9c0d723a4b6a21dfe325380;p=live-boot-grml.git diff --git a/scripts/boot/9990-main.sh b/scripts/boot/9990-main.sh index 171d0ea..8776a7d 100755 --- a/scripts/boot/9990-main.sh +++ b/scripts/boot/9990-main.sh @@ -2,7 +2,7 @@ # set -e -Main () +Live () { if [ -x /scripts/local-top/cryptroot ] then @@ -129,6 +129,19 @@ Main () mount_images_in_directory "${livefs_root}" "${rootmnt}" "${mac}" fi + # At this point /root should contain the final root filesystem. + # Move all mountpoints below /live into /root/lib/live/mount. + # This has to be done after mounting the root filesystem to / + # otherwise these mount points won't be accessible from the running system. + for _MOUNT in $(cat /proc/mounts | cut -f 2 -d " " | grep -e "^/live/") + do + local newmount + newmount="${rootmnt}/lib/live/mount/${_MOUNT#/live/}" + mkdir -p "${newmount}" + mount -o move "${_MOUNT}" "${newmount}" > /dev/null 2>&1 || \ + mount -o bind "${_MOUNT}" "${newmount}" > /dev/null || \ + log_warning_msg "W: failed to move or bindmount ${_MOUNT} to ${newmount}" + done if [ -n "${ROOT_PID}" ] then @@ -145,9 +158,6 @@ Main () ;; esac - # Move to the new root filesystem so that programs there can get at it. - mkdir -p /root/lib/live/mount/image - mount --move /live/image /root/lib/live/mount/image # aufs2 in kernel versions around 2.6.33 has a regression: # directories can't be accessed when read for the first the time, @@ -155,13 +165,6 @@ Main () # when booting FAI, this simple workaround solves it ls /root/* >/dev/null 2>&1 - # Move findiso directory to the new root filesystem so that programs there can get at it. - if [ -d /live/findiso ] - then - mkdir -p /root/lib/live/mount/findiso - mount -n --move /live/findiso /root/lib/live/mount/findiso - fi - # if we do not unmount the ISO we can't run "fsck /dev/ice" later on # because the mountpoint is left behind in /proc/mounts, so let's get # rid of it when running from RAM