5 # script to initialize /dev by using udev.
7 # This needs to be run at the earliest possible point in the boot
10 # Based on the udev init.d script
21 # handle block devices and their partitions
22 for i in ${sysfs_dir}/block/*; do
24 export DEVPATH=${i#${sysfs_dir}}
28 # add each partition, on each device
30 if [ -f $j/dev ]; then
31 export DEVPATH=${j#${sysfs_dir}}
37 # all other device classes
38 for i in ${sysfs_dir}/class/*; do
40 if [ -f $j/dev ]; then
41 export DEVPATH=${j#${sysfs_dir}}
42 CLASS=`echo ${i#${sysfs_dir}} | \
43 cut --delimiter='/' --fields=3-`
53 # there are a few things that sysfs does not export for us.
54 # these things go here (and remember to remove them in
55 # remove_extra_nodes()
57 # Thanks to Gentoo for the initial list of these.
58 ln -snf /proc/self/fd $udev_root/fd
59 ln -snf /proc/self/fd/0 $udev_root/stdin
60 ln -snf /proc/self/fd/1 $udev_root/stdout
61 ln -snf /proc/self/fd/2 $udev_root/stderr
62 ln -snf /proc/kcore $udev_root/core
68 # don't use udev if sysfs is not mounted.
69 if [ ! -d $sysfs_dir/block ]; then
73 echo "mounting... ramfs at $udev_root"
74 mount -n -t ramfs none $udev_root
76 # We want to start udevd ourselves if it isn't already running. This
77 # lets udevd run at a sane nice level...
81 # propogate /udev from /sys
83 export UDEV_NO_SLEEP=1
84 echo "Creating initial udev device nodes:"
87 echo "making extra nodes"
90 echo "udev startup is finished!"