summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Schwarzott <zzam@gentoo.org>2007-07-12 15:07:40 +0000
committerMatthias Schwarzott <zzam@gentoo.org>2007-07-12 15:07:40 +0000
commitf1f31395a92471e959721ac72d303ab8688cc8f8 (patch)
treeb2d3860ec0dabbd6116e2bd6796487ff400cc17c /sys-fs/udev/files/modprobe-113-r2.sh
parentRe-add ~alpha and x86 stable (diff)
downloadhistorical-f1f31395a92471e959721ac72d303ab8688cc8f8.tar.gz
historical-f1f31395a92471e959721ac72d303ab8688cc8f8.tar.bz2
historical-f1f31395a92471e959721ac72d303ab8688cc8f8.zip
Convert module name to a regular expression, to match autoload/blacklist entries regardless of being written with - or _.
Package-Manager: portage-2.1.3_rc8
Diffstat (limited to 'sys-fs/udev/files/modprobe-113-r2.sh')
-rwxr-xr-xsys-fs/udev/files/modprobe-113-r2.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys-fs/udev/files/modprobe-113-r2.sh b/sys-fs/udev/files/modprobe-113-r2.sh
index 23e198d1f66d..86bcec2629fb 100755
--- a/sys-fs/udev/files/modprobe-113-r2.sh
+++ b/sys-fs/udev/files/modprobe-113-r2.sh
@@ -44,6 +44,7 @@ unlock_modprobe() {
rmdir "$MODPROBE_LOCK" || true
}
+# Get normalized names only with _
MODLIST=$("${MODPROBE}" -q -i --show-depends "${@}" 2>/dev/null \
| sed -e "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" -e 's|-|_|g')
@@ -53,16 +54,19 @@ for m in ${MODLIST}; do
MODNAME=$m
done
+# build regex to match module name written with either - or _
+MOD_REGEX="$(echo "${MODNAME}"|sed -e 's#_#[-_]#g')"
+
# check for blacklisting
if [ -f /etc/modprobe.conf ]; then
- if grep -q '^blacklist.*[[:space:]]'"${MODNAME}"'\([[:space:]]\|$\)' /etc/modprobe.conf; then
+ if grep -q '^blacklist.*[[:space:]]'"${MOD_REGEX}"'\([[:space:]]\|$\)' /etc/modprobe.conf; then
# module blacklisted
exit 0
fi
fi
if [ "$implicitly_blacklist_modules_autoload" = "yes" -a -f "${MODULES_AUTOLOAD_FILE}" ]; then
- if grep -q "^${MODNAME}"'\([[:space:]]\|$\)' "${MODULES_AUTOLOAD_FILE}"; then
+ if grep -q "^${MOD_REGEX}"'\([[:space:]]\|$\)' "${MODULES_AUTOLOAD_FILE}"; then
# module implictly blacklisted
# as present in modules.autoload, Bug 184833
exit 0