FS#14783 - [mkinitcpio] net hook of initcpio does not include firmware files
Attached to Project:
Arch Linux
Opened by Matthias Dienstbier (fs4000) - Thursday, 21 May 2009, 13:30 GMT
Last edited by Tobias Powalowski (tpowa) - Sunday, 31 May 2009, 13:25 GMT
Opened by Matthias Dienstbier (fs4000) - Thursday, 21 May 2009, 13:30 GMT
Last edited by Tobias Powalowski (tpowa) - Sunday, 31 May 2009, 13:25 GMT
|
Details
Description:
I installed a network bootable Arch Linux with this howto: http://wiki.archlinux.org/index.php/Diskless_network_boot_NFS_root But on a machine that needs the e100 module the system will not boot because a necessary firmware file is missing. I think the hook should read "modinfo $MODULE" and include the listed firmware files: $ modinfo e100 | grep firmware firmware: e100/d102e_ucode.bin firmware: e100/d101s_ucode.bin firmware: e100/d101m_ucode.bin |
This task depends upon
for i in `modinfo $MODULES | grep firmware: | gawk '{ print $2 }'`; do
[ -f "/lib/firmware/$i" ] && add_file "/lib/firmware/$i"
done
I also don't know if modules with missing firmware should be removed from $MODULES again.
I hope to be able to work on mkinitcpio soon, there is so much to do here.
diff --git a/functions b/functions
index 38bf6bf..502d1d9 100644
--- a/functions
+++ b/functions
@@ -145,12 +145,17 @@ HAS_MODULES="n"
#modules are handled specially in order to enable autodetection
add_module ()
{
- local fil path mod deps
+ local fil path fw mod deps
#cleanup - remove .ko, replace - and _ with [-_] to match either
fil=$(basename "${1}" | sed -e "s|[-_]|\[-_\]|g" -e "s|\.ko$||g")
found=0
for path in $(find "${MODULEDIR}" -type f -name "${fil}.ko"); do
+ #get needed firmware files
+ for fw in $(/sbin/modinfo -F firmware "${path}"); do
+ [ -f "/lib/firmware/$fw" ] && add_file "/lib/firmware/$fw"
+ done
+ #get module depends
for mod in $(/sbin/modinfo -F depends "${path}" | tr ',' ' '); do
if [ -n "${mod}" ]; then
add_module "${mod}"
ipw2200 and ipw2100 don't list firmware at all in module.
Don't know if more are affected.
Other point:
Are those listed firmware files the correct ones?
iwl packages provide more then one firmware file but only 1 is listed in modinfo.
Well, for the e100 module your patch is working perfectly.
I'm not sure if anyone wants WLAN in initcpio. ;)
About modules without firmware entries: There is simply nothing we can do - we act on the information we have. If there should be a firmware listed for a module but isn't, it's a kernel bug and should be reported as such.