LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-20-2014, 06:35 AM   #1
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Rep: Reputation: Disabled
Question Loading firmware into kernel at boot


I have found a potential problem with the Slackware distro regarding the kernel drivers requiering firmware files.

Hotplug (/sbin/hotplug) was replaced a long time ago by udev. The problem with udev is that it loads as a userspace daemon too late in the boot process.

Current implementation in the kernel requires a /sbin/hotplug script to load firmware for drivers that require this. If the driver is builtin (not module), this fails.

Read here: /usr/src/linux/Documentation/firmware_class

A sample script is provided, which doesn't seem to work.
copy as /sbin/hotplug, edit the script:
Code:
HOTPLUG_FW_DIR=/lib/firmware/
as this is where the firmware is stored in today's kernels.

Tested on slackware 13.37, 14.0, 14.1

I was able to partially work around the problem by recompiling the kernel and making the FiberChannel adapter (for which I need firmware) as a module. Then udev does the correct work and loads the firmware, the driver loads properly and the device works.

But then I have the problem of udev and lvm starting before the adapter driver loads, and then it is too late for the multipath-tools to remap the devices. I get into a chicken and egg problem which I haven't been able to solve, to this day.

In short: how does one load driver firmware (from /lib/firmware) for builtin drivers at boot, before udev exists?
 
Old 02-20-2014, 07:18 AM   #2
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,172

Rep: Reputation: 227Reputation: 227Reputation: 227
Do you mean the udev in your initrd is not doing the right thing? Or did you disable udev in initrd?
 
Old 02-20-2014, 07:26 AM   #3
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by andrixnet View Post
In short: how does one load driver firmware (from /lib/firmware) for builtin drivers at boot, before udev exists?
You build the firmware into the kernel.

When you are configuring your custom kernel, look under 'Device Drivers'. Go to 'Generic Driver Options', and under 'Generic Driver Options' there is 'Userspace firmware loading support'. (That name isn't very appropriate in this case, but never mind!)

Under 'Generic Driver Options' there is 'Include in-kernel firmware blobs in kernel binary'. You need to set this to Y.

Also under 'Generic Driver Options' you will need 'External firmware blobs to build into the kernel binary'. Here is the help text for this option:

Quote:
This option allows firmware to be built into the kernel for the case
where the user either cannot or doesn't want to provide it from
userspace at runtime (for example, when the firmware in question is
required for accessing the boot device, and the user doesn't want to
use an initrd).

This option is a string and takes the (space-separated) names of the
firmware files -- the same names that appear in MODULE_FIRMWARE()
and request_firmware() in the source. These files should exist under
the directory specified by the EXTRA_FIRMWARE_DIR option, which is
by default the firmware subdirectory of the kernel source tree.

For example, you might set CONFIG_EXTRA_FIRMWARE="usb8388.bin", copy
the usb8388.bin file into the firmware directory, and build the kernel.
Then any request_firmware("usb8388.bin") will be satisfied internally
without needing to call out to userspace.
That's a pretty good description of what you have to do

(The help text also has a warning about redistributing non-GPL firmware, which is the fundamental reason why this is so difficult - you are welcome to blame the hardware companies' lawyers who prefer torturing their customers rather than giving up their illusion of control.)
 
Old 02-20-2014, 08:07 AM   #4
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Original Poster
Rep: Reputation: Disabled
Exclamation

Quote:
Originally Posted by guanx View Post
Do you mean the udev in your initrd is not doing the right thing? Or did you disable udev in initrd?
My question is about a system that is already installed and running, to which I added a QLogic FC card.
The boot process is the standard Slackware boot as generated by the installer. It does not use an initrd. (nor do I whish to implement one)
 
Old 02-20-2014, 09:29 AM   #5
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104
If you want to load firmware into the kernel at an early stage, you have to create an initrd and add your firmware to it.

Eric
 
  


Reply

Tags
firmware, hotplug, kernel, udev


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel loading firmware with hotplug or udev? andrixnet Linux - Kernel 0 10-31-2012 10:45 AM
Kernel 3.1.0-1 and Radeon firmware not found error on boot?? stratotak Debian 3 12-30-2011 09:14 PM
Kernel not loading firmware. dE_logics Linux - Hardware 3 12-24-2010 09:00 PM
firmware loading fails at boot time ParticleHunter Linux From Scratch 26 09-27-2005 12:47 PM
Loading firmware on boot ? lamiroy Linux - Software 1 03-24-2005 11:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration