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
17 # handle block devices and their partitions
18 for i in ${sysfs_dir}/block/*; do
20 export DEVPATH=${i#${sysfs_dir}}
23 # add each partition, on each device
25 if [ -f $j/dev ]; then
26 export DEVPATH=${j#${sysfs_dir}}
31 # all other device classes
32 for i in ${sysfs_dir}/class/*; do
34 if [ -f $j/dev ]; then
35 export DEVPATH=${j#${sysfs_dir}}
36 CLASS=`echo ${i#${sysfs_dir}} | \
37 cut --delimiter='/' --fields=3-`
47 if [ ! -d $sysfs_dir ]; then
50 if [ ! -d $udev_root ]; then
54 # remove the database if it is there as we always want to start fresh
55 if [ -f $udev_root/.udev.tdb ]; then
56 rm -f $udev_root/.udev.tdb
59 # propogate /udev from /sys - we only need this while we do not
60 # have initramfs and an early user-space with which to do early
63 echo -n $"Creating initial udev device nodes:"
67 touch /var/lock/subsys/udev
71 echo -n $"Removing udev device nodes: "
76 rm -f /var/lock/subsys/udev
79 if [ -f /var/lock/subsys/udev ]; then
83 echo $"$prog is stopped"
94 echo "Usage: $0 {start|stop|status|restart}"