From 6cd3bb0e81a8bb13feffafb8f1ed30138f404b93 Mon Sep 17 00:00:00 2001 From: Thomas Bächler Date: Thu, 14 Jan 2010 13:04:14 +0100 Subject: Remove more klibc'isms from blacklisting code in load-modules.sh: - As in http://mailman.archlinux.org/pipermail/arch-commits/2010-January/072491.html, replace resolve-modalias with modprobe --resolve-alias - Remove usage of custom moddeps binary, replace it with the same 'sed' line as in /lib/udev/load-modules.sh --- load-modules.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'load-modules.sh') diff --git a/load-modules.sh b/load-modules.sh index f703088..68aa3f5 100755 --- a/load-modules.sh +++ b/load-modules.sh @@ -1,14 +1,13 @@ #! /bin/sh # Implement blacklisting for udev-loaded modules # Includes module checking -# - Aaron Griffin & Tobias Powalowski for Archlinux +# - Aaron Griffin, Tobias Powalowski & Thomas Bächler for Arch Linux [ $# -ne 1 ] && exit 1 MODPROBE="/sbin/modprobe" -RESOLVEALIAS="/bin/resolve-modalias" +RESOLVEALIAS="${MODPROBE} --resolve-alias" USEBLACKLIST="--use-blacklist" SED="/bin/sed" -MODDEPS="/bin/moddeps" if [ -f /proc/cmdline ]; then for cmd in $(cat /proc/cmdline); do @@ -34,8 +33,14 @@ if [ -n "${BLACKLIST}" ] ; then [ -z "${mods}" ] && $MODPROBE -qni $1 && mods="$1" && USEBLACKLIST="" [ -z "${mods}" ] && exit for mod in ${mods}; do - deps="$(${MODDEPS} ${mod})" + # Find the module and all its dependencies + deps="$($MODPROBE -i --show-depends ${mod})" [ $? -ne 0 ] && continue + + #sanitize the module names + deps="$(echo "$deps" | ${SED} \ + -e "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" \ + -e 's|-|_|g')" # If the module or any of its dependencies is blacklisted, don't load it for dep in $deps; do for blackmod in ${BLACKLIST}; do -- cgit v1.2.3-24-g4f1b