Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] Improved modutils init script comments please

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: "Andraž 'ruskie' Levstik" <ruskie AT mages.ath.cx>
  • To: <sm-discuss AT lists.ibiblio.org>
  • Subject: Re: [SM-Discuss] Improved modutils init script comments please
  • Date: Wed, 31 Jan 2007 11:51:20 +0100

On 00:24:29 2007-01-25 "Andraž 'ruskie' Levstik" <ruskie AT mages.ath.cx>
wrote:
> It is that one is only fallback and it would default to "" anyway...
>
> Well the +x idea would work as well...
>
Attached is the +x version of the script. Please comment and if it's ok I'll
commit it in. Then work can start on getting alsa and other module
installing spells to acctually make use of it.

--
Andraž "ruskie" Levstik
Source Mage GNU/Linux Games grimoire guru
Geek/Hacker/Tinker

Hacker FAQ: http://www.plethora.net/%7eseebs/faqs/hacker.html
Be sure brain is in gear before engaging mouth.

Key id = F4C1F89C
Key fingerprint = 6FF2 8F20 4C9D DB36 B5B6 F134 884D 72CC F4C1 F89C
#!/bin/bash

RUNLEVEL=S
PROVIDES=modules
NEEDS="+root_fs"
RECOMMENDED=yes

. /etc/init.d/smgl_init

function load_modules(){
local subsystem
for subsystem in $@
if [[ -e "$1" ]] && [[ -x /sbin/modprobe ]] ; then
( cat "$1"; builtin echo ) |
while read MODULE ARGS; do
case $MODULE in
\#*|"") continue ;;
esac
echo "Loading module $MODULE..."
loadproc modprobe $MODULE $ARGS
done
fi
}

function dep_modules(){
if [[ -x /sbin/depmod ]]; then
echo "Running depmod..."
loadproc depmod -a
fi
}

function start(){

required_executable /sbin/depmod
required_executable /sbin/modprobe

dep_modules

for sub_sys in /etc/modules.d/modules.* ; do
if [[ -x $sub_sys ]]
then
echo "Loading $sub_sys modules..."
load_modules "$sub_sys"
fi
done

echo "Loading user defined modules..."
load_modules /etc/modules
unset sub_sys MODULE ARGS
}

function stop(){
loadproc true
}



Archive powered by MHonArc 2.6.24.

Top of Page