3 # random init script to setup /udev
5 # chkconfig: 2345 20 80
6 # description: manage user-space device nodes in /udev
8 . /etc/rc.d/init.d/functions
15 # handle block devices and their partitions
16 for i in ${sysfs_dir}/block/*; do
18 export DEVPATH=${i#${sysfs_dir}}
21 # add each partition, on each device
23 if [ -f $j/dev ]; then
24 export DEVPATH=${j#${sysfs_dir}}
29 # all other device classes
30 for i in ${sysfs_dir}/class/*; do
32 if [ -f $j/dev ]; then
33 export DEVPATH=${j#${sysfs_dir}}
34 CLASS=`echo ${i#${sysfs_dir}} | \
35 cut --delimiter='/' --fields=3-`
45 if [ ! -d $udev_dir ]; then
48 if [ ! -d $sysfs_dir ]; then
51 # propogate /udev from /sys - we only need this while we do not
52 # have initramfs and an early user-space with which to do early
54 action "Creating initial udev device nodes: " /bin/true
60 action "Removing udev device nodes: " /bin/true
65 if [ -d $udev_dir ]; then
66 echo "the udev device node directory exists"
68 echo "the udev device node directory does not exist"
79 echo "Usage: $0 {start|stop|status|restart}"