Differences between revisions 2 and 3
Revision 2 as of 2008-09-12 15:13:29
Size: 2576
Editor: ?AlexOwen
Comment:
Revision 3 as of 2008-11-19 15:12:50
Size: 3225
Editor: ?AlexOwen
Comment:
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
#clear and cd into a temp directory
{{{
#Make a temp dir and transform the firmware tarball into an firmware initramfs addon
rm -rf /tmp/d-i_firmware
mkdir /tmp/d-i_firmware
cd /tmp/d-i_firmware
wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/lenny/current/firmware.tar.gz
tar -zxf firmware.tar.gz
for name in *.deb ; do
    ar -p $name data.tar.gz | tar -zxf -
done
pax -x sv4cpio -s '%lib%/lib%' -w lib | gzip -c >firmware.cpio.gz

#cd to the directory where you have your initrd

[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
cat initrd.gz.orig /tmp/d-i_firmware/firmware.cpio.gz >initrd.gz
}}}





-----
Old Stuff
-----
clear and cd into a temp directory

Some network cards annoyingly do not have their firmware in ROM but rather load the firmware 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 so cannot be included in the standard debian-installer images.

A similar problem can be found with some storage adapters. The proposed debian-installer solution there 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 install time downloading from a non-free archive via perhaps the network.

It can be seen that this approach does not work well with netboot images that 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 I prefer to use a different approach based on the fact that the Linux 2.6 Kernel uses initramfs rather that initrd.

Initramfs is essentially a concatination of gziped cpio archives that are extrated into a ram disk and used as an early userspace by the Linux Kernel. The debian initaller initrd.gz is infact 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 that we are missing we get the show on the road!

For example I need the firmware from the firmware-bnx2 package to install an HP DL380G5 with lenny.

#Make a temp dir and transform the firmware tarball into an firmware initramfs addon
rm -rf /tmp/d-i_firmware
mkdir  /tmp/d-i_firmware
cd /tmp/d-i_firmware
wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/lenny/current/firmware.tar.gz
tar -zxf firmware.tar.gz
for name in *.deb ; do 
    ar -p $name  data.tar.gz | tar -zxf -
done
pax -x sv4cpio  -s '%lib%/lib%' -w lib | gzip -c >firmware.cpio.gz

#cd to the directory where you have your initrd

[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
cat initrd.gz.orig /tmp/d-i_firmware/firmware.cpio.gz >initrd.gz


Old Stuff


clear and cd into a temp directory

rm -rf /tmp/firmware-bnx2 
mkdir  /tmp/firmware-bnx2 
cd /tmp/firmware-bnx2 

Get the lenny deb package containing the firmware

wget http://ftp.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.12_all.deb

Extract the files from the deb in the temp directory

ar -p firmware-bnx2_0.12_all.deb  data.tar.gz | tar -zxf - 

Create the cpio 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

Change to Debian Installer directory... (ie where you have your initrd.gz)

cd $debian-installer-dir 

Make a backup!

cp -p initrd.gz initrd.gz.orig 

Concatinate 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!