Files
vms/distros/fedora-rawhide-x86_64.pkrvars.hcl.sh
T
Greg HellingsandGitHub dea5487a3c Add virtualbox-iso target
Lots of other, small quality of life improvements to build process
Output of build serial console to artifacts upon failure
Reducing verbosity of Packer, now that serial output is captured
Fixed sizing problems with the boot partitions of Ubuntu versions
Use of Mac builders for Virtualbox targets
Updating Ubuntu builders to 22.04, as well
2022-06-08 01:39:37 -05:00

43 lines
1.1 KiB
Bash
Executable File

#!/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}"
links="$(cat "${listing}" | pup 'a[href*=".iso"] attr{href}' | grep dvd)"
iso_name="$(echo "${links}" | grep -e 'iso$')"
iso="${fedora}${iso_name}"
# Read the SHA256 sum value
sums="$(cat "${listing}" | pup 'a[href*="CHECKSUM"] attr{href}')"
until curl -f -L -o "${checksums}" "${fedora}${sums}"; do
sleep 1
done
sha="$(cat "${checksums}" | grep dvd | grep SHA256 | cut -d' ' -f 4)"
# Write out HCL file
cat << EOF > "${name}"
distro = "fedora"
version = "rawhide"
iso = {
url = "${iso}"
checksum = "${sha}"
}
boot_command = [
"<up><tab><bs><bs><bs><bs><bs>",
"edd=off net.ifnames=0 biosdevnames=0 inst.ks=http://{{.HTTPIP}}:{{.HTTPPort}}/fedora/rawhide-x86_64.ks console=ttyS0 <enter><wait>"
]
EOF
rm -r "${tmp}"