Debian PXE install content of preseed.cfg file to ensure network firmware gets installed

debianpxe-boot

I have a trouble using the preseed.cfg file while installing Debian by PXE.

My network card needs the firmware-bnx2 package to be taken in account by the debian kernel.

During the PXE boot process, the manufacturer allows the system to set up its network interface and reach the initrd & kernel and the installation starts. In this initrd I have put the pressed.cfg file which is taken in account. But the installation can not be automatically accomplished until I install this bnx2 package.

I have no idea how to install the bnx2 package during this boot process.
I think this is possible through the instruction

d-i hw-detect/load_firmware boolean true

The documentation says

# If non-free firmware is needed for the network or other hardware, you can
# configure the installer to always try to load it, without prompting. Or
# change to false to disable asking.

But I don't know where to set this package and how to install it.

Can anyone help me please?

Many thanks!

Best Answer

You probably want to add the missing firmware to the debian-installer filesystem. Here's how to proceed.

First some context : let's admit we have PXE configured to use /tftpboot as a TFTP root, and use the following "menu" instead of the default in pxelinux.cfg :

    default install label install
        menu label ^Install
        menu default
        kernel debian-installer/amd64/linux
        append vga=788 initrd=debian-installer/amd64/initrd.gz auto=true interface=auto priority=critical url=http://192.0.2.5 preseed/url=http://192.0.2.5/my-custom-preseed.cfg console=ttyS1,115200n8

So from there :

  1. go find your inirtd.gz file and expand it
    cd /tftpboot/debian-installer/amd64/
    cp initrd.gz initrd.gz.orig
    mkdir -p tmp/initrd; cd tmp/initrd
    zcat ../../inirt.gz | cpio -iv 
  1. you get the required firmware to put it inside :
    apt-get install --download-only firmware-bnx2 firmware-bnx2x
    cd /tftpboot/debian-installer/amd64/tmp/initrd
    dpkg-deb -x /var/cache/apt/archives/firmware-bnx2_*.deb ../
    dpkg-deb -x /var/cache/apt/archives/firmware-bnx2x_*.deb ../
    cp -a ../lib/firmware lib/firmware
  1. and re-build the initrd file
    cd /tftpboot/debian-installer/amd64/tmp/initrd
    find . -print0 | cpio -0 -H newc -ov | gzip -c > ../../initrd.gz

You're done, give it a try.

Related Topic