Blame 0030-install_kmod_with_fw-make-fast-case-faster.patch

Harald Hoyer 55891e
From e6024e0030bcf35b0f0c97cdc6f259711536459b Mon Sep 17 00:00:00 2001
Harald Hoyer 55891e
From: John Reiser <jreiser@BitWagon.com>
Harald Hoyer 55891e
Date: Sun, 28 Aug 2011 13:24:58 -0700
Harald Hoyer 55891e
Subject: [PATCH] install_kmod_with_fw: make fast case faster
Harald Hoyer 55891e
Harald Hoyer 55891e
---
Harald Hoyer 55891e
 dracut-functions |    5 +++--
Harald Hoyer 55891e
 1 files changed, 3 insertions(+), 2 deletions(-)
Harald Hoyer 55891e
Harald Hoyer 55891e
diff --git a/dracut-functions b/dracut-functions
Harald Hoyer 55891e
index a72aa53..4d3317c 100755
Harald Hoyer 55891e
--- a/dracut-functions
Harald Hoyer 55891e
+++ b/dracut-functions
Harald Hoyer 55891e
@@ -782,13 +782,14 @@ check_module_dir() {
Harald Hoyer 55891e
 # Install a single kernel module along with any firmware it may require.
Harald Hoyer 55891e
 # $1 = full path to kernel module to install
Harald Hoyer 55891e
 install_kmod_with_fw() {
Harald Hoyer 55891e
-    local _modname=${1##*/} _fwdir _found _fw
Harald Hoyer 55891e
-    _modname=${_modname%.ko*}
Harald Hoyer 55891e
     # no need to go further if the module is already installed
Harald Hoyer 55891e
     [[ -e "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ]] \
Harald Hoyer 55891e
         && return 0
Harald Hoyer 55891e
     inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" \
Harald Hoyer 55891e
         || return $?
Harald Hoyer 55891e
+
Harald Hoyer 55891e
+    local _modname=${1##*/} _fwdir _found _fw
Harald Hoyer 55891e
+    _modname=${_modname%.ko*}
Harald Hoyer 55891e
     for _fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do
Harald Hoyer 55891e
         _found=''
Harald Hoyer 55891e
         for _fwdir in $fw_dir; do