From 764dcbe74e671464007f177b8c2b71c17e16f917 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Sun, 14 Feb 2010 19:24:03 +0100 Subject: [PATCH] merge latest init changes --- usr/share/archboot/base/init | 47 +++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/usr/share/archboot/base/init b/usr/share/archboot/base/init index 375bade80..3abf02763 100755 --- a/usr/share/archboot/base/init +++ b/usr/share/archboot/base/init @@ -107,14 +107,6 @@ else msg "$(cat /message)" fi - #Special handling if udev is running - udevpid=$(/bin/pidof udevd) - if [ -n "${udevpid}" ]; then - # Settle pending uevents, then kill udev - /sbin/udevadm settle - /bin/kill -9 ${udevpid} > /dev/null 2>&1 - /bin/sleep 0.01 - fi mkdir -p /new_root if [ -z "${nfsroot}" -a "${root}" != "/dev/nfs" ]; then if [ ${root:0:5} != "/dev/" ] || ! poll_device "${root}" ${rootdelay}; then @@ -158,13 +150,30 @@ else fi # We didn't build filesystem support into busybox, # instead we use util-linux-ng's blkid for best compatibility - fstype=$(eval $(/sbin/blkid -o udev -p "${root}"); echo $ID_FS_TYPE) - if [ "${readwrite}" = "yes" ]; then - rwopt="rw" - else - rwopt="ro" + if [ -n "${rootfstype}" ]; then + fstype="${rootfstype}" + else + fstype=$(eval $(/sbin/blkid -o udev -p "${root}"); echo $ID_FS_TYPE) + if [ -z "${fstype}" ]; then + err "Unable to determine the file system type of ${root}:" + echo "Either it contains no filesystem, an unknown filesystem," + echo "or more than one valid file system signature was found." + echo + echo "Try adding" + echo " rootfstype=your_filesystem_type" + echo "to the kernel command line." + echo + echo "You are now being dropped into an emergency shell." + launch_interactive_shell + msg "Trying to continue (this will most likely fail) ..." + fi fi - mount ${fstype:+-t ${fstype}} -o ${rwopt}${rootflags:+,${rootflags}} "${root}" /new_root + if [ "${readwrite}" = "yes" ]; then + rwopt="rw" + else + rwopt="ro" + fi + mount ${fstype:+-t ${fstype}} -o ${rwopt}${rootflags:+,${rootflags}} "${root}" /new_root else if [ -z "$nfs_server" -o -z "$nfs_path" ]; then err "Unable to mount root filesystem over NFS: wrong parameters." @@ -175,6 +184,16 @@ else fi nfsmount ${nfs_option:+-o ${nfs_option}} "${nfs_server}:${nfs_path}" /new_root fi + + #Special handling if udev is running + udevpid=$(/bin/pidof udevd) + if [ -n "${udevpid}" ]; then + # Settle pending uevents, then kill udev + /sbin/udevadm settle + /bin/kill -9 ${udevpid} > /dev/null 2>&1 + /bin/sleep 0.01 + fi + umount /proc umount /sys [ -z "${init}" ] && init="/sbin/init"