source: bootscripts/contrib/lsb-v3/init.d/modules@ 12bc336

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 12bc336 was 1c48007, checked in by Bruce Dubbs <bdubbs@…>, 16 years ago

Moved bootscripts and udev-config to BOOK
Updated Makefile to automatically generate bootscript and udev-config tarballs
Updated licesnse to be the same as BLFS

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8548 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.9 KB
Line 
1#!/bin/sh
2# Begin /etc/init.d/modules
3
4### BEGIN INIT INFO
5# Provides: modules
6# Required-Start: mountkernfs
7# Should-Start: sysctl
8# Required-Stop:
9# Should-Stop:
10# Default-Start: sysinit
11# Default-Stop:
12# Short-Description: Loads required modules.
13# Description: Loads modules listed in /etc/sysconfig/modules.
14# X-LFS-Default-Start: S10
15# X-LFS-Default-Stop:
16# X-LFS-Provided-By: LFS
17### END INIT INFO
18
19. /lib/lsb/init-functions
20
21# Assure that the kernel has module support.
22[ -e /proc/ksyms -o -e /proc/modules ] || exit 0
23
24case "${1}" in
25 start)
26
27 # Exit if there's no modules file or there are no
28 # valid entries
29 [ -r /etc/sysconfig/modules ] &&
30 egrep -qv '^($|#)' /etc/sysconfig/modules ||
31 exit 0
32
33 # If proc is mounted, find the current kernel
34 # message level
35 if [ -f /proc/sys/kernel/printk ]; then
36 prev_msg=`cat /proc/sys/kernel/printk | \
37 sed 'l 1' | sed -n '2~0p' | \
38 sed 's/\\\//'`
39 else
40 prev_msg="6"
41 fi
42
43 # Now set the message level to 1 so not to make too
44 # much noise when loading modules
45 dmesg -n 1
46
47 # Only try to load modules if the user has actually given us
48 # some modules to load.
49 if egrep -qv '^(#|$)' /etc/sysconfig/modules 2>/dev/null
50 then
51
52 # Read in the configuration file.
53 exec 9>&0 < /etc/sysconfig/modules
54
55 message="${INFO}Loading modules:"
56
57 while read module args
58 do
59 # Ignore comments and blank lines.
60 case "${module}" in
61 ""|\#*) continue ;;
62 esac
63
64 # Attempt to load the module, making
65 # sure to pass any arguments provided.
66 modprobe ${module} ${args} > /dev/null
67
68 # Print the module name if successful,
69 # otherwise take note.
70 if [ ${?} -eq 0 ]; then
71 message="${message}${NORMAL} ${module}"
72 else
73 failedmod="${failedmod} ${module}"
74 fi
75 done
76
77 # Print a message about successfully loaded
78 # modules on the correct line.
79 log_success_msg "${message}"
80
81 # Print a failure message with a list of any
82 # modules that may have failed to load.
83 if [ "${failedmod}" ]; then
84 log_failure_msg "${FAILURE}Failed to load modules:${failedmod}"
85 fi
86
87 exec 0>&9 9>&-
88
89 fi
90 # Set the kernel message level back to it's previous value.
91 dmesg -n "${prev_msg}"
92 ;;
93 *)
94 echo "Usage: ${0} {start}"
95 exit 1
96 ;;
97esac
98
99# End /etc/init.d/modules
Note: See TracBrowser for help on using the repository browser.