diff options
author | Peter Hjalmarsson <xake@rymdraket.net> | 2011-03-24 13:36:56 +0100 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2011-03-28 19:31:57 +0200 |
commit | f927ef9b4282ceeaa869dc69fa3a971b1ae1bbf9 (patch) | |
tree | ebebfc8ca94827852d04a79e674d6d5a55f23ff9 | |
parent | Use the same options for proc and sysfs as Gentoo/OpenRC uses (diff) | |
download | genkernel-f927ef9b4282ceeaa869dc69fa3a971b1ae1bbf9.tar.gz genkernel-f927ef9b4282ceeaa869dc69fa3a971b1ae1bbf9.tar.bz2 genkernel-f927ef9b4282ceeaa869dc69fa3a971b1ae1bbf9.zip |
Try to move /sys and /proc to the newroot first instead of just unmounting.
-rwxr-xr-x | defaults/linuxrc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/defaults/linuxrc b/defaults/linuxrc index 115f1f5..1819d9f 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -733,16 +733,17 @@ echo -ne "${BOLD}.${NORMAL}" # If devtmpfs is mounted, try move it to the new root # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise -if grep -qs "/dev " /proc/mounts -then - if ! mount --move /dev "${CHROOT}"/dev +for fs in /dev /sys /proc +do + if grep -qs "$fs" /proc/mounts then - umount /dev || echo '*: Failed to move and unmount the ramdisk /dev!' + if ! mount --move $fs "${CHROOT}"$fs + then + umount $fs || echo '*: Failed to move and unmount the ramdisk $fs!' + fi fi -fi +done -umount /sys || echo '*: Failed to unmount the ramdisk /sys!' -umount /proc || echo '*: Failed to unmount the ramdisk /proc!' echo -e "${BOLD}.${NORMAL}" exec /sbin/switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" "${INIT_OPTS}" |