source: bootscripts/lfs/init.d/modules@ a44ae577

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 arm bdubbs/gcc13 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 a44ae577 was a44ae577, checked in by Pierre Labastie <pierre.labastie@…>, 3 years ago

Remove spaces at end of lines - bootscripts

  • Property mode set to 100644
File size: 2.1 KB
Line 
1#!/bin/sh
2########################################################################
3# Begin modules
4#
5# Description : Module auto-loading script
6#
7# Authors : Zack Winkles
8# DJ Lucas - dj@linuxfromscratch.org
9# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
10#
11# Version : LFS 7.0
12#
13########################################################################
14
15### BEGIN INIT INFO
16# Provides: modules
17# Required-Start: mountvirtfs
18# Should-Start:
19# Required-Stop:
20# Should-Stop:
21# Default-Start: S
22# Default-Stop:
23# Short-Description: Loads required modules.
24# Description: Loads modules listed in /etc/sysconfig/modules.
25# X-LFS-Provided-By: LFS
26### END INIT INFO
27
28# Assure that the kernel has module support.
29[ -e /proc/modules ] || exit 0
30
31. /lib/lsb/init-functions
32
33case "${1}" in
34 start)
35 # Exit if there's no modules file or there are no
36 # valid entries
37 [ -r /etc/sysconfig/modules ] || exit 0
38 egrep -qv '^($|#)' /etc/sysconfig/modules || exit 0
39
40 log_info_msg "Loading modules:"
41
42 # Only try to load modules if the user has actually given us
43 # some modules to load.
44
45 while read module args; do
46
47 # Ignore comments and blank lines.
48 case "$module" in
49 ""|"#"*) continue ;;
50 esac
51
52 # Attempt to load the module, passing any arguments provided.
53 modprobe ${module} ${args} >/dev/null
54
55 # Print the module name if successful, otherwise take note.
56 if [ $? -eq 0 ]; then
57 log_info_msg2 " ${module}"
58 else
59 failedmod="${failedmod} ${module}"
60 fi
61 done < /etc/sysconfig/modules
62
63 # Print a message about successfully loaded modules on the correct line.
64 log_success_msg2
65
66 # Print a failure message with a list of any modules that
67 # may have failed to load.
68 if [ -n "${failedmod}" ]; then
69 log_failure_msg "Failed to load modules:${failedmod}"
70 exit 1
71 fi
72 ;;
73
74 *)
75 echo "Usage: ${0} {start}"
76 exit 1
77 ;;
78esac
79
80exit 0
81
82# End modules
Note: See TracBrowser for help on using the repository browser.