Debian – How to put rtlwifi drivers on Debian installation USB

debiandebian-installerrealtekusbwifi

I downloaded the Debian amd64 netinstall ISO and placed it on a USB stick using

dd if=debianblahblah.iso of=/dev/sdb

The installer works fine, but my laptop requires proprietary wireless drivers (RTL8192) to get internet during the install.

I extracted the drivers from the realtek folder in the firmware-nonfree package. I wanted to put them in the /firmware folder on the install disk, but the it's not writable. So (following various instructions found online) I then tried to create a second partition in the remaining space on the drive (partitioned/formatted as VFAT), and move the files there. But I can't mount the partition, and receive error

mount: wrong fs type, bad option, bad superblock on /dev/sdc3, missing codepage or helper program, or other error

if I try to mount the new partition.

I also tried placing the files on a separate USB, but the Debian installer couldn't find/detect them (and unfortunately, the installer isn't designed to give any info on why it failed).

How do I include the rtlwifi drivers on the same disk as the debian ISO so that the installer can find them? Or alternately, how do I make a 2nd USB disk that the installer can recognize?

Best Answer

I experienced the same with wifi drivers (firmware-iwlwifi) which weren't automatically recognized although being located in the root directory of the USB device.

I've found a working solution here.

In short:

  • Download the Debian firmware package corresponding to your hardware
  • Open the data archive inside it and put the content of lib/firmware/ into the root directory of your FAT USB device
  • Insert the USB device if the installer asks for it, switch via Ctrl+Alt+F2 to a virtual terminal and mount your device to /lib/firmware/, e.g. by using mount /dev/sdc1 /lib/firmware

That's it. The installer should find the firmware and probe the corresponding device during network setup.

After the installation has finished and your new system has booted you have to do roughly the same to be able to use the device immediately. Create /lib/firmware/ and copy the files into this directory. Reboot and your device will appear. Now install the corresponding firmware Debian package via your package manager.

Related Question