Recently I had the need to create a custom GNU/Linux distribution. It would install the system in a computer, along with a few handpicked packages, all with minimum fuss. Luckily enough, there’s software for this: Debian Live.
The project’s website is not initially the most inviting, but it doesn’t take much digging to find the documentation of the project. Just following the section titled “For the impatient” gets you up and running in no time, creating a customised installer of Debian GNU/Linux. The rest of the documentation covers a number of advanced cases.
Proprietary drivers during installation
However, I did come across a stumbling block. Some of the laptops where I have to install this require a proprietary driver for their WiFi card. The problem here is not getting these drivers installed: instead, the problem is getting the card to work during the installation process itself, so that updated packages can be downloaded if desired.
Reading the documentation, it’s straightforward to see how to get the drivers working after the installation. Simply add the name of your package to one of the “chroot” package lists:
And make sure you are fetching packages from the contrib/non-free repositories if required:
So that’s simple. Now, how to make this work for the installation process too? On further reading, I am led to think I only need a “binary” package list referencing the same package but, much as I try, that leads nowhere. The required firmware doesn’t end up in the expected place
Finally I figured out a way. During the build process, and after the firmware is unpackaged on the “chroot” tree, I can have a hook (see section 9.2 of the manual) copy the files across to the “binary” tree. For this I just needed this file (as well as the two listings above):
And that is this problem solved! I’ll note that the installation process still asks whether you want to supply firmware from the wayward device. In my case, it asks three times, each time mentioning different required files. Just go “Yes” until it’s satisfied. Of course, if it always asks about the same files, it’s probably because something went wrong and it can’t actually find them.
A way to avoid this question asked at all is using a preseeded configuration:
That should make it clear that yes, we want that firmware loaded and there’s no need to ask so many questions.
A working example
A nice feature of Debian Live is that it’s all configured using just a few text files. Very convenient to track your progress with version control. I published the config files for my distro on Github if you want to check it out. At the time of writing these lines, it is a working example of the technique described above: https://github.com/pablobm/w2c3-livecd