Skip to content

Instantly share code, notes, and snippets.

@waja
Created December 8, 2013 13:10
Show Gist options
  • Save waja/7857200 to your computer and use it in GitHub Desktop.
Save waja/7857200 to your computer and use it in GitHub Desktop.
Bash script to inject latest wheezy firmware into local Debian netboot ramdisk
# see http://wiki.debian.org/DebianInstaller/NetbootFirmware#Wheezy_Example_.232_:_add_debs_from_firmware.tar.gz
#!/bin/sh
FWTMP=/tmp/d-i_firmware
DSTDIR=/srv/tftp/boot/debian-installer/
rm -rf $FWTMP
mkdir -p $FWTMP/firmware
cd $FWTMP
wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/wheezy/current/firmware.tar.gz
tar -C firmware -zxf firmware.tar.gz
pax -x sv4cpio -s'%firmware%/firmware%' -w firmware | gzip -c >firmware.cpio.gz
for arch in i386 amd64; do
# cd to the directory where you have your initrd
cd $DSTDIR/$arch
[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
cat initrd.gz.orig $FWTMP/firmware.cpio.gz > initrd.gz
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment