bazzite/image-info.sh
RJ Trujillo a30a8f924a feat: Add image info for auto-signing via ublue-update
We use image-info.sh to generate information about the given image at
the time it's built. This replaces our current implementation of
sourcing identifiers written to /etc/default/bazzite
2023-09-22 12:25:59 -06:00

27 lines
604 B
Bash
Executable File

#!/usr/bin/env bash
set -oue pipefail
IMAGE_REF="docker://ghcr.io/$IMAGE_VENDOR/$IMAGE_NAME"
case $FEDORA_MAJOR_VERSION in
38)
IMAGE_TAG="latest"
;;
*)
IMAGE_TAG="$FEDORA_MAJOR_VERSION"
;;
esac
{
echo "{"
echo '"image-name": "'"$IMAGE_NAME"'",'
echo '"image-flavor": "'"$IMAGE_FLAVOR"'",'
echo '"image-vendor": "'"$IMAGE_VENDOR"'",'
echo '"image-ref": "'"$IMAGE_REF"'",'
echo '"image-tag":"'"$IMAGE_TAG"'",'
echo '"base-image-name": "'"$BASE_IMAGE_NAME"'",'
echo '"fedora-version": "'"$FEDORA_MAJOR_VERSION"'"'
echo "}"
} > "/usr/share/ublue-os/image-info.json"