]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/system/udev
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / src / initscripts / system / udev
1 #!/bin/sh
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 ###############################################################################
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
39 if ! grep -q '[[:space:]]/dev' /proc/mounts; then
40 echo_failure
41 boot_mesg -n "FAILURE:\n\nKernel has no devtmpfs/mount" ${FAILURE}
42 boot_mesg -n " support but this is needed for udev."
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
51 if ! grep -q '[[:space:]]/dev/shm' /proc/mounts; then
52 mkdir -p /dev/shm
53 mount -t tmpfs tmpfs -o nosuid,nodev,noexec /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 nosuid,noexec,gid=5,mode=620 /dev/pts
59 fi
60
61 # Start the udev daemon to continually watch for, and act on,
62 # uevents
63 boot_mesg "Starting udev daemon..."
64 loadproc udevd --daemon
65
66 # Now traverse /sys in order to "coldplug" devices that have
67 # already been discovered
68 /bin/udevadm trigger --action=add
69
70 # Now wait for udevd to process the uevents we triggered
71 /bin/udevadm settle
72 evaluate_retval
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