diff options
author | Thomas Bächler <thomas@archlinux.org> | 2010-01-14 13:04:14 +0100 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2010-01-14 13:04:14 +0100 |
commit | 6cd3bb0e81a8bb13feffafb8f1ed30138f404b93 (patch) | |
tree | 317aeea45e91e65a13e1072048da8000bc13dff7 /load-modules.sh | |
parent | 0934e10814aa8ea20161d2a7a1fa15bf4df6bdfa (diff) | |
download | mkinitcpio-6cd3bb0e81a8bb13feffafb8f1ed30138f404b93.tar.gz mkinitcpio-6cd3bb0e81a8bb13feffafb8f1ed30138f404b93.tar.xz |
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
Diffstat (limited to 'load-modules.sh')
-rwxr-xr-x | load-modules.sh | 13 |
1 files changed, 9 insertions, 4 deletions
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 |