]> pere.pagekite.me Git - homepage.git/blob - blog/data/2013-06-25-isenkram-firmware.txt
Generated.
[homepage.git] / blog / data / 2013-06-25-isenkram-firmware.txt
1 Title: Automatically locate and install required firmware packages on Debian (Isenkram 0.4)
2 Tags: english, debian, isenkram
3 Date: 2013-06-25 11:50
4
5 <p>It annoys me when the computer fail to do automatically what it is
6 perfectly capable of, and I have to do it manually to get things
7 working. One such task is to find out what firmware packages are
8 needed to get the hardware on my computer working. Most often this
9 affect the wifi card, but some times it even affect the RAID
10 controller or the ethernet card. Today I pushed version 0.4 of the
11 <a href="http://packages.qa.debian.org/isenkram">Isenkram package</a>
12 including a new script isenkram-autoinstall-firmware handling the
13 process of asking all the loaded kernel modules what firmware files
14 they want, find debian packages providing these files and install the
15 debian packages. Here is a test run on my laptop:</p>
16
17 <p><pre>
18 # isenkram-autoinstall-firmware
19 info: kernel drivers requested extra firmware: ipw2200-bss.fw ipw2200-ibss.fw ipw2200-sniffer.fw
20 info: fetching http://http.debian.net/debian/dists/squeeze/Contents-i386.gz
21 info: locating packages with the requested firmware files
22 info: Updating APT sources after adding non-free APT source
23 info: trying to install firmware-ipw2x00
24 firmware-ipw2x00
25 firmware-ipw2x00
26 Preconfiguring packages ...
27 Selecting previously deselected package firmware-ipw2x00.
28 (Reading database ... 259727 files and directories currently installed.)
29 Unpacking firmware-ipw2x00 (from .../firmware-ipw2x00_0.28+squeeze1_all.deb) ...
30 Setting up firmware-ipw2x00 (0.28+squeeze1) ...
31 #
32 </pre></p>
33
34 <p>When all the requested firmware is present, a simple message is
35 printed instead:</p>
36
37 <p><pre>
38 # isenkram-autoinstall-firmware
39 info: did not find any firmware files requested by loaded kernel modules. exiting
40 #
41 </pre></p>
42
43 <p>It could use some polish, but it is already working well and saving
44 me some time when setting up new machines. :)</p>
45
46 <p>So, how does it work? It look at the set of currently loaded
47 kernel modules, and look up each one of them using modinfo, to find
48 the firmware files listed in the module meta-information. Next, it
49 download the Contents file from a nearby APT mirror, and search for
50 the firmware files in this file to locate the package with the
51 requested firmware file. If the package is in the non-free section, a
52 non-free APT source is added and the package is installed using
53 <tt>apt-get install</tt>. The end result is a slightly better working
54 machine.</p>
55
56 <p>I hope someone find time to implement a more polished version of
57 this script as part of the hw-detect debian-installer module, to
58 finally fix <a href="http://bugs.debian.org/655507">BTS report
59 #655507</a>. There really is no need to insert USB sticks with
60 firmware during a PXE install when the packages already are available
61 from the nearby Debian mirror.</p>