]> pere.pagekite.me Git - homepage.git/blob - blog/data/2014-10-17-debian-firmware-install.txt
Generated.
[homepage.git] / blog / data / 2014-10-17-debian-firmware-install.txt
1 Title: Debian Jessie, PXE and automatic firmware installation
2 Tags: english, debian, isenkram, sysadmin
3 Date: 2014-10-17 14:10
4
5 <p>When PXE installing laptops with Debian, I often run into the
6 problem that the WiFi card require some firmware to work properly.
7 And it has been a pain to fix this using preseeding in Debian.
8 Normally something more is needed. But thanks to
9 <a href="https://packages.qa.debian.org/i/isenkram.html">my isenkram
10 package</a> and its recent tasksel extension, it has now become easy
11 to do this using simple preseeding.</p>
12
13 <p>The isenkram-cli package provide tasksel tasks which will install
14 firmware for the hardware found in the machine (actually, requested by
15 the kernel modules for the hardware). (It can also install user space
16 programs supporting the hardware detected, but that is not the focus
17 of this story.)</p>
18
19 <p>To get this working in the default installation, two preeseding
20 values are needed. First, the isenkram-cli package must be installed
21 into the target chroot (aka the hard drive) before tasksel is executed
22 in the pkgsel step of the debian-installer system. This is done by
23 preseeding the base-installer/includes debconf value to include the
24 isenkram-cli package. The package name is next passed to debootstrap
25 for installation. With the isenkram-cli package in place, tasksel
26 will automatically use the isenkram tasks to detect hardware specific
27 packages for the machine being installed and install them, because
28 isenkram-cli contain tasksel tasks.</p>
29
30 <p>Second, one need to enable the non-free APT repository, because
31 most firmware unfortunately is non-free. This is done by preseeding
32 the apt-mirror-setup step. This is unfortunate, but for a lot of
33 hardware it is the only option in Debian.</p>
34
35 <p>The end result is two lines needed in your preseeding file to get
36 firmware installed automatically by the installer:</p>
37
38 <p><blockquote><pre>
39 base-installer base-installer/includes string isenkram-cli
40 apt-mirror-setup apt-setup/non-free boolean true
41 </pre></blockquote></p>
42
43 <p>The current version of isenkram-cli in testing/jessie will install
44 both firmware and user space packages when using this method. It also
45 do not work well, so use version 0.15 or later. Installing both
46 firmware and user space packages might give you a bit more than you
47 want, so I decided to split the tasksel task in two, one for firmware
48 and one for user space programs. The firmware task is enabled by
49 default, while the one for user space programs is not. This split is
50 implemented in the package currently in unstable.</p>
51
52 <p>If you decide to give this a go, please let me know (via email) how
53 this recipe work for you. :)</p>
54
55 <p>So, I bet you are wondering, how can this work. First and
56 foremost, it work because tasksel is modular, and driven by whatever
57 files it find in /usr/lib/tasksel/ and /usr/share/tasksel/. So the
58 isenkram-cli package place two files for tasksel to find. First there
59 is the task description file (/usr/share/tasksel/descs/isenkram.desc):</p>
60
61 <p><blockquote><pre>
62 Task: isenkram-packages
63 Section: hardware
64 Description: Hardware specific packages (autodetected by isenkram)
65 Based on the detected hardware various hardware specific packages are
66 proposed.
67 Test-new-install: show show
68 Relevance: 8
69 Packages: for-current-hardware
70
71 Task: isenkram-firmware
72 Section: hardware
73 Description: Hardware specific firmware packages (autodetected by isenkram)
74 Based on the detected hardware various hardware specific firmware
75 packages are proposed.
76 Test-new-install: mark show
77 Relevance: 8
78 Packages: for-current-hardware-firmware
79 </pre></blockquote></p>
80
81 <p>The key parts are Test-new-install which indicate how the task
82 should be handled and the Packages line referencing to a script in
83 /usr/lib/tasksel/packages/. The scripts use other scripts to get a
84 list of packages to install. The for-current-hardware-firmware script
85 look like this to list relevant firmware for the machine:
86
87 <p><blockquote><pre>
88 #!/bin/sh
89 #
90 PATH=/usr/sbin:$PATH
91 export PATH
92 isenkram-autoinstall-firmware -l
93 </pre></blockquote></p>
94
95 <p>With those two pieces in place, the firmware is installed by
96 tasksel during the normal d-i run. :)</p>
97
98 <p>If you want to test what tasksel will install when isenkram-cli is
99 installed, run <tt>DEBIAN_PRIORITY=critical tasksel --test
100 --new-install</tt> to get the list of packages that tasksel would
101 install.</p>
102
103 <p><a href="https://wiki.debian.org/DebianEdu/">Debian Edu</a> will be
104 pilots in testing this feature, as isenkram is used there now to
105 install firmware, replacing the earlier scripts.</p>