Differences between revisions 24 and 36 (spanning 12 versions)
Revision 24 as of 2011-10-09 14:06:55
Size: 6530
Editor: GeoffSimmons
Comment: Amend filename of current firmware-bnx2 package in stable.
Revision 36 as of 2015-12-11 18:22:56
Size: 6385
Editor: ?AlexOwen
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English - [[it/DebianInstaller/NetbootFirmware|Italiano]]-~ ~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English - [[fr/DebianInstaller/NetbootFirmware|Français]] - [[it/DebianInstaller/NetbootFirmware|Italiano]]-~
Line 18: Line 18:
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. 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 in [[DebianInstaller/Build|the Debian Installer (d-i) wiki page]].
Line 25: Line 25:
== Examples for Squeeze ==
New features in the Squeeze version of debian-installer give us a simpler method of adding firmware to the debian-installer initramfs.
It should be noted that the Lenny methods should also work with Squeeze.
== New Simple Method for Debian 8 Jessie and above ==
Debian now also distribute a firmware cpio.gz which can be directly concatenated to the initramfs. This simplifies things.
Line 29: Line 28:
=== Squeeze Example #1 : add single firmware deb === === Example #1: add debs from firmware.cpio.gz ===
{{{
# cd to the directory where you have your initrd
cd /tftpboot/debian-installer/i386
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
[ -f firmware.cpio.gz ] || wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/stable/current/firmware.cpio.gz
cat initrd.gz.orig firmware.cpio.gz > initrd.gz
}}}

=== Preseed Configuration ===

Remember, you will need to enable the non-free repository to ensure that the firmware packages receive security updates (should there be any).

This can be done by preseeding the following:

 {{{
base-config apt-setup/non-free boolean true
 }}}




<<Anchor(Examples for Debian 7.0 "Wheezy")>>
== Examples for Debian 7 "Wheezy" ==

Features in the debian-installer available since debian 6.0 (squeeze) release give us a simple method of adding firmware to the debian-installer initramfs.

Initial testing with the Wheezy debian-installer beta 4 shows that the squeeze method still works. Wheezy examples with updated URLs follow:

=== Wheezy Example #1 : add single firmware deb ===
Line 35: Line 63:
wget http://ftp.us.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.28+squeeze1_all.deb wget http://http.debian.net/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.36+wheezy.1_all.deb
Line 45: Line 73:
=== Squeeze Example #2 : add debs from firmware.tar.gz === === Stable Example #2 : add debs from firmware.tar.gz ===
Line 52: Line 80:
wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/squeeze/current/firmware.tar.gz wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/stable/current/firmware.tar.gz
Line 54: Line 82:
cd firmware
tar -zxf ../firmware.tar.gz
tar -C firmware -zxf firmware.tar.gz

pax -x sv4cpio -s'%firmware%/firmware%' -w firmware | gzip -c >firmware.cpio.gz

# cd to the directory where you have your initrd
cd /tftpboot/debian-installer/i386
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
cat initrd.gz.orig $FWTMP/firmware.cpio.gz > initrd.gz
}}}

=== Wheezy Preseed Configuration ===

Remember, you will need to enable the non-free repository to ensure that the firmware packages receive security updates (should there be any).

This can be done by preseeding the following:

 {{{
base-config apt-setup/non-free boolean true
 }}}

== Examples for Debian 6.0 "Squeeze" ==
New features in the Squeeze version of debian-installer give us a simpler method of adding firmware to the debian-installer initramfs.

=== Squeeze Example #1 : add single firmware deb ===
{{{
FWTMP=/tmp/d-i_firmware
rm -rf $FWTMP
mkdir -p $FWTMP/firmware
cd $FWTMP/firmware
wget http://http.debian.net/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.28+squeeze1_all.deb
Line 57: Line 113:
pax -x sv4cpio -w firmware | gzip -c >firmware.cpio.gz

# cd to the directory where you have your initrd
cd /tftpboot/debian-installer/i386
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
cat initrd.gz.orig $FWTMP/firmware.cpio.gz > initrd.gz
}}}

=== Oldstable Example #2 : add debs from firmware.tar.gz ===
{{{
FWTMP=/tmp/d-i_firmware
rm -rf $FWTMP
mkdir -p $FWTMP/firmware
cd $FWTMP

wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/oldstable/current/firmware.tar.gz

tar -C firmware -zxf firmware.tar.gz
Line 76: Line 150:
== Examples for Lenny ==
=== Lenny Example #1 : add firmware from a single deb ===
I require the firmware from the DebPkg: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
}}}
 1. Acquire the DebPkg:lenny/firmware-bnx2 package, which contains the firmware: ([[http://packages.debian.org/lenny/all/firmware-bnx2/download|firmware-bnx2 download page]]) {{{
wget http://ftp.us.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.14+lenny2_all.deb
}}}
 1. Extract the files from the package into the temporary directory: {{{
ar -p firmware-bnx2_0.14+lenny2_all.deb data.tar.gz | tar -zxf -
}}}
 1. 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
}}}
 1. Change to the Debian Installer directory... (ie where you have your initrd.gz): {{{
cd $debian-installer-dir
}}}
 1. Make a backup! {{{
cp -p initrd.gz initrd.gz.orig
}}}
 1. 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!

