Bug 690236 - Dracut 008 does not integrate /lib/firmware/iwlwifi-5000-5.ucode (Linux 2.6.38)
Summary: Dracut 008 does not integrate /lib/firmware/iwlwifi-5000-5.ucode (Linux 2.6.38)
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-23 16:50 UTC by Sebastian Pipping
Modified: 2011-03-25 18:29 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-03-25 16:32:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sebastian Pipping 2011-03-23 16:50:10 UTC
Using your commands from bug #690204 ...


# uname -r
2.6.38-gentoo

# ls -al /lib/firmware/iwlwifi-*
-rw-r--r-- 1 root root 340696 Mar 19 22:44 /lib/firmware/iwlwifi-5000-5.ucode

# sudo ./dracut --add-drivers iwlagn -f -l ./test.img 
W: Could not find program "ip" required by network.
W: Could not find program "ip" required by network.

# /usr/sbin/lsinitrd test.img | grep iwlwifi

# sudo modinfo -k 2.6.38-gentoo -F firmware iwlagn
ERROR: modinfo: could not find module iwlagn

Comment 1 Sebastian Pipping 2011-03-23 16:54:43 UTC
Same with 

  # sudo dracut --add-drivers iwlagn -f -l ./test.img

Been using a git clone of 9d49507f800f1ae34781e44600e833333887c90b before by mistake.

Comment 2 Harald Hoyer 2011-03-23 17:27:21 UTC
ERROR: modinfo: could not find module iwlagn

? so which module needs your firmware

Comment 3 Sebastian Pipping 2011-03-24 22:48:58 UTC
(In reply to comment #2)
> ERROR: modinfo: could not find module iwlagn

I found the call to modinfo in the dracut source code.
I assumed its output could help you.  Nevermind, if it doesn't.


> ? so which module needs your firmware

I think it actually is iwlagn [1].  While Linux 2.6.37 looked for
iwlwifi-5000-2.ucode, 2.3.38 now looks for iwlwifi-5000-5.ucode:
            ^^^                                        ^^^
  #define IWL5000_UCODE_API_MAX 5
  (drivers/net/wireless/iwlwifi/iwl-5000.c)

I have the wifi driver compiled into the kernel (=Y, not =M).  Is that related?
Under what condition should Dracut pick up iwlwifi-5000-5.ucode?


[1] # sudo lspci | grep -i wifi
    03:00.0 Network controller: Intel Corporation Wireless WiFi Link 5300

    http://www.thinkwiki.org/wiki/Intel_Wifi_Link_5300_%28AGN%29
                                                          ^^^

Comment 4 Harald Hoyer 2011-03-25 11:02:18 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > ERROR: modinfo: could not find module iwlagn
> 
> I found the call to modinfo in the dracut source code.
> I assumed its output could help you.  Nevermind, if it doesn't.
> 
> 
> > ? so which module needs your firmware
> 
> I think it actually is iwlagn [1].  While Linux 2.6.37 looked for
> iwlwifi-5000-2.ucode, 2.3.38 now looks for iwlwifi-5000-5.ucode:
>             ^^^                                        ^^^
>   #define IWL5000_UCODE_API_MAX 5
>   (drivers/net/wireless/iwlwifi/iwl-5000.c)
> 
> I have the wifi driver compiled into the kernel (=Y, not =M).  Is that related?
> Under what condition should Dracut pick up iwlwifi-5000-5.ucode?
> 
> 
> [1] # sudo lspci | grep -i wifi
>     03:00.0 Network controller: Intel Corporation Wireless WiFi Link 5300
> 
>     http://www.thinkwiki.org/wiki/Intel_Wifi_Link_5300_%28AGN%29
>                                                           ^^^

Ah, it's compiled in.. ok.

Comment 5 Harald Hoyer 2011-03-25 16:32:09 UTC
Use: CONFIG_FIRMWARE_IN_KERNEL
  Enabling this option will build each required firmware blob into the kernel directly, where request_firmware() willthem without having to call out to userspace. This may useful if your root file system requires a device which uses such firmware, and do not wish to use an initrd.

Better: make it a module..

Comment 6 Sebastian Pipping 2011-03-25 16:38:26 UTC
Could Dracut at least warn about unset CONFIG_FIRMWARE_IN_KERNEL?

Comment 7 Kay Sievers 2011-03-25 16:43:30 UTC
> (In reply to comment #2)
> I have the wifi driver compiled into the kernel (=Y, not =M).  Is that related?
> Under what condition should Dracut pick up iwlwifi-5000-5.ucode?

It can't really. Drivers that need firmware from userspace should be modules not built-in. Or all needed firmware should also be build into the kernel too.

Dracut or any other tool can not safely predict what firmware files will be requested, and also the kernel driver-init happens so early, where userspace isn't really ready to fullfill these firmware requests. Such requests need to be re-played by special userspace magic which may happen anytime later, and the kernel might even cancel the requests due to a timeout in the meantime.

So either build the driver as a module, or also compile the firmware into the kernel. Your combination of options can not really work reliably.(In reply to comment #3)

Comment 8 Kay Sievers 2011-03-25 16:46:09 UTC
(In reply to comment #6)
> Could Dracut at least warn about unset CONFIG_FIRMWARE_IN_KERNEL?

NO, dracut has no business regarding warnings about such kernel config.

CONFIG_FIRMWARE_IN_KERNEL is for highly custom requirements, not for any common use case.

You need to make sure yourself, that your kernel works. And for that, better just use modules. :)

Comment 9 Sebastian Pipping 2011-03-25 18:29:04 UTC
(In reply to comment #5)
> Use: CONFIG_FIRMWARE_IN_KERNEL
>   Enabling this option will build each required firmware blob into the kernel
> directly, where request_firmware() willthem without having to call out to
> userspace. This may useful if your root file system requires a device which
> uses such firmware, and do not wish to use an initrd.
> 
> Better: make it a module..

I looked up the description of FIRMWARE_IN_KERNEL in "make menuconfig" now:

  "Include in-kernel firmware blobs in kernel binary"
           ^^^^^^^^^
File iwlwifi-5000-5.ucode however is not in-kernel: it's external, package "net-wireless/iwl5000-ucode" in Gentoo.  Also I found out, I had CONFIG_FIRMWARE_IN_KERNEL=y all the time - so that doesn't seem to pull iwlwifi-5000-5.ucode into the kernel.

On the good end with

  CONFIG_IWLAGN=m

now Dracut is actually including the file:

  # dracut --add-drivers iwlagn -f -l ./test.img 

  # /usr/sbin/lsinitrd test.img | grep iwlwifi
  [..]
  [..] lib64/firmware/iwlwifi-5000-5.ucode


Note You need to log in before you can comment on or make changes to this bug.