From 692a44574241c32e213f48884a653a9535021091 Mon Sep 17 00:00:00 2001 From: Thomas Bächler Date: Tue, 25 Jan 2011 20:59:47 +0100 Subject: Support .ko.gz kernel modules, in addition to .ko We used to expect only .ko as a kernel module name. Also accept .ko.gz, so we can reduce the installed size of the kernel26 package. --- functions | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'functions') diff --git a/functions b/functions index 4bdb27e..ef066ba 100644 --- a/functions +++ b/functions @@ -15,7 +15,7 @@ auto_modules () all_modules () { - mods=$(find ${MODULEDIR} -name '*.ko' 2>/dev/null | grep $@ | sort -u) + mods=$(find ${MODULEDIR} -name '*.ko' -or -name '*.ko.gz' 2>/dev/null | grep $@ | sort -u) echo "${mods}" [ -z "${mods}" ] && return 1 @@ -26,7 +26,8 @@ checked_modules () { if [ -e "${MODULE_FILE}" ]; then for mod in $(all_modules $@); do - modname="$(basename ${mod%.ko} | tr '-' '_')" + modname=${mod%.gz} + modname="$(basename ${modname%.ko} | tr '-' '_')" if grep "^${modname}$" "${MODULE_FILE}" >/dev/null 2>&1; then echo ${modname} fi @@ -147,12 +148,13 @@ add_module () { local m fil path fw mod deps #cleanup - remove .ko, replace - with _ - m=$(basename "${1%.ko}" | tr '-' '_') + m=${1%.gz} + m=$(basename "${m%.ko}" | tr '-' '_') #find pattern - replace _ with [-_] to match either fil=$(echo "$m" | sed 's|_|\[-_\]|g') found=0 - for path in $(find "${MODULEDIR}" -type f -name "${fil}.ko"); do + for path in $(find "${MODULEDIR}" -type f -name "${fil}.ko" -or -name "${fil}.ko.gz"); do #get needed firmware files for fw in $(/sbin/modinfo -F firmware "${path}"); do [ -f "/lib/firmware/$fw" ] && add_file "/lib/firmware/$fw" -- cgit v1.2.3-24-g4f1b