chiark / gitweb /
[PATCH] use udevstart for udev.init.* files.
authorgreg@kroah.com <greg@kroah.com>
Sun, 5 Dec 2004 16:31:37 +0000 (08:31 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 06:06:10 +0000 (23:06 -0700)
Thanks to Kay for pointing it out.

etc/init.d/udev.init.LSB
etc/init.d/udev.init.lfs

index 0f5881c4169ce5cd066540e305af6370271d72b6..0fb0f0c205797d01c655fb43b5cfbdfae75343db 100644 (file)
@@ -49,34 +49,6 @@ SYSFS_DIR=/sys
 # Source LSB init functions
 . /lib/lsb/init-functions
 
-run_udev () {
-       # handle block devices and their partitions
-       for i in ${SYSFS_DIR}/block/*; do
-               # add each drive
-               export DEVPATH=${i#${SYSFS_DIR}}
-               $UDEV_BIN block &
-
-               # add each partition, on each device
-               for j in $i/*; do
-                       if [ -f $j/dev ]; then
-                               export DEVPATH=${j#${SYSFS_DIR}}
-                               $UDEV_BIN block &
-                       fi
-               done
-       done
-       # all other device classes
-       for i in ${SYSFS_DIR}/class/*; do
-               for j in $i/*; do
-                       if [ -f $j/dev ]; then
-                               export DEVPATH=${j#${SYSFS_DIR}}
-                               CLASS=`echo ${i#${SYSFS_DIR}} | \
-                                       cut --delimiter='/' --fields=3-`
-                               $UDEV_BIN $CLASS &
-                       fi
-               done
-       done
-}
-
 case "$1" in
     start)
        if [ ! -d $SYSFS_DIR ]; then
@@ -91,16 +63,12 @@ case "$1" in
        # device bring up
        echo -n "Creating initial udev device nodes: "
        export ACTION=add
-       run_udev
+       udevstart
        log_success_msg
        ;;
     stop)
-       # be careful
-       echo -n "Removing udev device nodes: "
-       export ACTION=remove
-       run_udev
-       rm -f $udev_db || exit 1
-       rmdir $udev_root || exit 1
+       # nothing to do here
+       echo -n "Stopping udev: "
        log_success_msg
        ;;
     restart)
index 41a3fecf0ffce04d0da1ed5f2391f3a9dbc3e631..d4f64062b82437e93640f9ee5d2de4a9d42bb906 100644 (file)
 . /etc/udev/udev.conf
 
 sysfs_dir="/sys"
-bin="/sbin/udev"
-
-
-run_udev ()
-{
-       # handle block devices and their partitions
-       for i in ${sysfs_dir}/block/*; do
-               # add each drive
-               export DEVPATH=${i#${sysfs_dir}}
-               $bin block &
-
-               # add each partition, on each device
-               for j in $i/*; do
-                       if [ -f $j/dev ]; then
-                               export DEVPATH=${j#${sysfs_dir}}
-                               $bin block &
-                       fi
-               done
-       done
-       # all other device classes
-       for i in ${sysfs_dir}/class/*; do
-               for j in $i/*; do
-                       if [ -f $j/dev ]; then
-                               export DEVPATH=${j#${sysfs_dir}}
-                               CLASS=`echo ${i#${sysfs_dir}} | \
-                                       cut --delimiter='/' --fields=3-`
-                               $bin $CLASS &
-                       fi
-               done
-       done
-       return 0
-}
 
 case "$1" in
        start)
@@ -62,14 +30,11 @@ case "$1" in
                # propogate /udev from /sys - we only need this while we do not
                # have initramfs and an early user-space with which to do early
                # device bring up
-               export ACTION=add
-               run_udev
+               udevstart
                evaluate_retval
                ;;
        stop)
-               echo "Removing udev device nodes ..."
-               export ACTION=remove
-               run_udev
+               echo "Stopping udev ..."
                evaluate_retval
                ;;
        reload)