3 # LinuxFromScratch udev init script
4 # derived from original RedHat udev init script
5 # 2003 by Michael Buesch <mbuesch@freenet.de>
8 source /etc/sysconfig/rc
17 echo "Creating initial udev device nodes ..."
18 if [ ! -d $udev_dir ]; then
25 if [ ! -d $sysfs_dir ]; then
26 echo "sysfs_dir $sysfs_dir does not exist!"
30 # propogate /udev from /sys - we only need this while we do not
31 # have initramfs and an early user-space with which to do early
35 # add block devices and their partitions
36 for i in ${sysfs_dir}/block/*; do
38 export DEVPATH=${i#${sysfs_dir}}
41 # add each partition, on each device
43 if [ -f $j/dev ]; then
44 export DEVPATH=${j#${sysfs_dir}}
47 echo "Warning: $DEVPATH failed."
53 # all other device classes
54 for i in ${sysfs_dir}/class/*; do
56 if [ -f $j/dev ]; then
57 export DEVPATH=${j#${sysfs_dir}}
58 CLASS=`echo ${i#${sysfs_dir}} | \
59 cut --delimiter='/' --fields=3-`
62 echo "Warning: $DEVPATH failed."
68 if [ $clean_exit = "yes" ]; then
75 echo "Removing udev device nodes ..."
77 if [ $udev_dir -a "$udev_dir" != "/" ]; then
92 if [ -d $udev_dir ]; then
93 echo "the udev device node directory exists"
95 echo "the udev device node directory does not exist"
99 echo "Usage: $0 {start|stop|restart|status}"