Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PROBLEM loading firmware without udev (busybox only)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Januszzz
Guru
Guru


Joined: 04 Feb 2006
Posts: 367
Location: Opole, Poland

PostPosted: Sat Oct 31, 2009 1:48 am    Post subject: PROBLEM loading firmware without udev (busybox only) Reply with quote

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:

Code:
ifconfig wlan0 up


I get in log:

Code:
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?
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Sat Oct 31, 2009 5:30 am    Post subject: Reply with quote

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.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
Januszzz
Guru
Guru


Joined: 04 Feb 2006
Posts: 367
Location: Opole, Poland

PostPosted: Sat Oct 31, 2009 2:37 pm    Post subject: Reply with quote

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:

echo 1 > /sys/$DEVPATH/loading
cat /path/to/$FIRMWARE > /sys/$DEVPATH/data
echo 0 > /sys/$DEVPATH/loading


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 :-)

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?
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Sun May 30, 2010 7:08 pm    Post subject: Reply with quote

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 :

Code:
 cat /proc/sys/kernel/hotplug
/sbin/mdev


Code:
# 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


Code:
 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]

Code:

 cat  /etc/mdev.conf
export MDC=1
.* 0:0 644 $ /etc/mdev.actions



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

:?
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum