Debian complained about missing firmware during installation? Add missing 'non-free' firmware to installation image! :)
Gabriel M.
Linux Systems Engineer | IT Infrastructure | Security | Virtualization | Automation | AI | C and Shell Scripting
If you have installed Debian, you might have faced the screen below:
And probably got very frustrated, because your wireless interface was not working as expected, or even not working at all! Well, Debian is an awesome Linux distribution, but it will not ship 'non-free' content during its installation. You will have to explicitly install any 'non-free' software afterward.
Or you can just download the ISO and make your custom modifications to it. Let's take a look at how to do that. I will present that as a step-by-step quick guide.
------------------------------------------------------------------
1) Install xorisso:
sudo apt install xorriso
------------------------------------------------------------------
2) Download netinst and firmware package:
wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.8.0-amd64-netinst.iso
wget https://cdimage.debian.org/cdimage/unofficial/non-free/firmware/buster/current/firmware.tar.gz
------------------------------------------------------------------
3) Extract hybrid MBR from original ISO (used later to rebuild it)
This will also make the system able to boot from different medi types and systems!
dd if=debian-10.8.0-amd64-netinst.iso bs=1 count=432 of=isohdpfx.bin
------------------------------------------------------------------
4) Extract the iso to a desired location
xorriso -osirrox on -indev debian-10.8.0-amd64-netinst.iso -extract / debian-10.8.0-amd64-netinst-nf-fmw
------------------------------------------------------------------
5) Extract missing firmware into the propper /firmware directory:
tar xvf firmware.tar.gz -C debian-10.8.0-amd64-netinst-nf-fmw/firmware/
------------------------------------------------------------------
6) Build a new ISO file. Here we are using xorriso as a replacement
for the previously genisoimage + isohybrid:
xorriso -as mkisofs -r -V 'Debian 10.8.0 amd64 Custom' -o debian-10.8.0-amd64-netinst-nf-fmw.iso -J -R -joliet-long -cache-inodes -isohybrid-mbr isohdpfx.bin -b isolinux/isolinux.bin -c isolinux/boot.cat -boot-load-size 4 -boot-info-table -no-emul-boot -eltorito-alt-boot -e boot/grub/efi.img -no-emul -boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus debian-10.8.0-amd64-netinst-nf-fmw
------------------------------------------------------------------
7) Now just burn that image to an USB device:
dd if=debian-10.8.0-amd64-netinst-nf-fmw.iso of=/dev/sdXY bs=32M status=progress
Once you have done this, Debian will be able to find all the missing firmware during installation, considering that the missing firmware .deb files were correctly placed in the /firmware directory.
Cool, right? Now you have your own custom netinst ISO file! And you can add even more stuff, depending on what you need! Have fun!
FIN!