]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-init.sh: Nuke unused install_kmod_with_fw function
authorTakashi Iwai <tiwai@suse.de>
Thu, 22 Aug 2019 10:50:23 +0000 (12:50 +0200)
committerDaniel Molkentin <daniel@molkentin.de>
Mon, 26 Aug 2019 12:57:37 +0000 (14:57 +0200)
Kill the no longer used function, so that anyone won't be confused and
try to modify this function in future.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1146769
Signed-off-by: Takashi Iwai <tiwai@suse.de>
dracut-init.sh

index 58d87831984f8cdee2a86a8764b0ee044ec088d6..0fc463c5be73ca623cf6d718d7272876405891ef 100644 (file)
@@ -900,73 +900,6 @@ for_each_module_dir() {
     done
 }
 
-# Install a single kernel module along with any firmware it may require.
-# $1 = full path to kernel module to install
-install_kmod_with_fw() {
-    # no need to go further if the module is already installed
-
-    [[ -e "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ]] \
-        && return 0
-
-    if [[ $omit_drivers ]]; then
-        local _kmod=${1##*/}
-        _kmod=${_kmod%.ko*}
-        _kmod=${_kmod/-/_}
-        if [[ "$_kmod" =~ $omit_drivers ]]; then
-            dinfo "Omitting driver $_kmod"
-            return 0
-        fi
-        if [[ "${1##*/lib/modules/$kernel/}" =~ $omit_drivers ]]; then
-            dinfo "Omitting driver $_kmod"
-            return 0
-        fi
-    fi
-
-    if [[ $silent_omit_drivers ]]; then
-        local _kmod=${1##*/}
-        _kmod=${_kmod%.ko*}
-        _kmod=${_kmod/-/_}
-        [[ "$_kmod" =~ $silent_omit_drivers ]] && return 0
-        [[ "${1##*/lib/modules/$kernel/}" =~ $silent_omit_drivers ]] && return 0
-    fi
-
-    inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}"
-    ret=$?
-    (($ret != 0)) && return $ret
-    local _cmd=$(get_decompress_cmd "$1")
-    [[ -n "${_cmd}" ]] && \
-        ${_cmd} "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}"
-
-    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
-            [[ -d $_fwdir ]] || continue
-            if [[ -f $_fwdir/$_fw ]]; then
-                inst_simple "$_fwdir/$_fw" "/lib/firmware/$_fw"
-            elif [[ -f $_fwdir/$_fw.xz ]]; then
-                inst_simple "$_fwdir/$_fw.xz" "/lib/firmware/$_fw.xz"
-                rm -f "${initdir}/lib/firmware/$_fw"
-                unxz -f "${initdir}/lib/firmware/$_fw.xz"
-            else
-               continue
-            fi
-            _found=yes
-        done
-        if [[ $_found != yes ]]; then
-            if ! [[ -d $(echo /sys/module/${_modname//-/_}|{ read a b; echo $a; }) ]]; then
-                dinfo "Possible missing firmware \"${_fw}\" for kernel module" \
-                    "\"${_modname}.ko\""
-            else
-                dwarn "Possible missing firmware \"${_fw}\" for kernel module" \
-                    "\"${_modname}.ko\""
-            fi
-        fi
-    done
-    return 0
-}
-
 # Do something with all the dependencies of a kernel module.
 # Note that kernel modules depend on themselves using the technique we use
 # $1 = function to call for each dependency we find