From: John Reiser Date: Sun, 28 Aug 2011 20:24:58 +0000 (-0700) Subject: install_kmod_with_fw: make fast case faster X-Git-Tag: 014~110 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e6024e0030bcf35b0f0c97cdc6f259711536459b;p=thirdparty%2Fdracut.git install_kmod_with_fw: make fast case faster --- diff --git a/dracut-functions b/dracut-functions index a72aa538d..4d3317c9f 100755 --- a/dracut-functions +++ b/dracut-functions @@ -782,13 +782,14 @@ check_module_dir() { # Install a single kernel module along with any firmware it may require. # $1 = full path to kernel module to install install_kmod_with_fw() { - local _modname=${1##*/} _fwdir _found _fw - _modname=${_modname%.ko*} # no need to go further if the module is already installed [[ -e "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ]] \ && return 0 inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" \ || return $? + + local _modname=${1##*/} _fwdir _found _fw + _modname=${_modname%.ko*} for _fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do _found='' for _fwdir in $fw_dir; do