Including non-free firmware within Debian netboot images

Problem –

It can be seen this approach does not work well with netboot images which need Ethernet firmware… the Ethernet firmware really needs to be in the initrd.gz before the kernel boots. One solution is to build your own custom Debian Installer images. This is possible and the Debian Installer build process is described here –

I require the firmware from the firmware-bnx2 package to install on an Dell PowerEdge R710 with Lenny:

  1. Clear, create and cd into a temporary directory:
    rm -rf /tmp/firmware-bnx2
    mkdir  /tmp/firmware-bnx2
    cd /tmp/firmware-bnx2
  2. Acquire the lenny/firmware-bnx2 package, which contains the firmware: (firmware-bnx2 download page)
    wget http://ftp.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.14_all.deb
  3. Extract the files from the package into the temporary directory:
    ar -p firmware-bnx2_0.14_all.deb data.tar.gz | tar -zxf -
  4. Create the cpio archive using pax, contain stuff under lib but root it in / in the archive:
    pax -x sv4cpio -s '%lib%/lib%' -w lib | gzip -c >bnx2-fw.cpio.gz
  5. Change to the Debian Installer directory… (ie where you have your initrd.gz):
    cd $debian-installer-dir
  6. Make a backup!
    cp -p initrd.gz initrd.gz.orig
  7. Append the new archive to the original initrd:
    cat /tmp/firmware-bnx2/bnx2-fw.cpio.gz >> initrd.gz

Now boot with your new initrd.gz and original vmlinuz and you should be on the road!

Alternative way –

We uncompress the image using:

mkdir temp
cd temp/
zcat ../initrd.gz | cpio -iv

Download the firmware-bnx2 debian package:

cd ..
wget http://http.us.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.14_all.deb

and extract the contents with:
dpkg-deb -x firmware-bnx2_0.14_all.deb bnx2

We need to copy the files under lib/firmware/bnx2-06-4.0.5.fw , bnx2-09-4.0.5.fw and bnx2/usr/share/initramfs-tools/hooks/firmware_bnx2 inside the extracted directory of the initrd and compress it back (from the extracted directory):

find . -print0 | cpio -0 -H newc -ov | gzip -c > ../initrd.gz

Advertisements

3 Responses to “Including non-free firmware within Debian netboot images”

  1. Jeff Caldwell Says:

    I’m trying with the latest version of the firmware deb, firmware-bnx2_0.28_all.deb. I was able to modify the initrd for the netboot, but when the system comes up there is no networking.

    When I dropped from the installer menu to a shell, I see all the files present under /lib/firmware/bnx2*, and my interfaces file is fine from preseeded values, and bnx2 shows up on modprobe.

    But there is no route and no connectivity. Any ideas? Inside the deb installer shell there aren’t many commands available…

  2. Sheikh Jafar Tarique Says:

    Ahh thats weird!! what shows when you run the ifconfig -a command? or mii-tools commands?

  3. linuxhelp Says:

    Actually with a netinstall image, installer ask you if you have extra firmware. You have to tell the installer where to take it (cd, usb, …)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: