[:DebianWiki/EditorGuide#translation:Translation(s)]: none

(!) [:/Discussion:Discussion]


Netbooting and Firmware

This page describes how to include non-free firmware within Debian netboot images.

?TableOfContents(3)

Introduction

Some network cards annoyingly do not have their firmware in ROM, but rather load it from the host operating system. This is not too much of a problem until you realise that much of the firmware is non-free and cannot be included in standard Debian Installer images.

The proposed [:DebianInstaller:Debian Installer] solution is to produce non-free udebs containing the firmware and adjust the installer, to give the user the option of installing these firmware udebs at installation time, by downloading from a non-free archive (eg. via the network).

The 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 elsewhere.

I am capable of building Debian Installer images, but prefer to use a different approach based on the fact the Linux 2.6 kernel uses initramfs rather than [:Initrd:initrd].

The Solution: Add Firmware to Initramfs

[:initramfs:Initramfs] is essentially a concatenation of gzipped cpio archives which are extracted into a ramdisk and used as an early userspace by the Linux kernel. Debian Installer's initrd.gz is in fact a single gzipped cpio archive containing all the files the installer needs at boot time. By simply appending another gzipped cpio archive - containing the firmware files we are missing - we get the show on the road!

Example #1

I require the firmware from the firmware-bnx2 package to install on an [:HP/ProLiant:HP DL380G5] with [:DebianLenny: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: ([http://packages.debian.org/lenny/all/firmware-bnx2/download firmware-bxn2 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.12_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. Concatenate the firmware:

    cat initrd.gz.orig /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!

Example #2

Alternatively, use the following procedure to transform the non-free firmware tarball into cpio.gz form that can be concatenated to the official initrd.gz:

Preseed Configuration

Remember, you will need to enable the non-free repository and install the appropriate *firmware*.deb's, to ensure the installed system's initrd is properly configured and firmware packages receive security updates (should there be any).

This can be done by preseeding the following:

See Also


CategoryNetwork