=== Lenny Example #2 : add firmware from firmware.tar.gz ===
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:

 ~- {{{
# Make a temp dir and transform the firmware tarball into an firmware initramfs addon
FWTMP=/tmp/d-i_firmware
rm -rf $FWTMP
mkdir $FWTMP
cd $FWTMP
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
cd /tftpboot/debian-installer/i386
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
cat $FWTMP/firmware.cpio.gz >> initrd.gz
}}} -~

=== Lenny 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:

 {{{
base-config apt-setup/non-free boolean true
d-i preseed/late_command string apt-install atmel-firmware; apt-install firmware-bnx2; apt-install firmware-iwlwifi; apt-install firmware-qlogic; apt-install firmware-ralink; apt-install ixp4xx-microcode; apt-install libertas-firmware
}}}

Translation(s): English - Français - Italiano


Netbooting and Firmware

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

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 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 (e.g. 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 in the Debian Installer (d-i) wiki page.

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.

The Solution: Add Firmware to 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!

New Simple Method for Debian 8 Jessie and above

Debian now also distribute a firmware cpio.gz which can be directly concatenated to the initramfs. This simplifies things.

Example #1: add debs from firmware.cpio.gz

# cd to the directory where you have your initrd
cd /tftpboot/debian-installer/i386
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
[ -f firmware.cpio.gz ] || wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/stable/current/firmware.cpio.gz
cat initrd.gz.orig firmware.cpio.gz > initrd.gz

Preseed Configuration

Remember, you will need to enable the non-free repository to ensure that the firmware packages receive security updates (should there be any).

This can be done by preseeding the following:

  • base-config     apt-setup/non-free      boolean true

Examples for Debian 7 "Wheezy"

Features in the debian-installer available since debian 6.0 (squeeze) release give us a simple method of adding firmware to the debian-installer initramfs.

Initial testing with the Wheezy debian-installer beta 4 shows that the squeeze method still works. Wheezy examples with updated URLs follow:

Wheezy Example #1 : add single firmware deb

FWTMP=/tmp/d-i_firmware
rm -rf $FWTMP
mkdir  -p $FWTMP/firmware
cd $FWTMP/firmware
wget http://http.debian.net/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.36+wheezy.1_all.deb
cd ../
pax -x sv4cpio -w firmware | gzip -c >firmware.cpio.gz

# cd to the directory where you have your initrd
cd /tftpboot/debian-installer/i386
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
cat initrd.gz.orig $FWTMP/firmware.cpio.gz > initrd.gz

Stable Example #2 : add debs from firmware.tar.gz

FWTMP=/tmp/d-i_firmware
rm -rf $FWTMP
mkdir  -p $FWTMP/firmware
cd $FWTMP

wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/stable/current/firmware.tar.gz

tar -C firmware -zxf firmware.tar.gz

pax -x sv4cpio -s'%firmware%/firmware%' -w firmware | gzip -c >firmware.cpio.gz

# cd to the directory where you have your initrd
cd /tftpboot/debian-installer/i386
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
cat initrd.gz.orig $FWTMP/firmware.cpio.gz > initrd.gz

Wheezy Preseed Configuration

Remember, you will need to enable the non-free repository to ensure that the firmware packages receive security updates (should there be any).

This can be done by preseeding the following:

  • base-config     apt-setup/non-free      boolean true

Examples for Debian 6.0 "Squeeze"

New features in the Squeeze version of debian-installer give us a simpler method of adding firmware to the debian-installer initramfs.

Squeeze Example #1 : add single firmware deb

FWTMP=/tmp/d-i_firmware
rm -rf $FWTMP
mkdir  -p $FWTMP/firmware
cd $FWTMP/firmware
wget http://http.debian.net/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.28+squeeze1_all.deb
cd ../
pax -x sv4cpio -w firmware | gzip -c >firmware.cpio.gz

# cd to the directory where you have your initrd
cd /tftpboot/debian-installer/i386
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
cat initrd.gz.orig $FWTMP/firmware.cpio.gz > initrd.gz

Oldstable Example #2 : add debs from firmware.tar.gz

FWTMP=/tmp/d-i_firmware
rm -rf $FWTMP
mkdir  -p $FWTMP/firmware
cd $FWTMP

wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/oldstable/current/firmware.tar.gz

tar -C firmware -zxf firmware.tar.gz

pax -x sv4cpio -s'%firmware%/firmware%' -w firmware | gzip -c >firmware.cpio.gz

# cd to the directory where you have your initrd
cd /tftpboot/debian-installer/i386
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
cat initrd.gz.orig $FWTMP/firmware.cpio.gz > initrd.gz

Squeeze Preseed Configuration

Remember, you will need to enable the non-free repository to ensure that the firmware packages receive security updates (should there be any).

This can be done by preseeding the following:

  • base-config     apt-setup/non-free      boolean true

See Also


CategoryNetwork