diff options
author | greg@kroah.com <greg@kroah.com> | 2003-11-24 06:19:44 -0800 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:13:02 -0700 |
commit | 7e1b28e8faad308523a22a78930c47e5cf9cb6cf (patch) | |
tree | ed638dbec51e214d8c0a40f15c6a87937a8f14f4 | |
parent | 89f38d18cef11f5fabd7ec73be1839491cf95cbc (diff) |
[PATCH] fix udev init.d script to handle all class devices in sysfs.
-rw-r--r-- | etc/init.d/udev | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/etc/init.d/udev b/etc/init.d/udev index 99f06c2963..5c09afd205 100644 --- a/etc/init.d/udev +++ b/etc/init.d/udev @@ -24,24 +24,31 @@ case "$1" in # device bring up action "Creating initial udev device nodes: " /bin/true export ACTION=add - # add tty devices - for i in ${sysfs_dir}/class/tty/*; do - export DEVPATH="/"`echo $i | cut --delimiter='/' --fields=3-` - $bin tty - done # add block devices and their partitions for i in ${sysfs_dir}/block/*; do - export DEVPATH="/"`echo $i | cut --delimiter='/' --fields=3-` + # 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="/"`echo $j | \ - cut --delimiter='/' --fields=3-` + export DEVPATH=${j#${sysfs_dir}} $bin block fi done done - # TODO: add other device classes + # 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 ;; stop) # be careful |