mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-13 12:32:59 +02:00
Kernel ist jetzt noch modularer, da keine IDE/FS-Treiber vorhanden sind. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@561 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
33 lines
830 B
Bash
33 lines
830 B
Bash
#! /bin/sh
|
|
# Implement blacklisting for udev-loaded modules
|
|
# Includes module checking
|
|
# - Aaron Griffin & Tobias Powalowski for Archlinux
|
|
[ $# -ne 1 ] && exit 1
|
|
|
|
if [ -f /proc/cmdline ]; then
|
|
for cmd in $(cat /proc/cmdline); do
|
|
case $cmd in
|
|
*=*) eval $cmd ;;
|
|
esac
|
|
done
|
|
fi
|
|
|
|
# get the real names from modaliases
|
|
i="$(/bin/modprobe -i --show-depends $1 | minised "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" | minised 's|-|_|g')"
|
|
# add disablemodules= from commandline to blacklist
|
|
k="$(echo ${disablemodules} | minised 's|-|_|g' | minised 's|,| |g')"
|
|
|
|
if [ "${k}" != "" ] ; then
|
|
for o in ${k}; do
|
|
echo "${o}.ko" >> /disablemodules
|
|
done
|
|
for n in ${i}; do
|
|
if /bin/ugrep "^$n.ko" /disablemodules 2>&1 >/dev/null; then
|
|
exit 1
|
|
fi
|
|
done
|
|
fi
|
|
/bin/modprobe $1
|
|
|
|
# vim: set et ts=4:
|