Question on busybox and loading firmware?

Michael D. Setzer II mikes at kuentos.guam.net
Tue Sep 23 06:05:49 UTC 2014


On 22 Sep 2014 at 12:32, Michael Conrad wrote:

Date sent:      	Mon, 22 Sep 2014 12:32:34 -0400
From:           	Michael Conrad <mconrad at intellitree.com>
To:             	busybox at busybox.net, mikes at kuentos.guam.net
Subject:        	Re: Question on busybox and loading firmware?

> On 9/22/2014 10:27 AM, Michael D. Setzer II wrote:
> > On 22 Sep 2014 at 10:32, Gustavo Zacarias wrote:
> >> On 09/22/2014 09:56 AM, Michael D. Setzer II wrote:
> >>> Was already able to find the firmware since it was included with the installation
> >>> of the fedora 20 on the notebook. Issue is that I placed the firmware files into the
> >>>   /lib/firmware directory, but on booting from my project kernel it seems to try and
> >>> load firmware during the kernel loading before the ramdisk.lzma is loaded. The
> >>> kernel is built with the option to not include firmware, since I don't know what if
> >>> any firmware will be needed by end users.  This seems to have worked with
> >>> bnx2  and bnx2x firmware that another end user needed.
> >>>
> >>> But the booting showed the messages before the ramdisk.lzma is
> >>> recognized, and then shows messages with =-12, and =-2. Didn't save the
> >>> output since this was a ram only load. Was thinking that mdev -s might cause
> >>> it to load firmware. Kernel contains most disk and ethernet devices included.
> >> Hi.
> >> Make the driver a module instead of built into the kernel.
> >> The driver might initialize before the kernel/userland has
> >> access/mounted a root filesystem and that's what happens.
> > Thanks for the reply. Problem is that iso has the option of select 7 different
> > kernels, so if I changed it to using moduals I would have to include them for
> > multiple kernels and also come up with a script to load the moduals. Right
> > now everything works by having the kernels handle the hardware.
> 
> I think the "right way" to handle that is to have each kernel look for a 
> different /lib/modules/* directory.  You shouldn't need a special script 
> to load modules because the kernel should report them to mdev and it 
> should "just work".  But I understand wanting to have a static kernel 
> for simplicity.
> 
> Anyway, when the kernel tries to load firmware, you should get a 
> 60-second timeout before it gives up.  If you have more than 60 seconds 
> between when the module gets initialized and when your filesystem gets 
> mounted, then that could be the problem.  There are past messages on 
> this list that show how to get better logging of what the kernel is 
> asking from mdev, which might help you find the problem.
> 
> What I have done for my static kernels is to include the firmware into 
> the compiled kernel.  This is best when you know that the kernel will 
> always need the firmware.  (but if you are doing this for lots optional 
> hardware, you can end up with a very large kernel, which is worse than 
> needing to load firmware from the filesystem) Don't remember offhand, 
> but there is a kernel config where you tell it the directory of the 
> firmware, and tell it what filenames to include, and then those files 
> get sucked in when you compile the kernel and are automatically 
> available at boot.
> 

My project generally has been getting 4,000 to 5,000 downloads per month 
over this year, so there is no way to know what hardware any particular user 
will have. The only previous request for firmware was for an user that had 
some big HP system that used bnx2x device that required firmware, and that 
was just a matter of adding it to the directory. So in that case it work first 
time. Then I decided to just add all the firmware that was from the linux-git 
site hoping that would support anyone needing firmware. But with the 
ipw2200 it doesn't work the same. First it wasn't included in the linux-git 
firmware, and I am assuming that it is because of intel licensing issues. But 
in my attempt to test it, but not distribute it, I found it didn't work as I 
expected.

Firmware lines from dmesg

device class 'firmware': registering
pci 0000:02:08.0: Firmware left e100 interrupts enabled; disabling
ipw2200 0000:02:02.0: Direct firmware load failed with error -2
firmware ipw2200-bss.fw: firmware: requesting ipw2200-bss.fw
ipw2200: ipw2200-bss.fw request_firmware failed: Reason -12
ipw2200: Unable to load firmware: -12
usbserial: USB Serial support registered for Keyspan - (without firmware)
psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 3/3

It sees the ethernet card, and it sees the wireless card, but this all happens 
before the ramdisk is loaded on this notebook, which takes about 1:46 to get 
to the loading of the file system, so not sure where the 60 seconds timeout 
starts, or if that is what is making it take so long?? On desktop system, the  
kernel loads in about 15 seconds. 

Another message talked about a hot plugin script, but there are two variables 
that it says are defined in the envirnonment, and I can not find them?

#!/bin/sh

# Simple hotplug script sample:
# 
# Both $DEVPATH and $FIRMWARE are already provided in the 
environment.

HOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/

if [ "$SUBSYSTEM" == "firmware" -a "$ACTION" == "add" ]; then
  if [ -f $HOTPLUG_FW_DIR/$FIRMWARE ]; then
    echo 1 > /sys/$DEVPATH/loading
    cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVPATH/data
    echo 0 > /sys/$DEVPATH/loading
  else
    echo -1 > /sys/$DEVPATH/loading
  fi
fi


Also, not sure if it would apply, since I thought hotplug was for devices that 
are later plugged into the system instead of devices that are actually built into 
the sytem.

Did a search in the /sys directory to look for any file called loading, but none 
exist on notebook or desktop systems I've seen.

Thanks again.

Generally, I would recommend doing disk imaging thru wired network that 
works fine or use usb flash or hard disk. Been doing project since 2004, and 
this is first request for wireless support.



> Hope that helps,
> -Mike


+----------------------------------------------------------+
  Michael D. Setzer II -  Computer Science Instructor      
  Guam Community College  Computer Center                  
  mailto:mikes at kuentos.guam.net                            
  mailto:msetzerii at gmail.com
  http://www.guam.net/home/mikes
  Guam - Where America's Day Begins                        
  G4L Disk Imaging Project maintainer 
  http://sourceforge.net/projects/g4l/
+----------------------------------------------------------+

http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned:  19,471
Processing time:  32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)

BOINC at HOME CREDITS
ROSETTA     19944591.813416   |   SETI        33853965.952339
ABC         16613838.513356   |   EINSTEIN    33714735.574900



More information about the busybox mailing list