Initial commit: Uploaded everything from abs/core
[arch-rock.git] / base / klibc-udev / load-modules.sh
blobf0961a7f30c6545aaa21c4fb8fcfe252bcc44df7
1 #! /bin/sh
2 # Implement blacklisting for udev-loaded modules
3 # Includes module checking
4 # - Aaron Griffin & Tobias Powalowski for Archlinux
5 [ $# -ne 1 ] && exit 1
7 if [ -f /proc/cmdline ]; then
8 for cmd in $(cat /proc/cmdline); do
9 case $cmd in
10 *=*) eval $cmd ;;
11 esac
12 done
15 # get the real names from modaliases
16 i="$(/bin/moddeps $1)"
17 # add disablemodules= from commandline to blacklist
18 k="$(/bin/replace "${disablemodules}" ',')"
19 j="$(/bin/replace "${k}" '-' '_')"
21 if [ "${j}" != "" ] ; then
22 for n in ${i}; do
23 for o in ${j}; do
24 if [ "$n" = "$o" ]; then
25 exit 1
27 done
28 done
30 /sbin/modprobe $1
32 # vim: set et ts=4: