merge latest init changes

This commit is contained in:
Tobias Powalowski 2010-02-14 19:24:03 +01:00
parent fb06a57581
commit 764dcbe74e

View file

@ -107,14 +107,6 @@ else
msg "$(cat /message)" msg "$(cat /message)"
fi 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 mkdir -p /new_root
if [ -z "${nfsroot}" -a "${root}" != "/dev/nfs" ]; then if [ -z "${nfsroot}" -a "${root}" != "/dev/nfs" ]; then
if [ ${root:0:5} != "/dev/" ] || ! poll_device "${root}" ${rootdelay}; then if [ ${root:0:5} != "/dev/" ] || ! poll_device "${root}" ${rootdelay}; then
@ -158,13 +150,30 @@ else
fi fi
# We didn't build filesystem support into busybox, # We didn't build filesystem support into busybox,
# instead we use util-linux-ng's blkid for best compatibility # instead we use util-linux-ng's blkid for best compatibility
fstype=$(eval $(/sbin/blkid -o udev -p "${root}"); echo $ID_FS_TYPE) if [ -n "${rootfstype}" ]; then
if [ "${readwrite}" = "yes" ]; then fstype="${rootfstype}"
rwopt="rw" else
else fstype=$(eval $(/sbin/blkid -o udev -p "${root}"); echo $ID_FS_TYPE)
rwopt="ro" 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 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 else
if [ -z "$nfs_server" -o -z "$nfs_path" ]; then if [ -z "$nfs_server" -o -z "$nfs_path" ]; then
err "Unable to mount root filesystem over NFS: wrong parameters." err "Unable to mount root filesystem over NFS: wrong parameters."
@ -175,6 +184,16 @@ else
fi fi
nfsmount ${nfs_option:+-o ${nfs_option}} "${nfs_server}:${nfs_path}" /new_root nfsmount ${nfs_option:+-o ${nfs_option}} "${nfs_server}:${nfs_path}" /new_root
fi 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 /proc
umount /sys umount /sys
[ -z "${init}" ] && init="/sbin/init" [ -z "${init}" ] && init="/sbin/init"