2 ########################################################################
3 # Begin $rc_base/init.d/udev
5 # Description : Udev cold-plugging script
7 # Authors : Zack Winkles, Alexander E. Patrakov
13 ########################################################################
20 boot_mesg
"Populating /dev with device nodes..."
21 if ! grep -q '[[:space:]]sysfs' /proc
/mounts
; then
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}
30 /etc
/rc.d
/init.d
/halt stop
33 # Mount a temporary file system over /dev, so that any devices
34 # made or removed during this boot don't affect the next one.
35 # The reason we don't write to mtab is because we don't ever
36 # want /dev to be unavailable (such as by `umount -a').
37 if ! mountpoint
/dev
> /dev
/null
; then
38 mount
-n -t tmpfs tmpfs
/dev
-o mode
=755
40 if [ ${?} != 0 ]; then
42 boot_mesg
-n "FAILURE:\n\nCannot mount a tmpfs" ${FAILURE}
43 boot_mesg
-n " onto /dev, this system will be halted."
44 boot_mesg
-n "\n\nAfter you press Enter, this system"
45 boot_mesg
-n " will be halted and powered off."
46 boot_mesg
-n "\n\nPress Enter to continue..." ${INFO}
47 boot_mesg
"" ${NORMAL}
49 /etc
/rc.d
/init.d
/halt stop
52 ln -s /run
/shm
/dev
/shm
54 # Udev handles uevents itself, so we don't need to have
55 # the kernel call out to any binary in response to them
56 echo > /proc
/sys
/kernel
/hotplug
58 # Copy the only static device node that Udev >= 155 doesn't
60 cp -a /lib
/udev
/devices
/null
/dev
62 # Start the udev daemon to continually watch for, and act on,
66 # Now traverse /sys in order to "coldplug" devices that have
67 # already been discovered
68 /sbin
/udevadm trigger
--action=add
70 # Now wait for udevd to process the uevents we triggered
77 echo "Usage ${0} {start}"
82 # End $rc_base/init.d/udev