# PROBLEM loading firmware without udev (busybox only)

## Januszzz

Hi,

I need to load iwl3945 in tiny environment, busybox only. I did not exactly understand the moment when firmware needed for the module is being loaded, so I've narrowed the search and got to the point where module is loaded, but interface is down. When I'm turning it on using:

```
ifconfig wlan0 up
```

I get in log:

```
iwl3945 0000:0c:00.0: iwlwifi-3945-2.ucode firmware file req failed: -2
```

and later all the consequences of the absence, including fallback to previous version of ucode etc etc etc.

Of course, when I start udev, the above command sucessfully loads the firmware.

So the question is: howto load the firmware without udev?

Thanks!

EDIT:

I've found this about mdev: "Some kernel device drivers need to request firmware at runtime in order to

properly initialize a device.  Place all such firmware files into the

/lib/firmware/ directory.  At runtime, the kernel will invoke mdev with the

filename of the firmware which mdev will load out of /lib/firmware/ and into

the kernel via the sysfs interface.  The exact filename is hardcoded in the

kernel, so look there if you need to know how to name the file in userspace.

"

Well. it seems that it doesn't work?

----------

## ppurka

iwlwifi-3945-2.ucode is to be used only with kernel 2.6.29 or newer. If you are using an older kernel then you need to get an older version of the firmware. So, if this is what is misconfigured, then your problem will probably be solved. Otherwise, I have no idea what the problem could be.

----------

## Januszzz

Thanks, I've solved this issue. I got hint there:

http://lwn.net/Articles/242046/

and the part was interesting:

 *Quote:*   

> If the hotplug variable FIRMWARE is set, the kernel is requesting firmware
> 
> for a device (identified by $DEVPATH).  To provide the firmware to the kernel,
> 
> do the following:
> ...

 

it looks like udev / mdev sets default path for firmware or sets the loading enabled / disabled. Still I don't know, because this documentation (as well as in current Documentation directory) seems just outdated and I do not have these files  :Smile: 

So because I didn't have proper hint how to do this on my system (maybe strace would help) I simply compiled the binary blob into the kernel. Now it works without udev.

Yet the question remains, what is udev doing to achieve firmware loading, how to configure its behavior and where?

----------

## Gentree

That code snip is just an example of how to use the mechanism but this should not be needed if the firmware is the directory configured into the kernel and has the name indicated to the kernel by the driver that requests it. 

I modprobe rt73usb for my Dlink wifi dongle and on plugin it finds and loads the firmware rt73.bin.

This is just as well since mdev does not seem to be getting called despite it's being set as hotplug :

```
 cat /proc/sys/kernel/hotplug

/sbin/mdev
```

```
# ls -ail `cat /proc/sys/kernel/hotplug`

 244567 lrwxrwxrwx    1 root     root            14 May 27 18:38 /sbin/mdev -> ../bin/busybox

# ls -ail /sbin/../bin/busybox

 244487 -rwxr-xr-x    1 root     root        572264 May 27 18:38 /sbin/../bin/busybox

```

```
 mdev

BusyBox v1.17.0.git (2010-05-27 20:35:42 CEST) multi-call binary.

Usage: mdev [-s]

        -s      Scan /sys and populate /dev during system boot

It can be run by kernel as a hotplug helper. To activate it:

 echo /sbin/mdev > /proc/sys/kernel/hotplug

It uses /etc/mdev.conf with lines

[-]DEVNAME UID:GID PERM [>|=PATH] [@|$|*PROG]

```

```

 cat  /etc/mdev.conf

export MDC=1

.* 0:0 644 $ /etc/mdev.actions

```

Now none of that is happening , can anyone see why not?

 :Confused: 

----------

