summaryrefslogtreecommitdiff
path: root/sys-fs
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
commit6e1744c91ad4e2346dfda9612a51e2874e68eb14 (patch)
tree2cc95a2f27979db4bcb5f7761114bd267ee152b8 /sys-fs
parentRe-add ~alpha and x86 stable (diff)
downloadgentoo-2-6e1744c91ad4e2346dfda9612a51e2874e68eb14.tar.gz
gentoo-2-6e1744c91ad4e2346dfda9612a51e2874e68eb14.tar.bz2
gentoo-2-6e1744c91ad4e2346dfda9612a51e2874e68eb14.zip
Convert module name to a regular expression, to match autoload/blacklist entries regardless of being written with - or _.
(Portage version: 2.1.3_rc8)
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/udev/ChangeLog7
-rwxr-xr-xsys-fs/udev/files/modprobe-113-r2.sh8
2 files changed, 12 insertions, 3 deletions
diff --git a/sys-fs/udev/ChangeLog b/sys-fs/udev/ChangeLog
index 13390437d225..9e765f0f6003 100644
--- a/sys-fs/udev/ChangeLog
+++ b/sys-fs/udev/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-fs/udev
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.315 2007/07/12 14:24:15 zzam Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.316 2007/07/12 15:07:40 zzam Exp $
+
+ 12 Jul 2007; Matthias Schwarzott <zzam@gentoo.org>
+ files/modprobe-113-r2.sh:
+ Convert module name to a regular expression, to match autoload/blacklist
+ entries regardless of being written with - or _.
*udev-113-r2 (12 Jul 2007)
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