#!/bin/sh # Assure that the kernel has module support. [ -e /proc/ksyms -o -e /proc/modules ] || exit 0 THIS=$(basename $0) case "${1}" in start) # Exit if there's no modules file or there are no # valid entries if [ -r /etc/sysconfig/modules ]; then egrep -qv '^($|#)' /etc/sysconfig/modules if [ $? -ne 0 ]; then echo "$THIS: no module found in /etc/sysconfig/modules" | tee/dev/kmsg exit 0 fi fi echo "$THIS: loading modules from /etc/sysconfig/modules:" | tee/dev/kmsg # Only try to load modules if the user has actually given us # some modules to load. while read MODULE ARGS; do # Ignore comments and blank lines. case "$MODULE" in ""|"#"*) continue ;; esac # Attempt to load the module, making # sure to pass any arguments provided. modprobe ${MODULE} ${ARGS} >/dev/null # Print the module name if successful, # otherwise take note. if [ $? -eq 0 ]; then echo "$THIS: loaded module ${MODULE}" | tee /dev/kmsg else echo "$THIS: failed to load module ${MODULE}" | tee /dev/kmsg fi done < /etc/sysconfig/modules # Print a message about successfully loaded # modules on the correct line. echo "$THIS: finished loading modules" | tee /dev/kmsg ;; *) echo "Usage: ${0} {start}" exit 1 ;; esac