Files
vms/distros/fedora/rawhide/amd64.pkrvars.hcl.sh
T

46 lines
1.1 KiB
Bash
Raw Normal View History

2022-06-01 10:35:22 -05:00
#!/usr/bin/env bash
set -exo pipefail
# Name of the file to write out
name="${0%.sh}"
# Base URL
fedora=https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Server/x86_64/iso/
# Working directory
tmp="$(mktemp -d)"
listing="${tmp}/listing.html"
checksums="${tmp}/checksums"
# First, find the proper URL, since it updates every build
curl -L -o "${listing}" "${fedora}"
2023-12-06 08:21:32 -08:00
links="$(pup -f "${listing}" 'a[href*=".iso"] attr{href}' | grep dvd)"
iso_name="$(echo "${links}" | grep -e 'iso$' | head -1)"
2022-06-01 10:35:22 -05:00
iso="${fedora}${iso_name}"
# Read the SHA256 sum value
2023-12-06 08:21:32 -08:00
sums="$(pup -f "${listing}" 'a[href*="CHECKSUM"] attr{href}' | head -1)"
2022-06-01 10:35:22 -05:00
until curl -f -L -o "${checksums}" "${fedora}${sums}"; do
sleep 1
done
2023-12-06 08:21:32 -08:00
sha="$(grep -e dvd "${checksums}" | grep SHA256 | cut -d' ' -f 4)"
2022-06-01 10:35:22 -05:00
# Write out HCL file
cat << EOF > "${name}"
distro = "fedora"
version = "rawhide"
iso = {
url = "${iso}"
checksum = "${sha}"
}
boot_command = [
2022-06-22 10:00:04 -05:00
"<up>e<down><down><end><bs><bs><bs><bs><bs>",
2023-08-11 20:15:50 -05:00
"net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/x86_64.ks console=tty0 console=ttyS0<f10>"
]
cd_files = [
"distros/fedora/rawhide/*.ks"
2022-06-01 10:35:22 -05:00
]
EOF
rm -r "${tmp}"