summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2011-01-25 20:59:47 +0100
committerThomas Bächler <thomas@archlinux.org>2011-01-25 21:02:38 +0100
commit692a44574241c32e213f48884a653a9535021091 (patch)
tree90ee91c7b6f1347c1863c5cff2aea1bcc4796224 /functions
parent1c9a57232165a2b48678848e739a14d0bd2687b3 (diff)
downloadmkinitcpio-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.
Diffstat (limited to 'functions')
-rw-r--r--functions10
1 files changed, 6 insertions, 4 deletions
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"