]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/initscripts/init.d/udev
Merge branch 'next' into fifteen
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / udev
CommitLineData
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
18case "${1}" in
19 start)
80469a89
AF
20 boot_mesg "Mount /var/run..."
21 mount -n -t tmpfs tmpfs /var/run -o size=2M
22
73d9a908
MT
23 boot_mesg "Populating /dev with device nodes..."
24 if ! grep -q '[[:space:]]sysfs' /proc/mounts; then
25 echo_failure
26 boot_mesg -n "FAILURE:\n\nUnable to create" ${FAILURE}
27 boot_mesg -n " devices without a SysFS filesystem"
28 boot_mesg -n "\n\nAfter you press Enter, this system"
29 boot_mesg -n " will be halted and powered off."
30 boot_mesg -n "\n\nPress Enter to continue..." ${INFO}
31 boot_mesg "" ${NORMAL}
32 read ENTER
33 /etc/rc.d/init.d/halt stop
34 fi
80469a89 35 if ! grep -q '[[:space:]]/dev' /proc/mounts; then
73d9a908 36 echo_failure
80469a89
AF
37 boot_mesg -n "FAILURE:\n\nKernel has no devtmpfs/mount" ${FAILURE}
38 boot_mesg -n " support but this is needed for udev."
73d9a908
MT
39 boot_mesg -n "\n\nAfter you press Enter, this system"
40 boot_mesg -n " will be halted and powered off."
41 boot_mesg -n "\n\nPress Enter to continue..." ${INFO}
42 boot_mesg "" ${NORMAL}
43 read ENTER
44 /etc/rc.d/init.d/halt stop
45 fi
46
47 # Udev handles uevents itself, so we don't need to have
48 # the kernel call out to any binary in response to them
49 echo > /proc/sys/kernel/hotplug
50
51 # Copy static device nodes to /dev
52 cp -a /lib/udev/devices/* /dev
53
54 # Start the udev daemon to continually watch for, and act on,
55 # uevents
56 /sbin/udevd --daemon
57
58 # Now traverse /sys in order to "coldplug" devices that have
59 # already been discovered
80469a89 60 /bin/udevadm trigger
73d9a908
MT
61
62 # Now wait for udevd to process the uevents we triggered
80469a89 63 /bin/udevadm settle
73d9a908
MT
64 evaluate_retval
65
66 ;;
67
68 *)
69 echo "Usage ${0} {start}"
70 exit 1
71 ;;
72esac
73
74# End $rc_base/init.d/udev