diff options
author | Judd Vinet <judd@archlinux.org> | 2005-11-15 02:51:52 +0000 |
---|---|---|
committer | Judd Vinet <judd@archlinux.org> | 2005-11-15 02:51:52 +0000 |
commit | 2dc0038155b978eb70be482313cc8535dadc436d (patch) | |
tree | 211ff698f3b20d73013d70d3f2aad9a87556bf67 | |
parent | abdeaf8051aaadb9f5270a14e45481a8d61e0b95 (diff) |
added variables for autoloading modules, cleaned up rc.conf a bit
-rwxr-xr-x | hwdetect | 39 | ||||
-rwxr-xr-x | network | 2 | ||||
-rw-r--r-- | rc.conf | 38 | ||||
-rwxr-xr-x | rc.sysinit | 6 |
4 files changed, 56 insertions, 29 deletions
@@ -33,11 +33,18 @@ usage () { [ "$1" == "" ] && usage +: >/tmp/modules-plain +: >/tmp/modules-sorted +: >/tmp/moduleslist +: >/tmp/modprobe +: >/tmp/modules + # find pci aliases find /sys/devices/ -name "modalias" | grep pci > /tmp/modules # delete pci devices that are blacklisted -for i in "${BLACKLIST[@]}"; do +for i in $PCI_BLACKLIST; do + [ "$i" ] || continue sed -i -e "/$i/d" /tmp/modules done @@ -66,21 +73,25 @@ done sort -u /tmp/modules-plain >> /tmp/modules-sorted sed -ne "s#^insmod.*/\(.*\)\.ko.*#\1#p" /tmp/modules-sorted >> /tmp/moduleslist -listex() { - ln=$1 ; shift - if [ $# -gt 0 ]; then - ex=$1 ; shift - if [ "`echo $ln | grep -v $ex`" ]; then - listex "$ln" $* - fi - else - echo $ln | sed -ne "s#^/.*/\(.*\)\.ko.*#\1#p" - fi -} +# delete modules that are blacklisted +for i in $BLACKLIST; do + [ "$i" ] || continue + sed -i -e "/^$i$/d" /tmp/moduleslist +done + listmods() { key=$1 ; shift - for ln in `grep "$key" /tmp/modules-sorted | sed 's|^insmod ||g' | sort -u`; do - listex "$ln" $* + ex= + while [ "$1" ]; do + [ "$ex" ] && ex="$ex|$1" || ex="$1" + shift + done + for ln in `grep "$key" /tmp/modules-sorted | sed 's|^insmod ||g'`; do + if [ "$ex" ]; then + echo $ln | egrep -v "$ex" | sed -ne "s#^/.*/\(.*\)\.ko.*#\1#p" + else + echo $ln | sed -ne "s#^/.*/\(.*\)\.ko.*#\1#p" + fi done } showlist() { @@ -32,7 +32,7 @@ ifup() return 1 fi # don't bring up an interface that's already up - [ "`/sbin/ifconfig ${1} 2>/dev/null | grep UP`" ] && return 1 + [ "`/sbin/ifconfig ${1} 2>/dev/null | grep UP`" ] && return 0 eval iwcfg="\$wlan_${1}" if [ "$iwcfg" != "" ]; then /usr/sbin/iwconfig $iwcfg @@ -3,7 +3,9 @@ # # -# Localization +# ----------------------------------------------------------------------- +# LOCALIZATION +# ----------------------------------------------------------------------- # # LOCALE: available languages can be listed with the 'locale -a' command # HARDWARECLOCK: set to "UTC" or "localtime" @@ -21,20 +23,29 @@ CONSOLEFONT= CONSOLEMAP= USECOLOR="yes" +# +# ----------------------------------------------------------------------- +# HARDWARE +# ----------------------------------------------------------------------- +# +# Scan hardware and load required modules at bootup +MOD_AUTOLOAD="yes" +# Module Blacklist - modules in this list will never be loaded by hwdetect +MOD_BLACKLIST=() +# +# Modules to load at boot-up (in this order) +# - prefix a module with a ! to disable it +# +MODULES=(!usbserial) # Scan for LVM volume groups at startup, required if you use LVM USELVM="no" # -# Networking +# ----------------------------------------------------------------------- +# NETWORKING +# ----------------------------------------------------------------------- # HOSTNAME="myhost" - -# -# Module to load at boot-up (in this order) -# (prefix a module with a ! to disable it) -# -MODULES=(!usbserial !ide-scsi) - # # Interfaces to start at boot-up (in this order) # Declare each interface then list in INTERFACES @@ -45,7 +56,6 @@ MODULES=(!usbserial !ide-scsi) lo="lo 127.0.0.1" eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" INTERFACES=(lo eth0) - # # Routes to start at boot-up (in this order) # Declare each route then list in ROUTES @@ -53,7 +63,6 @@ INTERFACES=(lo eth0) # gateway="default gw 192.168.0.1" ROUTES=(!gateway) - # # Enable these network profiles at boot-up. These are only useful # if you happen to need multiple network configurations (ie, laptop users) @@ -65,10 +74,15 @@ ROUTES=(!gateway) #NET_PROFILES=(main) # +# ----------------------------------------------------------------------- +# DAEMONS +# ----------------------------------------------------------------------- +# # Daemons to start at boot-up (in this order) # - prefix a daemon with a ! to disable it # - prefix a daemon with a @ to start it up in the background # -DAEMONS=(syslog-ng hotplug !pcmcia network netfs crond) +DAEMONS=(syslog-ng !hotplug !pcmcia network netfs crond) + # End of file @@ -121,8 +121,6 @@ umount /proc && mount -t proc none /proc /bin/mount -a -t nonfs,nosmbfs,nocifs,noncpfs,nosysfs,nousbfs stat_done -status "Detecting Required Modules" /sbin/hwdetect -load-modules - stat_busy "Configuring System Clock" if [ "$HARDWARECLOCK" = "UTC" ]; then /sbin/hwclock --utc --hctosys @@ -216,6 +214,10 @@ fi # Load modules from the MODULES array defined in rc.conf if [ -f /proc/modules ]; then stat_busy "Loading Modules" + if [ "$MOD_AUTOLOAD" = "yes" -o "$MOD_AUTOLOAD" = "YES" ]; then + export BLACKLIST="${MOD_BLACKLIST[*]}" + /sbin/hwdetect -load-modules + fi for mod in "${MODULES[@]}"; do if [[ `echo $mod | grep '^[^\!]' | wc -l` -eq 1 ]]; then /sbin/modprobe $mod |