]> git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/system/udev
udev: set short timeout for unsupported firmware fallback handler
[ipfire-2.x.git] / src / initscripts / system / udev
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
32 if ! grep -q '[[:space:]]/dev' /proc/mounts; then
33 echo_failure
34 boot_mesg -n "FAILURE:\n\nKernel has no devtmpfs/mount" ${FAILURE}
35 boot_mesg -n " support but this is needed for udev."
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 if ! grep -q '[[:space:]]/dev/shm' /proc/mounts; then
45 mkdir -p /dev/shm
46 mount -t tmpfs tmpfs /dev/shm
47 fi
48
49 if ! grep -q '[[:space:]]/dev/pts' /proc/mounts; then
50 mkdir -p /dev/pts
51 mount -t devpts devpts -o gid=5,mode=620 /dev/pts
52 fi
53
54 # eudev does not support firmware handling
55 # and we have never used it. but it is enabled in kernel
56 # and cause long delays if a driver like ath10k try different
57 # firmware for init...
58 echo 1 > /sys/class/firmware/timeout
59
60 # Start the udev daemon to continually watch for, and act on,
61 # uevents
62 boot_mesg "Starting udev daemon..."
63 loadproc udevd --daemon
64
65 # Now traverse /sys in order to "coldplug" devices that have
66 # already been discovered
67 /bin/udevadm trigger --action=add
68
69 # Now wait for udevd to process the uevents we triggered
70 /bin/udevadm settle
71 evaluate_retval
72
73 ;;
74
75 restart)
76 boot_mesg "Stopping udev daemon..."
77 killproc udevd
78
79 exec $0 start
80 ;;
81
82 *)
83 echo "Usage ${0} {start}"
84 exit 1
85 ;;
86 esac
87
88 # End $rc_base/init.d/udev