--- udev-start-090.sh 2006-05-24 12:06:39.000000000 +0100 +++ udev-start.sh 2006-07-06 09:31:43.000000000 +0100 @@ -1,45 +1,25 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -udev_version() { - local version=0 - - if [[ -x /sbin/udev ]] ; then - version=$(/sbin/udev -V) - # We need it without a leading '0', else bash do the wrong thing - version=${version##0} - # Older udev's will print nothing - [[ -z ${version} ]] && version=0 - fi - - echo "${version}" -} - - populate_udev() { # populate /dev with devices already found by the kernel if [ "$(get_KV)" -gt "$(KV_to_int '2.6.14')" ] ; then ebegin "Populating /dev with existing devices through uevents" - udevtrigger - eend 0 + local opts= + [[ ${RC_COLDPLUG} != "yes" ]] && opts="--no-scan-bus" + /sbin/udevtrigger ${opts} + eend $? else ebegin "Populating /dev with existing devices with udevstart" /sbin/udevstart - eend 0 + eend $? fi # loop until everything is finished # there's gotta be a better way... ebegin "Letting udev process events" - udevsettle -# loop=0 -# while test -d /dev/.udev/queue; do -# sleep 0.1; -# test "$loop" -gt 300 && break -# loop=$(($loop + 1)) -# done - #einfo "loop = $loop" - eend 0 + /sbin/udevsettle --timeout=60 + eend $? return 0 } @@ -65,7 +45,6 @@ eend 0 } - main() { # Setup temporary storage for /dev ebegin "Mounting /dev for udev" @@ -77,7 +56,8 @@ if [[ -n ${mntcmd} ]] ; then try mount -n ${mntcmd} else - if egrep -qs tmpfs /proc/filesystems ; then + # This is bash only, but saves on using grep + if [[ $( /proc/sys/kernel/hotplug - elif [[ $(udev_version) -ge "48" ]] ; then - einfo " Setting /sbin/udevsend as hotplug agent ..." - echo "/sbin/udevsend" > /proc/sys/kernel/hotplug - elif [[ -x /sbin/hotplug ]] ; then - einfo " Using /sbin/hotplug as hotplug agent ..." else - einfo " Setting /sbin/udev as hotplug agent ..." - echo "/sbin/udev" > /proc/sys/kernel/hotplug + einfo "Setting /sbin/udevsend as hotplug agent ..." + echo "/sbin/udevsend" > /proc/sys/kernel/hotplug fi + eoutdent + eend 0 fi - eend 0 ebegin "Starting udevd" /sbin/udevd --daemon @@ -144,5 +121,4 @@ main - # vim:ts=4