diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-01-21 07:49:06 +0100 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-01-21 07:53:23 +0100 |
commit | 1166e9d50f099f55ddff67104f3e892c949fc654 (patch) | |
tree | 3889f74d7ec8acded50073d5ff62104ad7348f58 | |
parent | dc191dfcba2522a2d6959b8074d4849b7fb76da3 (diff) | |
download | mkinitcpio-1166e9d50f099f55ddff67104f3e892c949fc654.tar.gz mkinitcpio-1166e9d50f099f55ddff67104f3e892c949fc654.tar.xz |
Use udev's resolve-modalias in place of modprobe
This fixes issues with module resolving AND makes us
run a bit faster
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rw-r--r-- | functions | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2,8 +2,11 @@ auto_modules () { aliases=$(find /sys/devices/ -name modalias -exec cat {} \;) - mods=$(/sbin/modprobe --set-version ${KERNELVERSION} --show-depends -a \ - ${aliases} 2>/dev/null | sed 's|insmod \(.*\)|\1|' | grep $@ | sort -u) + mods="" + for a in $aliases; do + m="$(resolve-modalias "/lib/modules/${KERNELVERSION}/modules.alias" "$a")" + [ -n "$m" ] && mods="$mods $m" + done echo "${mods}" [ -z "${mods}" ] && return 1 |