source: bootscripts/lfs/init.d/udev

trunk
Last change on this file was 623081a, checked in by Pierre Labastie <pierre.labastie@…>, 7 months ago

bootscripts: change "halt stop" to "halt start"

Commit 27d23b1d has changed the convention that scripts with Sxxx
symlinks should be run with "stop" parameter in runlevels 0 and 6.
They should now be called with the more intuitive "start" parameter.
But a few scripts still call "/etc/init.d/halt stop". Fortunately, this
occurs in code paths that are rarely run (unrecoverable errors). So it
was not noticed until now. Anyway, this is fixed in this commit.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1#!/bin/sh
2########################################################################
3# Begin udev
4#
5# Description : Udev cold-plugging script
6#
7# Authors : Zack Winkles, Alexander E. Patrakov
8# DJ Lucas - dj@linuxfromscratch.org
9# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
10# Xi Ruoyao - xry111@xry111.site
11#
12# Version : LFS 12.0
13#
14########################################################################
15
16### BEGIN INIT INFO
17# Provides: udev $time
18# Required-Start: localnet
19# Should-Start: modules
20# Required-Stop:
21# Should-Stop:
22# Default-Start: S
23# Default-Stop:
24# Short-Description: Populates /dev with device nodes.
25# Description: Mounts a tempfs on /dev and starts the udevd daemon.
26# Device nodes are created as defined by udev.
27# X-LFS-Provided-By: LFS
28### END INIT INFO
29
30. /lib/lsb/init-functions
31
32case "${1}" in
33 start)
34 log_info_msg "Populating /dev with device nodes... "
35 if ! grep -q '[[:space:]]sysfs' /proc/mounts; then
36 log_failure_msg2
37 msg="FAILURE:\n\nUnable to create "
38 msg="${msg}devices without a SysFS filesystem\n\n"
39 msg="${msg}After you press Enter, this system "
40 msg="${msg}will be halted and powered off.\n\n"
41 log_info_msg "$msg"
42 log_info_msg "Press Enter to continue..."
43 wait_for_user
44 /etc/rc.d/init.d/halt start
45 fi
46
47 # Start the udev daemon to continually watch for, and act on,
48 # uevents
49 SYSTEMD_LOG_TARGET=kmsg /sbin/udevd --daemon
50
51 # Now traverse /sys in order to "coldplug" devices that have
52 # already been discovered
53 /bin/udevadm trigger --action=add --type=subsystems
54 /bin/udevadm trigger --action=add --type=devices
55 /bin/udevadm trigger --action=change --type=devices
56
57 # Now wait for udevd to process the uevents we triggered
58 if ! is_true "$OMIT_UDEV_SETTLE"; then
59 /bin/udevadm settle
60 fi
61
62 # If any LVM based partitions are on the system, ensure they
63 # are activated so they can be used.
64 if [ -x /sbin/vgchange ]; then /sbin/vgchange -a y >/dev/null; fi
65
66 log_success_msg2
67 ;;
68
69 *)
70 echo "Usage ${0} {start}"
71 exit 1
72 ;;
73esac
74
75exit 0
76
77# End udev
Note: See TracBrowser for help on using the repository browser.