You know it already, since Debian 6.0 non-free firmware are no longer provided by a standard Debian installation. This will cause some troubles to users who need them. I’m thus going to do a small overview on the topic and teach you what you need to know to deal with the problem.
What are firmware and how are they used?
From the user’s point of view, a firmware is just some data that is needed by some piece of hardware in order to function properly. The driver for that hardware typically loads the firmware on the device as part of its initialization.
In the Linux kernel, the drivers are all using a standardized interface (request_firmware) to retrieve the firmware before sending it to the device. Thanks to this standardization, it’s possible to either embed the firmware in the kernel or to have it request the firmware from user-space when needed.
Debian (like most distributions) has selected the latter option. Thus when the kernel needs a firmware, it sends out a request to user-space. udev is getting the request with the name of the firmware, and in its default configuration (see /lib/udev/rules.d/80-drivers.rules
) it executes /lib/udev/firmware.agent
in response.
Where are firmware stored?
firmware.agent
is a simple shell script that tries to locate a firmware before sending it back to the kernel through a sysfs entry. It looks into the following directories:
- /lib/firmware/$(uname -r)
- /lib/firmware
- /usr/local/lib/firmware
- /usr/lib/hotplug/firmware
Firmware provided by packages are thus usually in /lib/firmware
and you can use /usr/local/lib/firmware
for manually installed firmware.
How do I know whether I need a firmware?
First of, you can notice messages from the kernel telling you that it tried to load a firmware but it failed. They look like this:
e100: eth0: e100_request_firmware: Failed to load firmware "e100/d101m_ucode.bin": -2
But you might be informed sooner. When you install a new version of the Linux kernel with the official Debian packages, the post-installation script will go through all loaded modules (those listed by lsmod) and it will verify whether this module as provided by the newly installed kernel might require firmware files. This information can be retrieved with modinfo:
$ modinfo -F firmware /lib/modules/2.6.32-5-amd64/kernel/drivers/net/e100.ko e100/d102e_ucode.bin e100/d101s_ucode.bin e100/d101m_ucode.bin
If one (or more) of those firmware is (are) not yet available on the system, you will get a warning message similar to this one:
update-initramfs will also generate a similar warning on the terminal:
update-initramfs: Generating /boot/initrd.img-2.6.32-5-amd64 W: Possible missing firmware /lib/firmware/e100/d102e_ucode.bin for module e100 W: Possible missing firmware /lib/firmware/e100/d101s_ucode.bin for module e100 W: Possible missing firmware /lib/firmware/e100/d101m_ucode.bin for module e100
The Debian installer also detects when you have hardware that might require a missing firmware file. You have the option to supply the missing files on a USB stick (either directly or through the corresponding package).
How do I find and install the missing firmware?
Now that you have the name of the firmware file that you want, it’s relatively easy to identify the package that provides the required file. You can use “apt-cache search <filename>” because the firmware packages embed the list of firmware files in their description. You can also use “apt-file” (provided by the package of the same name) or the web interface at packages.debian.org.
$ apt-cache search d101m_ucode.bin firmware-linux-nonfree - Binary firmware for various drivers in the Linux kernel $ apt-file search d101m_ucode.bin firmware-linux-nonfree: /lib/firmware/e100/d101m_ucode.bin
If the above commands return nothing, you probably need to enable the “non-free” repository in your /etc/apt/sources.list (you can also enable it within synaptic). And you also want to run “sudo apt-file update” to have the latest information.
Now you can install the right package, in the example above it was firmware-linux-nonfree.
How do I install all firmware just to be sure I don’t miss any?
There’s no meta-package depending on all firmware packages so there’s no easy answer to this question. Furthermore not all firmware packages respect the naming convention “firmware-*” (there’s for example zd1211-firmware).
So your best bet is to look up all the packages with a generic search like this one:
$ apt-file --package-only search /lib/firmware/ atmel-firmware [...]
And then install them all.
Are there DVD or CD images with non-free firmware?
Yes. Debian provides an unofficial netinst image for i386/amd64/powerpc with the non-free firmware, you can find it here: http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/.
I provide complete DVD sets with firmware, and Multi-Arch CD/DVD with firmware, it’s over there in my DVD shop: https://raphaelhertzog.com/go/debian-cd/ (i386/amd64 only)
When using those installation discs, the Debian-installer will be able to find the required firmware immediately. There’s no need for you to provide them on a USB stick.
Other questions?
I think I covered the most important things you have to know about firmware on Debian. But should you still have a question, feel free to share it in the comments so that I can improve this article.
Click here to subscribe to my free newsletter and get my monthly analysis on what’s going on in Debian and Ubuntu. Or just follow along via the RSS feed, Identi.ca, Twitter or Facebook.
someone says
What is firmware? Is it software programs? Is it configuration? Why is it non-free? Is there any free firmware at all?
Raphaël Hertzog says
It’s often software program but it could as well be configuration. We don’t always know.
There are free firmware in the sense that some have no restrictions associated to their distribution and modification but I’ve never seen the “sources” of any firmware. Those which are non-free have restrictions not compatible with the Debian Free Software Guidelines (no modification allowed mainly AFAIK).
Timo Juhani Lindfors says
$ apt-get source firmware-linux-free
$ sed -n 240,260p linux-2.6-2.6.32/firmware/keyspan_pda/keyspan_pda.S
movx @dptr, a
inc dptr
djnz r1, clear_rx_ring_loop
;;; turn on the RS-232 driver chip (bring the STANDBY pin low)
;; set OEB.1
mov a, #02H
mov dptr,OEB
movx @dptr,a
;; clear PB1
mov a, #00H
mov dptr,OUTB
movx @dptr,a
;; set OEC.[127]
mov a, #0x86
mov dptr,OEC
movx @dptr,a
;; set PORTCCFG.[01] to route TxD0,RxD0 to serial port
mov dptr, PORTCCFG
mov a, #0x03
movx @dptr, a
There, now you’ve seen source code of free firmware 😉
Jonathan Carter says
I think one thing worth noting is that not having non-free firmware included by default is a feature and not a bug, and that many systems will work just fine without it.
anon says
This seems like too much information for most users. Even technical users shouldn’t have to care.
Fundamentally, there should be only one question with two choices:
– Ignore missing non-free firmware files, even though this network card and this wireless card will probably not work without it (default)
– Make it work, with full knowledge that this stuff doesn’t conform to the DFSG.
Manually adding stuff to the sources.list, figuring out which firmware package is needed, regenerating the initramfs etc – these are all things that can and should happen without user intervention (well, only if the “use non-free” decision has been made) – it should just work.
Bob says
In order to clean my `vrms` output, I wrote a small script :
Maybe somebody will find it usefull !
NB: Edited by Raphaël Hertzog to fix the script and the HTML markup
Gary says
Expect plenty of bait comments from ‘someone’ and ‘winfan’ and suchlike.
If your values are not compatible with the “Debian Free Software Guidelines”
http://www.debian.org/social_contract
…then you are probably just here to troll.
Read the contract, and you will then know more about the background of your operating system (Debian). Phrases like ‘free’ and ‘non-free’ will make sense then.
I run a Debian desktop and laptop both running Squeeze and with all firmware ‘free’ incl. Graphics Cards and wifi. Had I opted for a bargain bin laptop or bought a 6 year old second hand model from ebay, then I might have had to, instead, go for the ‘includes non-free firmware’ CD install.
If you run an operating system that is proprietary, then you probably don’t even get a CD anymore, have a locked down mandatory update system that only works via an insecure browser, where updates cannot be picked and chosen based on ‘your’ needs.
Feature creep via update system, and back door Xbox DRM if you download a recent windows game from the online store.
There are upsides and downsides to everyone’s choice. If you are happy in a proprietary setup, then stay there, and hang out with some proprietary buddies rather than reading Debian blogs.
You know have a good whinge, about not being able to easily get hold of a windows 7 generic install CD, or paying an extra $20 just so your daughter can easily change the desktop background on her new netbook.
Perhaps it’s that your Mac you only bought 18 months ago, needs an OS upgrade that leaves it unable to work with your LCD or older printer.
Oh the upside is that you make no distinction between ‘free’ and ‘non-free’, so weigh it all up folks. Me…I’m totally happy with Debian and think Squeeze is the best release yet 🙂
J Dempsey says
During upgrade to Debian 6.0, the installer detected that I didn’t have the firmware for my network hardware it warned me just like it should. Unfortunately, the very next thing it did was restart the network.
This tends to be problematic when you are doing the upgrade over ssh.
This caused lots of pain for me and made the upgrade experience much much worse than previous releases.
Raphaël Hertzog says
Remote upgrades over ssh are common for servers. But “Debian” does not restart the network… the network-manager package might be (it’s not really designed to be upgraded), but then it’s only installed when you install the desktop profile.
I advise you to not use network-manager on any server.
Jonathan Carter says
It would also be advisable to run an upgrade that’s taking place over ssh in a screen session. That way, if you lose the connection for whatever reason, the upgrade won’t be interrupted.
J Dempsey says
Looking back at the script output, it was the NetworkManager that restarted the network.
eric says
The unofficial firmware-netinst image for amd64 detected my wireless card, but could not locate any nearby networks (there are plenty). Oh well, time to dig that ethernet cable out of the attic.
Raphaël Hertzog says
Squeeze’s installer unfortunately lacks WPA support so that may explains it. It’s one of the first feature implemented in wheezy’s debian-installer.
Justin says
Honestly, the only “non-free” drivers I like to have are the broadcom-wl drivers so that my wireless card will work. I found a page that explained how to get it enabled and I’m happy to go now.
Mike Harden says
Dumb question – do I have to generate a new initramfs after installing the non-free driver? I got the warning during a squeeze kernel update. I found the drivers and installed them and was just wondering if I need to run update-initramfs manually.
Raphaël Hertzog says
If you need the firmware for the early boot to work, yes, otherwise no. Just run
update-initramfs -u
or evenupdate-initramfs -u -k all
.Frank says
Nice article, I feel like I learned a lot from reading it.
Perhaps you could expand on this subject in a second article covering USB installs.
I recently installed squeeze on a machine with a broken cd drive. To use the wireless card, I needed the package firmware-iwlwifi. After struggling to get the standard installer to find the package, I found the non-official installer image on the Debian site (which worked like a charm).
nord says
http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/
Just download and install from a “unofficial” release with firmware included
No more firmware worries for noobs