#!/bin/bash # This script do the following: # Download last Debian Initrd # Download firmwares: # bnx2 # all non-free (for tigon) # Extract all downloaded files # Make a new initrd with the firmwares TEMP_DIR=$(mktemp -d) pushd "${TEMP_DIR}" # Download and uncompress original initrd wget http://ftp.fr.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz mkdir "${TEMP_DIR}"/mkinitrd pushd "${TEMP_DIR}"/mkinitrd/ zcat ../initrd.gz | cpio -iv popd # Download bnx2's firmware and uncompress it wget http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.41_all.deb dpkg-deb -x firmware-bnx2_0.41_all.deb "${TEMP_DIR}"/mkinitrd # Download tigon(all non-free)'s firmware and uncompress it wget http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-linux-nonfree_0.41_all.deb dpkg-deb -x firmware-linux-nonfree_0.41_all.deb "${TEMP_DIR}"/mkinitrd # Make a new initrd mv initrd.gz initrd_orig.gz pushd "${TEMP_DIR}"/mkinitrd/ find . -print0 | cpio -0 -H newc -ov | gzip -c > ../initrd.gz popd # Move it to PXE Debian installer mv initrd.gz /var/lib/tftpboot/installer/debian/wheezy/amd64/initrd_firm.gz popd # Clean temp file rm -rf "${TEMP_DIR}"