Files
matchbox/scripts/get-fedora-coreos
Dalton Hubble d081cf30d3 Update Fedora CoreOS examples for 33.20210117.3.2
* Update Fedora CoreOS live PXE and disk install examples to
Fedora 33
* Increase libvirt VM memory from 2GB to 3GB to support live
PXE example, which is mostly just for laptop examples/demos.
Reduce the VM count from 3 to 2 to compensate.
* Change `fedora-coreos.ign` to suggest using an ed25519 SSH
key since Fedora CoreOS 33 disables RSA SHA1 (256 is still ok
but most people won't know which they have)
2021-02-16 21:11:55 -08:00

44 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# USAGE: ./scripts/get-fedora-coreos
# USAGE: ./scripts/get-fedora-coreos stream version dest
#
set -eou pipefail
STREAM=${1:-"stable"}
VERSION=${2:-"33.20210117.3.2"}
DEST_DIR=${3:-"$PWD/examples/assets"}
DEST=$DEST_DIR/fedora-coreos
BASE_URL=https://builds.coreos.fedoraproject.org/prod/streams/$STREAM/builds/$VERSION/x86_64
# check stream/version exist based on the header response
if ! curl -s -I $BASE_URL/fedora-coreos-$VERSION-metal.x86_64.raw.xz | grep -q -E '^HTTP/[0-9.]+ [23][0-9][0-9]' ; then
echo "Stream or Version not found"
exit 1
fi
if [ ! -d "$DEST" ]; then
echo "Creating directory $DEST"
mkdir -p $DEST
fi
echo "Downloading Fedora CoreOS $STREAM $VERSION images to $DEST"
# PXE kernel
echo "fedora-coreos-$VERSION-live-kernel-x86_64"
curl -# $BASE_URL/fedora-coreos-$VERSION-live-kernel-x86_64 -o $DEST/fedora-coreos-$VERSION-live-kernel-x86_64
# PXE initrd
echo "fedora-coreos-$VERSION-live-initramfs.x86_64.img"
curl -# $BASE_URL/fedora-coreos-$VERSION-live-initramfs.x86_64.img -o $DEST/fedora-coreos-$VERSION-live-initramfs.x86_64.img
# rootfs
echo "fedora-coreos-$VERSION-live-rootfs.x86_64.img"
curl -# $BASE_URL/fedora-coreos-$VERSION-live-rootfs.x86_64.img -o $DEST/fedora-coreos-$VERSION-live-rootfs.x86_64.img
# Install image
echo "fedora-coreos-$VERSION-metal.x86_64.raw.xz"
curl -# $BASE_URL/fedora-coreos-$VERSION-metal.x86_64.raw.xz -o $DEST/fedora-coreos-$VERSION-metal.x86_64.raw.xz
echo "fedora-coreos-$VERSION-metal.x86_64.raw.xz.sig"
curl -# $BASE_URL/fedora-coreos-$VERSION-metal.x86_64.raw.xz.sig -o $DEST/fedora-coreos-$VERSION-metal.x86_64.raw.xz.sig