3 # hdw - linux /etc/init.d/udev
5 # populate /dev directory with device nodes
16 # add some nodes not exported by sysfs
18 # block devices & partitions
19 for i in ${sysfs_dir}/block/*; do
20 export DEVPATH=${i#${sysfs_dir}}
23 if [ -f $j/dev ]; then
24 export DEVPATH=${j#${sysfs_dir}}
30 for i in ${sysfs_dir}/class/*; do
32 # cruel hack to not del /dev/null
33 if [ "$j" != "${sysfs_dir}/class/mem/null" -o \
34 "$ACTION" != "remove" ] ; then
35 if [ -f $j/dev ]; then
36 export DEVPATH=${j#${sysfs_dir}}
37 CLASS=`echo ${i#${sysfs_dir}} | \
38 cut --delimiter='/' --fields=3-`
48 ln -snf /proc/self/fd $udev_root/fd
49 ln -snf /proc/self/fd/0 $udev_root/stdin
50 ln -snf /proc/self/fd/1 $udev_root/stdout
51 ln -snf /proc/self/fd/2 $udev_root/stderr
52 ln -snf /proc/kcore $udev_root/core
55 # delete them when shutting down (not used right now)
57 rm -rf $udev_root/{fd,stdin,stdout,stderr,core}
65 echo -n "starting udev ..."
66 echo "/sbin/udev" > /proc/sys/kernel/hotplug
67 if [ ! -d $sysfs_dir/block ] ; then
68 echo "fatal: sysfs not mounted"
71 rm -f $udev_root/.udev.tdb
72 [ ! -c ${udev_root}/null ] && \
73 mknod -m 0660 ${udev_root}/null c 1 3
75 export UDEV_NO_SLEEP=1
82 echo -n "stopping udev ..."
90 /etc/init.d/udev start
93 if [ -f /var/lock/subsys/udev ]; then
94 echo "udev running ..."
96 echo "udev not running ..."
100 echo "usage: $0 { start | stop | restart }"