]>
Commit | Line | Data |
---|---|---|
73d9a908 | 1 | #!/bin/sh |
66c36198 PM |
2 | ############################################################################### |
3 | # # | |
4 | # IPFire.org - A linux based firewall # | |
5 | # Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> # | |
6 | # # | |
7 | # This program is free software: you can redistribute it and/or modify # | |
8 | # it under the terms of the GNU General Public License as published by # | |
9 | # the Free Software Foundation, either version 3 of the License, or # | |
10 | # (at your option) any later version. # | |
11 | # # | |
12 | # This program is distributed in the hope that it will be useful, # | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
15 | # GNU General Public License for more details. # | |
16 | # # | |
17 | # You should have received a copy of the GNU General Public License # | |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # | |
19 | # # | |
20 | ############################################################################### | |
73d9a908 MT |
21 | |
22 | . /etc/sysconfig/rc | |
23 | . ${rc_functions} | |
24 | ||
25 | case "${1}" in | |
26 | start) | |
27 | boot_mesg "Populating /dev with device nodes..." | |
28 | if ! grep -q '[[:space:]]sysfs' /proc/mounts; then | |
29 | echo_failure | |
30 | boot_mesg -n "FAILURE:\n\nUnable to create" ${FAILURE} | |
31 | boot_mesg -n " devices without a SysFS filesystem" | |
32 | boot_mesg -n "\n\nAfter you press Enter, this system" | |
33 | boot_mesg -n " will be halted and powered off." | |
34 | boot_mesg -n "\n\nPress Enter to continue..." ${INFO} | |
35 | boot_mesg "" ${NORMAL} | |
36 | read ENTER | |
37 | /etc/rc.d/init.d/halt stop | |
38 | fi | |
80469a89 | 39 | if ! grep -q '[[:space:]]/dev' /proc/mounts; then |
73d9a908 | 40 | echo_failure |
80469a89 AF |
41 | boot_mesg -n "FAILURE:\n\nKernel has no devtmpfs/mount" ${FAILURE} |
42 | boot_mesg -n " support but this is needed for udev." | |
73d9a908 MT |
43 | boot_mesg -n "\n\nAfter you press Enter, this system" |
44 | boot_mesg -n " will be halted and powered off." | |
45 | boot_mesg -n "\n\nPress Enter to continue..." ${INFO} | |
46 | boot_mesg "" ${NORMAL} | |
47 | read ENTER | |
48 | /etc/rc.d/init.d/halt stop | |
49 | fi | |
50 | ||
a6acaa34 AF |
51 | if ! grep -q '[[:space:]]/dev/shm' /proc/mounts; then |
52 | mkdir -p /dev/shm | |
53 | mount -t tmpfs tmpfs /dev/shm | |
54 | fi | |
55 | ||
56 | if ! grep -q '[[:space:]]/dev/pts' /proc/mounts; then | |
57 | mkdir -p /dev/pts | |
58 | mount -t devpts devpts -o gid=5,mode=620 /dev/pts | |
59 | fi | |
60 | ||
73d9a908 MT |
61 | # Start the udev daemon to continually watch for, and act on, |
62 | # uevents | |
7d06d0de MT |
63 | boot_mesg "Starting udev daemon..." |
64 | loadproc udevd --daemon | |
73d9a908 MT |
65 | |
66 | # Now traverse /sys in order to "coldplug" devices that have | |
67 | # already been discovered | |
3d2415f9 | 68 | /bin/udevadm trigger --action=add |
73d9a908 MT |
69 | |
70 | # Now wait for udevd to process the uevents we triggered | |
80469a89 | 71 | /bin/udevadm settle |
73d9a908 MT |
72 | evaluate_retval |
73 | ||
74 | ;; | |
75 | ||
7d06d0de MT |
76 | restart) |
77 | boot_mesg "Stopping udev daemon..." | |
78 | killproc udevd | |
79 | ||
80 | exec $0 start | |
81 | ;; | |
82 | ||
73d9a908 MT |
83 | *) |
84 | echo "Usage ${0} {start}" | |
85 | exit 1 | |
86 | ;; | |
87 | esac |