Skip to content

Adding Non-free Drivers to a Debian Netboot initrd

June 11, 2012

When working on an IaaS product, there is a constant need to have an easy and quick way to re-provision bare metal quickly. At Eucalyptus we utilize  Cobbler and a home grown solution that allow us to setup servers automatically. PXE along with kickstart/preseed configurations create an easy, consistent and automated way to setup bare metal on the fly. Setting this up though is not always as easy as one would like for some operating systems and hardware configurations.

When netbooting Debian on a Dell server with a Broadcom Netextreme II network card, a missing firmware error will occur with the stock Debian netboot ramdisk. The Broadcom Netextreme II network card uses non-free firmware so Debian will not pack it by default with its stock images. So, the firmware needs to be added to the netboot ramdisk manually before the machine will be able to successfully boot and access the network.

The Debian Wiki’s Netboot Firmware page contains some instructions on how to add the non-free firmware deb package to the stock ramdisk. Unfortunately, I was unable to get this to work. So, another method was performed to get the firmware into the netboot ramdisk and below is what I did. (NOTE: the below example uses the Debian Squeeze release. The same instructions will work with other versions of Debian as well.)

  1. Download the netboot kernel and ramdisk from your favorite Debian mirror. For example, on the USC Mirror these files for 64-bit can be found at the following location: http://mirrors.usc.edu/pub/linux/distributions/debian/dists/squeeze/main/installer-amd64/current/images/netboot/debian-installer/amd64/
  2. Create a temporary directory that you will extract the ramdisk to.
    mkdir /tmp/initrd
  3. Copy the ramdisk to the temporary location and then extract the ramdisk into the directory.
    cp $DOWNLOAD_DIR/initrd.gz /tmp/initrd
    cd /tmp/initrd
    gunzip <initrd.gz | cpio --extract --preserve --verbose

    Above $DOWNLOAD_DIR is the location the ramdisk was originally downloaded to.

  4. Remove the initrd.gzfile from the temp directory.
    rm /tmp/initrd/initrd.gz
  5. In /tmp/initrd/lib create a firmwaredirectory.
    mkdir /tmp/initrd/lib/firmware

    *NOTE: There may be a more proper place to put this directory according to the Debian Wiki - Firmware Locations. This location works though without any issues in the ramdisk.

  6. Download the Debian non-free drivers tarball from the Debian package websiteand unpack it in another temporary directory.
    cd /tmp
    wget http://ftp.de.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-nonfree_0.28+squeeze1.tar.gz
    tar xzvf firmware-nonfree*.tar.gz
  7. Copy over the bnx2 folder contents from the non-free drivers tarball to the firmware directory created in step 5.
    cp -Rav /tmp/firmware-nonfree/bnx2/bnx2* /tmp/initrd/lib/firmware/
  8. Now repack the initrd with the newly added drivers.
    cd /tmp/initrd
    find . | cpio --create --format='newc' | gzip >../initrd.gz

A new ramdisk has been created with the non-free drivers included. The /tmp/initrd.gz file can be placed onto a tftpboot server or other boot server for usage by properly configured systems using PXE. The Debian Squeeze installer can then be run by users or with a proper configuration, a fully automated install can occur with preseed configurations.

3 Comments
  1. hspencer77 permalink

    Reblogged this on More Mind Spew-age from Harold Spencer Jr. and commented:
    This is a good blog..especially for DevOps guys. These types of blogs really help with automating infrastructure deployments. Enjoy!

  2. pacpoke permalink

    I have a problem getting it to accept the non-free drivers… do I have to add a boot parameter to txt.cfg to get it to accept the non-free firmware?

    • Nope. This tutorial is all that I’ve done for this to work for me. Not sure why this isn’t working for you. I also haven’t tried this for Debian 7 so if that’s what you’re trying to modify things might have changed.

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

Follow

Get every new post delivered to your Inbox.

Join 53 other followers

%d bloggers like this: