#!/bin/sh #---------------------------------------------------------------------------- # /etc/init.d/modules - load kernel modules # # Creation : 2003-09-05 fm # Last Update: $Id$ # # Copyright (c) 2001-@@YEAR@@ the eisfair team, team(at)eisfair(dot)org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- . /etc/config.d/base . /etc/init.d/functions load='/usr/sbin/modprobe' # --------------------------------------------------------------------------- # check loaded # --------------------------------------------------------------------------- check_loaded() { __mod=$(echo "${1}" | /usr/bin/tr '-' '_') /usr/bin/lsmod | /usr/bin/grep -qw "^${__mod} " return ${?} } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- case $1 in start) boot_mesg " * Loading kernel modules ..." if [ "$POWEROFF" = "yes" ] then if ! check_loaded 'apm' then case "$POWEROFF_SMP" in yes) smp=1 ;; *) smp=0 ;; esac case "$POWEROFF_REALMODE" in yes) realmode=1 ;; *) realmode=0 ;; esac ${load} apm power_off=1 smp=$smp realmode_power_off=$realmode 2>/dev/null fi fi idx=1 while [ ${idx} -le ${MODULE_N} ] do eval _active='${MODULE_'${idx}'_ACTIVE}' if [ "${_active}" != "yes" ] then idx=$(/usr/bin/expr ${idx} +1) continue fi _mod='' _act='' _strg='' eval _mod='${MODULE_'${idx}'_NAME}' eval _act='${MODULE_'${idx}'_ACTION}' eval _strg='${MODULE_'${idx}'_STRING}' case "${_act}" in forcedstart) if ! check_loaded ${_mod} then ${load} ${_mod} ${_strg} fi ;; esac idx=$(/usr/bin/expr $idx + 1) done evaluate_retval ;; stop) : ;; esac # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------