]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - config/mkinitcpio/start_udev
4 # script to initialize /dev by using udev.
6 # Modified for Archlinux by Tobias Powalowski <tpowa@archlinux.org>
10 # Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
12 # Released under the GPL v2 only.
14 # This needs to be run at the earliest possible point in the boot
17 # Based on the udev init.d script
19 # Thanks go out to the Gentoo developers for proving
20 # that this is possible to do.
22 # Yes, it's very verbose, feel free to turn off all of the echo calls,
23 # they were there to make me feel better that everything was working
24 # properly during development...
32 trigger_device_events
()
39 # disabled because it hangs network boot
41 #while ! [ "$loop" -gt 0 -a -d /dev/.udev/queue ]; do
50 # there are a few things that sysfs does not export for us.
51 # these things go here (and remember to remove them in
52 # remove_extra_nodes()
54 # Thanks to Gentoo for the initial list of these.
55 ln -sf /proc
/self
/fd
$udev_root/fd
56 ln -sf /proc
/self
/fd
/0 $udev_root/stdin
57 ln -sf /proc
/self
/fd
/1 $udev_root/stdout
58 ln -sf /proc
/self
/fd
/2 $udev_root/stderr
59 ln -sf /proc
/kcore
$udev_root/core
64 # don't use udev if sysfs is not mounted.
65 if [ ! -d $sysfs_dir/block
]; then
69 #echo "mounting... ramfs at $udev_root"
70 mount
-t ramfs none
$udev_root
72 # propogate /udev from /sys
73 #echo "Creating initial udev device nodes:"
75 #echo "making extra nodes"
78 # check if udevd is already running
79 #echo "start udev daemon"
83 2.6.
[0-9]|
2.6.
[0-9][!0-9]*) ;;
84 *) if [ -f "/sys/class/tty/console/uevent" ]; then
85 #echo "Kernel >= 2.6.15 and supports uevents"
86 # trigger the sorted events
87 echo -e '\000\000\000\000' > /proc
/sys
/kernel
/hotplug
88 # catch events that are real fast
89 mkdir
-p /dev
/.udev
/queue
91 # for older kernels without uevents will be removed when udevstart dies in udev
92 echo "Kernel does not support uevents, you need a kernel >= 2.6.15!"
101 # configure all devices
102 trigger_device_events
103 # until we know how to do better, just wait for _all_ events to finish
107 if [ $# -eq 0 ]; then
112 [ "$1" = "init" ] && udev_init
113 [ "$1" = "uevents" ] && udev_uevents