diff options
author | Thomas Bächler <thomas@archlinux.org> | 2011-01-25 20:59:47 +0100 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2011-01-25 21:02:38 +0100 |
commit | 692a44574241c32e213f48884a653a9535021091 (patch) | |
tree | 90ee91c7b6f1347c1863c5cff2aea1bcc4796224 | |
parent | 1c9a57232165a2b48678848e739a14d0bd2687b3 (diff) | |
download | mkinitcpio-692a44574241c32e213f48884a653a9535021091.tar.gz mkinitcpio-692a44574241c32e213f48884a653a9535021091.tar.xz |
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.
-rw-r--r-- | functions | 10 | ||||
-rw-r--r-- | install/autodetect | 5 |
2 files changed, 9 insertions, 6 deletions
@@ -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" diff --git a/install/autodetect b/install/autodetect index 82dca3c..5c86eb0 100644 --- a/install/autodetect +++ b/install/autodetect @@ -28,7 +28,7 @@ install () for fs in ${fss}; do allfs="${fs} $(modprobe --set-version ${KERNELVERSION} --resolve-alias ${fs})" for mod in ${allfs}; do - for modfile in $(find "${MODULEDIR}" -type f -name "${mod}.ko"); do + for modfile in $(find "${MODULEDIR}" -type f -name "${mod}.ko" -or -name "${mod}.ko.gz"); do if [ -n "${modfile}" ]; then AUTODETECT="${AUTODETECT} ${modfile}" fi @@ -54,7 +54,8 @@ install () fi for m in ${AUTODETECT}; do - modname="$(basename ${m%.ko})" + modname="${m%.gz}" + modname="$(basename ${modname%.ko})" echo "${modname}" >> "${MODULE_FILE}" done |