pxe: fix logic on tftp live parts

This commit is contained in:
pedro 2024-09-25 09:43:11 -03:00
parent 2a0f9371e1
commit 3113a3f9c2
1 changed files with 8 additions and 9 deletions

View File

@ -44,13 +44,14 @@ END
} }
extract_live_parts_for_tftp() { extract_live_parts_for_tftp() {
if [ ! -f /tmp/live.iso ]; then
# src https://www.debian.org/CD/faq/#newest # src https://www.debian.org/CD/faq/#newest
DEBIAN_VERSION="$(wget https://www.debian.org/CD/ -O- \ DEBIAN_VERSION="$(wget https://www.debian.org/CD/ -O- \
| grep -o '<strong>[0-9.]*</strong>' \ | grep -o '<strong>[0-9.]*</strong>' \
| grep -o '[0-9.]*')" | grep -o '[0-9.]*')"
url="https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-${DEBIAN_VERSION}-amd64-standard.iso" url="https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-${DEBIAN_VERSION}-amd64-standard.iso"
wget "${url}" -O /tmp/live.iso wget "${url}" -O /tmp/live.iso
fi
mount -o loop live.iso /mnt/ mount -o loop live.iso /mnt/
cp /mnt/live/vmlinuz "${tftp_path}/vmlinuz-live" cp /mnt/live/vmlinuz "${tftp_path}/vmlinuz-live"
cp /mnt/live/initrd.img "${tftp_path}/initrd-live.img" cp /mnt/live/initrd.img "${tftp_path}/initrd-live.img"
@ -62,9 +63,7 @@ install_netboot() {
if [ ! -d "${tftp_path}" ] || [ "${FORCE:-}" ]; then if [ ! -d "${tftp_path}" ] || [ "${FORCE:-}" ]; then
mkdir -p "${tftp_path}" mkdir -p "${tftp_path}"
cd "${tftp_path}" cd "${tftp_path}"
if [ -f /tmp/live.iso ]; then
extract_live_parts_for_tftp extract_live_parts_for_tftp
fi
cat > "${tftp_path}/pxelinux.cfg/default" <<END cat > "${tftp_path}/pxelinux.cfg/default" <<END
default wb default wb