2014-09-08 09:49:55 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This script do the following:
|
2017-06-23 14:49:33 +02:00
|
|
|
# Download Debian Stable (Stretch)
|
|
|
|
# Download Debian Testing (Buster)
|
|
|
|
# Download Debian oldStable (Jessie)
|
|
|
|
# Download Debian oldoldStable (Wheezy)
|
2016-07-29 12:15:03 +02:00
|
|
|
# Download Debian Unstable (Sid)
|
|
|
|
# Make an PXE's config file (aka menu.cfg)
|
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
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2018-02-14 10:25:14 +01:00
|
|
|
DEBIAN_INSTALLER_DIR="${TFTP_DIRECTORY}/installer/debian"
|
|
|
|
DEBIAN_CONFIG_PXE="${DEBIAN_INSTALLER_DIR}/menu.cfg.example"
|
|
|
|
|
|
|
|
# Create directories and config file
|
|
|
|
mkdir -p "${DEBIAN_INSTALLER_DIR}"
|
2018-02-15 16:53:48 +01:00
|
|
|
rm -f "${DEBIAN_CONFIG_PXE}"
|
2018-02-14 10:25:14 +01:00
|
|
|
touch "${DEBIAN_CONFIG_PXE}"
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2017-06-23 14:49:33 +02:00
|
|
|
for DISTRO in stretch buster jessie wheezy sid; do # For ALL Debian's version
|
2016-07-29 15:53:20 +02:00
|
|
|
for ARCH in amd64 i386; do # For all classic architecture
|
2016-07-04 17:05:33 +02:00
|
|
|
|
|
|
|
# Create and go into directory
|
2018-02-14 10:25:14 +01:00
|
|
|
mkdir -p ${DEBIAN_INSTALLER_DIR}/${DISTRO}/${ARCH}
|
2018-02-14 10:56:23 +01:00
|
|
|
pushd ${DEBIAN_INSTALLER_DIR}/${DISTRO}/${ARCH} > /dev/null
|
2016-07-04 17:05:33 +02:00
|
|
|
|
|
|
|
# Download files
|
2018-02-14 10:56:23 +01:00
|
|
|
#wget http://ftp.fr.debian.org/debian/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/debian-installer/${ARCH}/linux -O linux
|
|
|
|
#wget http://ftp.fr.debian.org/debian/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/debian-installer/${ARCH}/initrd.gz -O initrd.gz
|
|
|
|
wget --quiet http://ftp.fr.debian.org/debian/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/debian-installer/${ARCH}/linux -O linux
|
|
|
|
wget --quiet http://ftp.fr.debian.org/debian/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/debian-installer/${ARCH}/initrd.gz -O initrd.gz
|
|
|
|
popd > /dev/null
|
2016-07-04 17:05:33 +02:00
|
|
|
|
|
|
|
# Config file
|
2018-02-14 10:25:14 +01:00
|
|
|
/bin/cat >> "${DEBIAN_CONFIG_PXE}" << EOF
|
2016-07-29 15:53:20 +02:00
|
|
|
label ${DISTRO}${ARCH}
|
|
|
|
menu label Debian GNU/Linux ${DISTRO} ^${ARCH} bits
|
|
|
|
kernel installer/debian/${DISTRO}/${ARCH}/linux
|
|
|
|
append vga=normal initrd=installer/debian/${DISTRO}/${ARCH}/initrd.gz -- quiet
|
2014-09-08 09:49:55 +02:00
|
|
|
EOF
|
2016-07-04 17:05:33 +02:00
|
|
|
done
|
2014-09-08 09:49:55 +02:00
|
|
|
|
2016-07-04 17:05:33 +02:00
|
|
|
# Config file
|
2018-02-14 10:25:14 +01:00
|
|
|
/bin/cat >> "${DEBIAN_CONFIG_PXE}" << EOF
|
2014-09-08 09:49:55 +02:00
|
|
|
label separator
|
2016-07-29 15:53:20 +02:00
|
|
|
menu label ---
|
2014-09-08 09:49:55 +02:00
|
|
|
EOF
|
|
|
|
done
|
|
|
|
|
|
|
|
# Config file
|
2018-02-14 10:25:14 +01:00
|
|
|
/bin/cat >> "${DEBIAN_CONFIG_PXE}" << EOF
|
2014-09-08 09:49:55 +02:00
|
|
|
label mainmenu
|
2016-07-29 15:53:20 +02:00
|
|
|
menu label ^Back...
|
|
|
|
menu exit
|
2014-09-08 09:49:55 +02:00
|
|
|
EOF
|
|
|
|
|
2016-07-04 17:05:33 +02:00
|
|
|
exit 0
|