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

48 lines
1.1 KiB
Bash
Raw Normal View History

2024-04-16 14:21:00 -05:00
#!env bash
2022-06-01 10:35:22 -05:00
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>",
2024-07-13 01:33:27 -05:00
"net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/amd64-ks.cfg inst.notmux <f10>"
2023-08-11 20:15:50 -05:00
]
cd_files = [
2023-12-30 05:37:32 +00:00
"distros/fedora/rawhide/*.cfg"
2022-06-01 10:35:22 -05:00
]
2024-01-09 22:31:00 -06:00
vbox_os_type = "Fedora_64"
2022-06-01 10:35:22 -05:00
EOF
rm -r "${tmp}"
2024-04-16 14:21:00 -05:00
rm -f "cache/${iso_name}"