--- /sbin/rc 2005-02-13 19:45:27.396856032 -0500 +++ /sbin/rc.mod 2005-02-13 19:44:55.806658472 -0500 @@ -184,8 +184,8 @@ fi # Fix weird bug where there is a /dev/.devfsd in a unmounted /dev - mymounts="$(awk '($3 == "devfs") { print "yes"; exit 0 }' /proc/mounts)" - if [ -e "/dev/.devfsd" -a "${mymounts}" != "yes" ] + mymounts=$(< /proc/mounts) + if [ "${mymounts/devfs}" = "${mymounts}" ] && [ -e "/dev/.devfsd" ] then rm -f /dev/.devfsd fi @@ -218,9 +218,9 @@ # With the new way, /dev can be mounted by the kernel ... elif [ "${devfs}" = "yes" -a ! -e "/dev/.devfsd" ] then - mymounts="$(awk '($2 == "devfs") { print "yes"; exit 0 }' /proc/filesystems)" + mymounts=$(< /proc/filesystems) # Is devfs support compiled in? - if [ "${mymounts}" = "yes" ] + if [ "${mymounts/devfs}" != "${mymounts}" ] then ebegin "Mounting devfs at /dev" try mount -n -t devfs none /dev @@ -245,14 +245,14 @@ # From linux-2.5.68 we need to mount /dev/pts again ... if [ "$(get_KV)" -ge "$(KV_to_int '2.5.68')" ] then - have_devpts="$(awk '($2 == "devpts") { print "yes"; exit 0 }' /proc/filesystems)" - mymounts="$(awk '($3 == "devfs") { print "yes"; exit 0 }' /proc/mounts)" + have_devpts=$(< /proc/filesystems) + mymounts=$(< /proc/filesystems) - if [ "${have_devpts}" = "yes" ] + if [ "${have_devpts/devpts}" != "${have_devpts}" ] then # Only try to create /dev/pts if we have /dev mounted as devfs, # else it might fail as / might be still mounted readonly. - if [ ! -d /dev/pts -a -e "/dev/.devfsd" -a "${mymounts}" = "yes" ] + if [ ! -d "/dev/pts" ] && [ -e "/dev/.devfsd" ] && [ "${mymounts/devfs}" != "${mymounts}" ] then # Make sure we have /dev/pts mkdir -p /dev/pts &>/dev/null || \ @@ -270,9 +270,8 @@ fi # Need devfsd running now so that /dev/ram0 exists if we need it - mymounts="$(awk '($3 == "devfs") { print "yes"; exit 0 }' /proc/mounts)" - if [ "${devfs}" = "yes" -a -e "/dev/.devfsd" -a \ - "${mymounts}" = "yes" ] + mymounts=$(< /proc/mounts) + if [ "${devfs}" = "yes" ] && [ -e "/dev/.devfsd" ] && [ "${mymounts/devfs}" != "${mymounts}" ] then if [ "${RC_DEVFSD_STARTUP}" != "no" ] then @@ -761,8 +760,8 @@ # We want devfsd running after a change of runlevel (this is mostly if we return # from runlevel 'single') -if [ -z "`ps --no-heading -C 'devfsd'`" -a \ - -n "`gawk '/\/dev devfs/ { print }' /proc/mounts 2> /dev/null`" ] +mymounts=$(< /proc/mounts) +if [ -z "`ps --no-heading -C 'devfsd'`" ] && [ "${mymounts/\/dev devfs}" != "${mymounts}" ] then if [ "${RC_DEVFSD_STARTUP}" != "no" ] then