Changeset 0cda898 for bootscripts/lfs/init.d/modules
- Timestamp:
- 08/02/2011 02:15:42 AM (13 years ago)
- Branches:
- 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, 12.2, 12.2-rc1, 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/loongarch-12.2, xry111/mips64el, xry111/multilib, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- a2e555d
- Parents:
- 75fe599
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bootscripts/lfs/init.d/modules
r75fe599 r0cda898 1 1 #!/bin/sh 2 2 ######################################################################## 3 # Begin $rc_base/init.d/modules3 # Begin modules 4 4 # 5 5 # Description : Module auto-loading script 6 6 # 7 7 # Authors : Zack Winkles 8 # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org 8 9 # 9 # Version : 00.00 10 # 11 # Notes : 10 # Version : LFS 7.0 12 11 # 13 12 ######################################################################## 14 13 15 . /etc/sysconfig/rc 16 . ${rc_functions} 14 ### BEGIN INIT INFO 15 # Provides: modules 16 # Required-Start: mountvirtfs sysctl 17 # Should-Start: 18 # Required-Stop: 19 # Should-Stop: 20 # Default-Start: S 21 # Default-Stop: 22 # Short-Description: Loads required modules. 23 # Description: Loads modules listed in /etc/sysconfig/modules. 24 # X-LFS-Provided-By: LFS 25 ### END INIT INFO 26 27 . /lib/boot/functions 17 28 18 29 # Assure that the kernel has module support. … … 20 31 21 32 case "${1}" in 22 start) 33 start) 34 # Exit if there's no modules file or there are no 35 # valid entries 36 [ -r /etc/sysconfig/modules ] && 37 egrep -qv '^($|#)' /etc/sysconfig/modules || 38 exit 0 23 39 24 # Exit if there's no modules file or there are no 25 # valid entries 26 [ -r /etc/sysconfig/modules ] && 27 egrep -qv '^($|#)' /etc/sysconfig/modules || 28 exit 0 40 boot_mesg -n "Loading modules:" ${INFO} 29 41 30 boot_mesg -n "Loading modules:" ${INFO} 42 # Only try to load modules if the user has actually given us 43 # some modules to load. 44 while read module args; do 31 45 32 # Only try to load modules if the user has actually given us 33 # some modules to load. 34 while read module args; do 46 # Ignore comments and blank lines. 47 case "$module" in 48 ""|"#"*) continue ;; 49 esac 35 50 36 # Ignore comments and blank lines. 37 case "$module" in 38 ""|"#"*) continue ;; 39 esac 51 # Attempt to load the module, making 52 # sure to pass any arguments provided. 53 modprobe ${module} ${args} >/dev/null 40 54 41 # Attempt to load the module, making 42 # sure to pass any arguments provided. 43 modprobe ${module} ${args} >/dev/null 55 # Print the module name if successful, 56 # otherwise take note. 57 if [ $? -eq 0 ]; then 58 boot_mesg -n " ${module}" ${NORMAL} 59 else 60 failedmod="${failedmod} ${module}" 61 fi 62 done < /etc/sysconfig/modules 44 63 45 # Print the module name if successful, 46 # otherwise take note. 47 if [ $? -eq 0 ]; then 48 boot_mesg -n " ${module}" ${NORMAL} 49 else 50 failedmod="${failedmod} ${module}" 51 fi 52 done < /etc/sysconfig/modules 64 boot_mesg "" ${NORMAL} 65 # Print a message about successfully loaded 66 # modules on the correct line. 67 echo_ok 53 68 54 boot_mesg "" ${NORMAL} 55 # Print a message about successfully loaded 56 # modules on the correct line. 57 echo_ok 69 # Print a failure message with a list of any 70 # modules that may have failed to load. 71 if [ -n "${failedmod}" ]; then 72 boot_mesg "Failed to load modules:${failedmod}" ${FAILURE} 73 echo_failure 74 fi 75 ;; 58 76 59 # Print a failure message with a list of any 60 # modules that may have failed to load. 61 if [ -n "${failedmod}" ]; then 62 boot_mesg "Failed to load modules:${failedmod}" ${FAILURE} 63 echo_failure 64 fi 65 ;; 66 *) 67 echo "Usage: ${0} {start}" 68 exit 1 69 ;; 77 *) 78 echo "Usage: ${0} {start}" 79 exit 1 80 ;; 70 81 esac 71 82 72 # End $rc_base/init.d/modules83 # End modules
Note:
See TracChangeset
for help on using the changeset viewer.