Changeset 1d02f01 in bootscripts-standard for clfs/init.d/modules
- Timestamp:
- Oct 23, 2007, 1:07:58 AM (17 years ago)
- Branches:
- master
- Children:
- 1680407
- Parents:
- d8a3177
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
clfs/init.d/modules
rd8a3177 r1d02f01 22 22 start) 23 23 24 # If proc is mounted, find the current kernel 25 # message level 26 if [ -f /proc/sys/kernel/printk ]; then 27 prev_msg=`cat /proc/sys/kernel/printk | \ 28 sed 'l 1' | sed -n '2~0p' | \ 29 sed 's/\\\//'` 30 else 31 prev_msg="6" 32 fi 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 33 29 34 # Now set the message level to 1 so not to make too 35 # much noise when loading modules 36 dmesg -n 1 30 boot_mesg -n "Loading modules:" ${INFO} 37 31 38 32 # Only try to load modules if the user has actually given us 39 33 # some modules to load. 40 if egrep -qv '^(#|$)' /etc/sysconfig/modules 2>/dev/null 41 then 34 while read module args; do 42 35 43 # Read in the configuration file. 44 exec 9>&0 < /etc/sysconfig/modules 36 # Ignore comments and blank lines. 37 case "$module" in 38 ""|"#"*) continue ;; 39 esac 45 40 46 boot_mesg -n "Loading modules:" ${INFO} 41 # Attempt to load the module, making 42 # sure to pass any arguments provided. 43 modprobe ${module} ${args} >/dev/null 47 44 48 while read module args 49 do 50 # Ignore comments and blank lines. 51 case "${module}" in 52 ""|\#*) continue ;; 53 esac 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 54 53 55 # Attempt to load the module, making 56 # sure to pass any arguments provided. 57 modprobe ${module} ${args} 2>&1 > /dev/null 54 boot_mesg "" ${NORMAL} 55 # Print a message about successfully loaded 56 # modules on the correct line. 57 echo_ok 58 58 59 # Print the module name if successful, 60 # otherwise take note. 61 if [ ${?} -eq 0 ]; then 62 boot_mesg -n " ${module}" ${NORMAL} 63 else 64 failedmod="${failedmod} ${module}" 65 fi 66 done 67 68 boot_mesg "" ${NORMAL} 69 # Print a message about successfully loaded 70 # modules on the correct line. 71 echo_ok 72 73 # Print a failure message with a list of any 74 # modules that may have failed to load. 75 if [ "${failedmod}" ]; then 76 boot_mesg "Failed to load modules:${failedmod}" ${FAILURE} 77 echo_failure 78 fi 79 80 exec 0>&9 9>&- 81 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 82 64 fi 83 # Set the kernel message level back to it's previous value.84 dmesg -n "${prev_msg}"85 65 ;; 86 66 *)
Note:
See TracChangeset
for help on using the changeset viewer.