2014-09-08 09:49:55 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This script do the following:
|
2020-03-17 17:07:32 +01:00
|
|
|
# Download Debian Initrd for Buster, Stretch, Jessie and Sid
|
2014-09-08 09:49:55 +02:00
|
|
|
# Download firmwares:
|
|
|
|
# bnx2
|
|
|
|
# all non-free (for tigon)
|
2020-03-17 17:07:32 +01:00
|
|
|
# Myricom for IBM
|
|
|
|
# qlogic
|
|
|
|
# iwlwifi (Intel WiFi for user's laptop)
|
2014-09-08 09:49:55 +02:00
|
|
|
# Extract all downloaded files
|
2020-03-17 17:07:32 +01:00
|
|
|
# Make a new initrd with the previous firmwares with XZ format
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2018-02-14 10:25:14 +01:00
|
|
|
if command -v in.tftpd > /dev/null; then
|
|
|
|
source /etc/default/tftpd-hpa
|
|
|
|
else
|
|
|
|
TFTP_DIRECTORY="/srv/tftp"
|
|
|
|
fi
|
|
|
|
|
2020-03-17 17:07:32 +01:00
|
|
|
for DISTRO in buster stretch jessie sid; do # For ALL Debian's version
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2016-07-06 14:56:01 +02:00
|
|
|
TEMP_DIR=$(mktemp -d)
|
2018-02-14 10:56:23 +01:00
|
|
|
pushd "${TEMP_DIR}" > /dev/null
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2016-07-06 14:56:01 +02:00
|
|
|
# Download and uncompress original initrd
|
2018-02-14 10:56:23 +01:00
|
|
|
#wget http://ftp.fr.debian.org/debian/dists/${DISTRO}/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
|
|
|
|
wget --quiet http://ftp.fr.debian.org/debian/dists/${DISTRO}/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
|
2016-07-06 14:56:01 +02:00
|
|
|
mkdir "${TEMP_DIR}"/mkinitrd
|
2018-02-14 10:56:23 +01:00
|
|
|
pushd "${TEMP_DIR}"/mkinitrd/ > /dev/null
|
2016-07-06 14:56:01 +02:00
|
|
|
zcat ../initrd.gz | cpio -iv
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2018-02-14 10:56:23 +01:00
|
|
|
popd > /dev/null
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2016-07-06 14:56:01 +02:00
|
|
|
# Download bnx2's firmware and uncompress it
|
2018-02-14 10:56:23 +01:00
|
|
|
#wget http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.43_all.deb
|
|
|
|
wget --quiet http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-bnx2_0.43_all.deb
|
2016-07-06 14:56:01 +02:00
|
|
|
dpkg-deb -x firmware-bnx2_0.43_all.deb "${TEMP_DIR}"/mkinitrd
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2016-07-06 14:56:01 +02:00
|
|
|
# Download tigon(all non-free)'s firmware and uncompress it
|
2018-02-14 10:56:23 +01:00
|
|
|
#wget http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-linux-nonfree_0.43_all.deb
|
|
|
|
wget --quiet http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-linux-nonfree_0.43_all.deb
|
2016-07-06 14:56:01 +02:00
|
|
|
dpkg-deb -x firmware-linux-nonfree_0.43_all.deb "${TEMP_DIR}"/mkinitrd
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2016-07-06 17:46:18 +02:00
|
|
|
# Download myricom for IBM
|
2018-02-14 10:56:23 +01:00
|
|
|
#wget http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-myricom_0.43_all.deb
|
|
|
|
wget --quiet http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-myricom_0.43_all.deb
|
2017-12-01 14:17:25 +01:00
|
|
|
dpkg-deb -x firmware-myricom_0.43_all.deb "${TEMP_DIR}"/mkinitrd
|
2016-07-06 17:46:18 +02:00
|
|
|
|
|
|
|
# Download qlogic
|
2018-02-14 10:56:23 +01:00
|
|
|
#wget http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-qlogic_0.43_all.deb
|
|
|
|
wget --quiet http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-qlogic_0.43_all.deb
|
2017-12-01 14:17:25 +01:00
|
|
|
dpkg-deb -x firmware-qlogic_0.43_all.deb "${TEMP_DIR}"/mkinitrd
|
|
|
|
|
|
|
|
# Download iwlwifi
|
2020-01-10 10:01:40 +01:00
|
|
|
#wget --quiet http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-iwlwifi_20170823-1_all.deb -O firmware-iwlwifi_all.deb
|
|
|
|
wget --quiet http://ftp.fr.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-iwlwifi_20190717-2_all.deb -O firmware-iwlwifi_all.deb
|
2017-12-01 14:17:25 +01:00
|
|
|
dpkg-deb -x firmware-iwlwifi_all.deb "${TEMP_DIR}"/mkinitrd
|
2016-07-06 17:46:18 +02:00
|
|
|
|
2016-07-06 14:56:01 +02:00
|
|
|
# Make a new initrd
|
|
|
|
mv initrd.gz initrd_orig.gz
|
2018-02-14 10:56:23 +01:00
|
|
|
pushd "${TEMP_DIR}"/mkinitrd/ > /dev/null
|
2020-01-10 10:02:54 +01:00
|
|
|
find . | cpio --quiet -o -H newc | xz -c -9 --check=crc32 > ../initrd.xz
|
2018-02-14 10:56:23 +01:00
|
|
|
popd > /dev/null
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2016-07-06 14:56:01 +02:00
|
|
|
# Move it to PXE Debian installer
|
2018-02-14 10:25:14 +01:00
|
|
|
mkdir -p ${TFTP_DIRECTORY}/installer/debian/${DISTRO}/amd64/
|
2020-01-10 10:02:54 +01:00
|
|
|
mv initrd.xz ${TFTP_DIRECTORY}/installer/debian/${DISTRO}/amd64/initrd_firm.xz
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2018-02-14 10:56:23 +01:00
|
|
|
popd > /dev/null
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2016-07-06 14:56:01 +02:00
|
|
|
# Clean temp file
|
|
|
|
rm -rf "${TEMP_DIR}"
|
2015-05-08 19:25:24 +02:00
|
|
|
|
|
|
|
done
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2016-07-06 14:56:01 +02:00
|
|
|
exit 0
|