]>
Commit | Line | Data |
---|---|---|
73d9a908 MT |
1 | #!/bin/sh |
2 | ######################################################################## | |
3 | # Begin $rc_base/init.d/udev | |
4 | # | |
5 | # Description : Udev cold-plugging script | |
6 | # | |
7 | # Authors : Zack Winkles, Alexander E. Patrakov | |
8 | # | |
9 | # Version : 00.02 | |
10 | # | |
11 | # Notes : | |
12 | # | |
13 | ######################################################################## | |
14 | ||
15 | . /etc/sysconfig/rc | |
16 | . ${rc_functions} | |
17 | ||
18 | case "${1}" in | |
19 | start) | |
20 | boot_mesg "Populating /dev with device nodes..." | |
21 | if ! grep -q '[[:space:]]sysfs' /proc/mounts; then | |
22 | echo_failure | |
23 | boot_mesg -n "FAILURE:\n\nUnable to create" ${FAILURE} | |
24 | boot_mesg -n " devices without a SysFS filesystem" | |
25 | boot_mesg -n "\n\nAfter you press Enter, this system" | |
26 | boot_mesg -n " will be halted and powered off." | |
27 | boot_mesg -n "\n\nPress Enter to continue..." ${INFO} | |
28 | boot_mesg "" ${NORMAL} | |
29 | read ENTER | |
30 | /etc/rc.d/init.d/halt stop | |
31 | fi | |
80469a89 | 32 | if ! grep -q '[[:space:]]/dev' /proc/mounts; then |
73d9a908 | 33 | echo_failure |
80469a89 AF |
34 | boot_mesg -n "FAILURE:\n\nKernel has no devtmpfs/mount" ${FAILURE} |
35 | boot_mesg -n " support but this is needed for udev." | |
73d9a908 MT |
36 | boot_mesg -n "\n\nAfter you press Enter, this system" |
37 | boot_mesg -n " will be halted and powered off." | |
38 | boot_mesg -n "\n\nPress Enter to continue..." ${INFO} | |
39 | boot_mesg "" ${NORMAL} | |
40 | read ENTER | |
41 | /etc/rc.d/init.d/halt stop | |
42 | fi | |
43 | ||
44 | # Udev handles uevents itself, so we don't need to have | |
45 | # the kernel call out to any binary in response to them | |
46 | echo > /proc/sys/kernel/hotplug | |
47 | ||
48 | # Copy static device nodes to /dev | |
49 | cp -a /lib/udev/devices/* /dev | |
50 | ||
51 | # Start the udev daemon to continually watch for, and act on, | |
52 | # uevents | |
53 | /sbin/udevd --daemon | |
54 | ||
55 | # Now traverse /sys in order to "coldplug" devices that have | |
56 | # already been discovered | |
80469a89 | 57 | /bin/udevadm trigger |
73d9a908 MT |
58 | |
59 | # Now wait for udevd to process the uevents we triggered | |
80469a89 | 60 | /bin/udevadm settle |
73d9a908 MT |
61 | evaluate_retval |
62 | ||
63 | ;; | |
64 | ||
65 | *) | |
66 | echo "Usage ${0} {start}" | |
67 | exit 1 | |
68 | ;; | |
69 | esac | |
70 | ||
71 | # End $rc_base/init.d/udev |