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
16 if [ ! -d $udev_dir ]; then
19 if [ ! -d $sysfs_dir ]; then
22 # propogate /udev from /sys - we only need this while we do not
23 # have initramfs and an early user-space with which to do early
25 action "Creating initial udev device nodes: " /bin/true
27 # add block devices and their partitions
28 for i in ${sysfs_dir}/block/*; do
30 export DEVPATH=${i#${sysfs_dir}}
33 # add each partition, on each device
35 if [ -f $j/dev ]; then
36 export DEVPATH=${j#${sysfs_dir}}
41 # all other device classes
42 for i in ${sysfs_dir}/class/*; do
44 if [ -f $j/dev ]; then
45 export DEVPATH=${j#${sysfs_dir}}
46 CLASS=`echo ${i#${sysfs_dir}} | \
47 cut --delimiter='/' --fields=3-`
55 if [ $udev_dir -a "$udev_dir" != "/" ]; then
61 if [ -d $udev_dir ]; then
62 echo "the udev device node directory exists"
64 echo "the udev device node directory does not exist"
75 echo "Usage: $0 {start|stop|status|restart}"