make_debian_initrd_with_firmware for all Debian version.
This commit is contained in:
parent
95c5ba7d1b
commit
c4de4a8a04
|
@ -1,44 +1,49 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# This script do the following:
|
# This script do the following:
|
||||||
# Download last Debian Initrd
|
# Download Debian Initrd for Wheezy, Jessie and Sid
|
||||||
# Download firmwares:
|
# Download firmwares:
|
||||||
# bnx2
|
# bnx2
|
||||||
# all non-free (for tigon)
|
# all non-free (for tigon)
|
||||||
# Extract all downloaded files
|
# Extract all downloaded files
|
||||||
# Make a new initrd with the firmwares
|
# Make a new initrd with the firmwares
|
||||||
|
|
||||||
TEMP_DIR=$(mktemp -d)
|
for DISTRO in wheezy jessie sid; do # For ALL Debian's version
|
||||||
pushd "${TEMP_DIR}"
|
|
||||||
|
|
||||||
# Download and uncompress original initrd
|
TEMP_DIR=$(mktemp -d)
|
||||||
wget http://ftp.fr.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
|
pushd "${TEMP_DIR}"
|
||||||
mkdir "${TEMP_DIR}"/mkinitrd
|
|
||||||
pushd "${TEMP_DIR}"/mkinitrd/
|
|
||||||
zcat ../initrd.gz | cpio -iv
|
|
||||||
|
|
||||||
popd
|
# Download and uncompress original initrd
|
||||||
|
wget http://ftp.fr.debian.org/debian/dists/${DISTRO}/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
|
# Download bnx2's firmware and uncompress it
|
||||||
wget http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.43_all.deb
|
wget http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.43_all.deb
|
||||||
dpkg-deb -x firmware-bnx2_0.43_all.deb "${TEMP_DIR}"/mkinitrd
|
dpkg-deb -x firmware-bnx2_0.43_all.deb "${TEMP_DIR}"/mkinitrd
|
||||||
|
|
||||||
# Download tigon(all non-free)'s firmware and uncompress it
|
# 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.43_all.deb
|
wget http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-linux-nonfree_0.43_all.deb
|
||||||
dpkg-deb -x firmware-linux-nonfree_0.43_all.deb "${TEMP_DIR}"/mkinitrd
|
dpkg-deb -x firmware-linux-nonfree_0.43_all.deb "${TEMP_DIR}"/mkinitrd
|
||||||
|
|
||||||
|
|
||||||
# Make a new initrd
|
# Make a new initrd
|
||||||
mv initrd.gz initrd_orig.gz
|
mv initrd.gz initrd_orig.gz
|
||||||
pushd "${TEMP_DIR}"/mkinitrd/
|
pushd "${TEMP_DIR}"/mkinitrd/
|
||||||
find . -print0 | cpio -0 -H newc -ov | gzip -c > ../initrd.gz
|
find . -print0 | cpio -0 -H newc -ov | gzip -c > ../initrd.gz
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Move it to PXE Debian installer
|
# Move it to PXE Debian installer
|
||||||
mv initrd.gz /var/lib/tftpboot/installer/debian/wheezy/amd64/initrd_firm.gz
|
mv initrd.gz /var/lib/tftpboot/installer/debian/${DISTRO}/amd64/initrd_firm.gz
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
# Clean temp file
|
||||||
|
rm -rf "${TEMP_DIR}"
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
# Clean temp file
|
|
||||||
rm -rf "${TEMP_DIR}"
|
|
||||||
|
|
Loading…
Reference in New Issue