From 15de039c3bee68e2b1e0eba6416ded23cc26d2b0 Mon Sep 17 00:00:00 2001 From: Tulip Blossom Date: Wed, 8 Jan 2025 21:26:12 -0300 Subject: feat: add justfile pattern from M2's PRs to bluefin (#54) --- Justfile | 203 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 Justfile (limited to 'Justfile') diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..6608d89 --- /dev/null +++ b/Justfile @@ -0,0 +1,203 @@ +export repo_organization := env("GITHUB_REPOSITORY_OWNER", "yourname") +export image_name := env("IMAGE_NAME", "yourimage") +export default_tag := env("DEFAULT_TAG", "latest") +export bib_image := env("BIB_IMAGE", "ghcr.io/osbuild/bootc-image-builder:latest") + +export SUDO_DISPLAY := if `if [ -n "${DISPLAY:-}" ] || [ -n "${WAYLAND_DISPLAY:-}" ]; then echo true; fi` == "true" { "true" } else { "false" } +export SUDOIF := if `id -u` == "0" { "" } else { if SUDO_DISPLAY == "true" { "sudo --askpass" } else { "sudo" } } +export PODMAN := if path_exists("/usr/bin/podman") == "true" { env("PODMAN", "/usr/bin/podman") } else { if path_exists("/usr/bin/docker") == "true" { env("PODMAN", "docker") } else { env("PODMAN", "exit 1 ; ") } } + +alias build-vm := build-qcow2 +alias rebuild-vm := rebuild-qcow2 +alias run-vm := run-vm-qcow2 + +[private] +default: + @just --list + +# Check Just Syntax +[group('Just')] +check: + #!/usr/bin/bash + find . -type f -name "*.just" | while read -r file; do + echo "Checking syntax: $file" + just --unstable --fmt --check -f $file + done + echo "Checking syntax: Justfile" + just --unstable --fmt --check -f Justfile + +# Fix Just Syntax +[group('Just')] +fix: + #!/usr/bin/bash + find . -type f -name "*.just" | while read -r file; do + echo "Checking syntax: $file" + just --unstable --fmt -f $file + done + echo "Checking syntax: Justfile" + just --unstable --fmt -f Justfile || { exit 1; } + +# Clean Repo +[group('Utility')] +clean: + #!/usr/bin/bash + set -eoux pipefail + touch _build + find *_build* -exec rm -rf {} \; + rm -f previous.manifest.json + rm -f changelog.md + rm -f output.env + +# Sudo Clean Repo +[group('Utility')] +[private] +sudo-clean: + ${SUDOIF} just clean + +build $target_image=image_name $tag=default_tag: + #!/usr/bin/env bash + + # Get Version + ver="${tag}-$(date +%Y%m%d)" + + BUILD_ARGS=() + BUILD_ARGS+=("--build-arg" "IMAGE_NAME=${image_name}") + BUILD_ARGS+=("--build-arg" "IMAGE_VENDOR=${repo_organization}") + if [[ -z "$(git status -s)" ]]; then + BUILD_ARGS+=("--build-arg" "SHA_HEAD_SHORT=$(git rev-parse --short HEAD)") + fi + + ${PODMAN} build \ + "${BUILD_ARGS[@]}" \ + --pull=newer \ + --tag "${image_name}:${tag}" \ + . + +_rootful_load_image $target_image=image_name $tag=default_tag: + #!/usr/bin/bash + set -eoux pipefail + + if [[ -n "${SUDO_USER:-}" || "${UID}" -eq "0" ]]; then + echo "Already root or running under sudo, no need to load image from user ${PODMAN}." + exit 0 + fi + + set +e + resolved_tag=$(${PODMAN} inspect -t image "${target_image}:${tag}" | jq -r '.[].RepoTags.[0]') + return_code=$? + set -e + + if [[ $return_code -eq 0 ]]; then + # Load into Rootful ${PODMAN} + ID=$(${SUDOIF} ${PODMAN} images --filter reference="${target_image}:${tag}" --format "'{{ '{{.ID}}' }}'") + if [[ -z "$ID" ]]; then + COPYTMP=$(mktemp -p "${PWD}" -d -t _build_podman_scp.XXXXXXXXXX) + ${SUDOIF} TMPDIR=${COPYTMP} ${PODMAN} image scp ${UID}@localhost::"${target_image}:${tag}" root@localhost::"${target_image}:${tag}" + rm -rf "${COPYTMP}" + fi + else + # Make sure the image is present and/or up to date + ${SUDOIF} ${PODMAN} pull "${target_image}:${tag}" + fi + +_build-bib $target_image $tag $type $config: (_rootful_load_image target_image tag) + #!/usr/bin/env bash + set -euo pipefail + + mkdir -p "output" + + echo "Cleaning up previous build" + if [[ $type == iso ]]; then + sudo rm -rf "output/bootiso" || true + else + sudo rm -rf "output/${type}" || true + fi + + args="--type ${type}" + + if [[ $target_image == localhost/* ]]; then + args+=" --local" + fi + + sudo ${PODMAN} run \ + --rm \ + -it \ + --privileged \ + --pull=newer \ + --net=host \ + --security-opt label=type:unconfined_t \ + -v $(pwd)/${config}:/config.toml:ro \ + -v $(pwd)/output:/output \ + -v /var/lib/containers/storage:/var/lib/containers/storage \ + "${bib_image}" \ + ${args} \ + "${target_image}" + + sudo chown -R $USER:$USER output + +_rebuild-bib $target_image $tag $type $config: (build target_image tag) && (_build-bib target_image tag type config) + +[group('Build Virtual Machine Image')] +build-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "qcow2" "image.toml") + +[group('Build Virtual Machine Image')] +build-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "raw" "image.toml") + +[group('Build Virtual Machine Image')] +build-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "iso" "iso.toml") + +[group('Build Virtual Machine Image')] +rebuild-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "qcow2" "image.toml") + +[group('Build Virtual Machine Image')] +rebuild-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "raw" "image.toml") + +[group('Build Virtual Machine Image')] +rebuild-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "iso" "iso.toml") + +_run-vm $target_image $tag $type $config: + #!/usr/bin/bash + set -eoux pipefail + + image_file="output/${type}/disk.${type}" + + if [[ $type == iso ]]; then + image_file="output/bootiso/install.iso" + fi + + if [[ ! -f "${image_file}" ]]; then + just "build-${type}" "$target_image" "$tag" + fi + + # Determine which port to use + port=8006; + while grep -q :${port} <<< $(ss -tunalp); do + port=$(( port + 1 )) + done + echo "Using Port: ${port}" + echo "Connect to http://localhost:${port}" + run_args=() + run_args+=(--rm --privileged) + run_args+=(--pull=newer) + run_args+=(--publish "127.0.0.1:${port}:8006") + run_args+=(--env "CPU_CORES=4") + run_args+=(--env "RAM_SIZE=8G") + run_args+=(--env "DISK_SIZE=64G") + # run_args+=(--env "BOOT_MODE=windows_secure") + run_args+=(--env "TPM=Y") + run_args+=(--env "GPU=Y") + run_args+=(--device=/dev/kvm) + run_args+=(--volume "${PWD}/${image_file}":"/boot.${type}") + run_args+=(docker.io/qemux/qemu-docker) + ${PODMAN} run "${run_args[@]}" & + xdg-open http://localhost:${port} + fg "%${PODMAN}" + +[group('Run Virtual Machine')] +run-vm-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "qcow2" "image-builder.config.toml") + +[group('Run Virtual Machine')] +run-vm-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "raw" "image-builder.config.toml") + +[group('Run Virtual Machine')] +run-vm-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "iso" "image-builder-iso.config.toml") -- cgit v1.2.3 From 10d65d36d6153495311750ab3ce6e9125214d148 Mon Sep 17 00:00:00 2001 From: Tulip Blossom Date: Wed, 8 Jan 2025 21:56:59 -0300 Subject: fix: incorrect URL for bib image on justfile (#55) --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 6608d89..f69b5a7 100644 --- a/Justfile +++ b/Justfile @@ -1,7 +1,7 @@ export repo_organization := env("GITHUB_REPOSITORY_OWNER", "yourname") export image_name := env("IMAGE_NAME", "yourimage") export default_tag := env("DEFAULT_TAG", "latest") -export bib_image := env("BIB_IMAGE", "ghcr.io/osbuild/bootc-image-builder:latest") +export bib_image := env("BIB_IMAGE", "quay.io/centos-bootc/bootc-image-builder:latest") export SUDO_DISPLAY := if `if [ -n "${DISPLAY:-}" ] || [ -n "${WAYLAND_DISPLAY:-}" ]; then echo true; fi` == "true" { "true" } else { "false" } export SUDOIF := if `id -u` == "0" { "" } else { if SUDO_DISPLAY == "true" { "sudo --askpass" } else { "sudo" } } -- cgit v1.2.3 From 1e80660a8f16e491253514bfd23003d7710bf47b Mon Sep 17 00:00:00 2001 From: Tulip Blossom Date: Sun, 26 Jan 2025 12:44:41 -0300 Subject: fix: default btrfs filesystem for image (#62) * fix: ensure librepo is being used and default btrfs filesystem for image * fix --- Justfile | 1 + 1 file changed, 1 insertion(+) (limited to 'Justfile') diff --git a/Justfile b/Justfile index f69b5a7..d718b0a 100644 --- a/Justfile +++ b/Justfile @@ -130,6 +130,7 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t -v $(pwd)/output:/output \ -v /var/lib/containers/storage:/var/lib/containers/storage \ "${bib_image}" \ + --rootfs btrfs \ ${args} \ "${target_image}" -- cgit v1.2.3 From a4833543c88aa3fa791302666cafe72b12d57735 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Wed, 12 Mar 2025 22:07:17 +0530 Subject: Fix: Update Justfile (#76) * Fix: Update Justfile Updated to match the Bluefin LTS one. Stripped the iso customizations stuff * fix: update Containerfile ublue-os/silverblue-main:latest shouldn't be the default --- Justfile | 205 +++++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 167 insertions(+), 38 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index d718b0a..4315601 100644 --- a/Justfile +++ b/Justfile @@ -1,12 +1,10 @@ export repo_organization := env("GITHUB_REPOSITORY_OWNER", "yourname") export image_name := env("IMAGE_NAME", "yourimage") +export centos_version := env("CENTOS_VERSION", "stream10") +export fedora_version := env("CENTOS_VERSION", "41") export default_tag := env("DEFAULT_TAG", "latest") export bib_image := env("BIB_IMAGE", "quay.io/centos-bootc/bootc-image-builder:latest") -export SUDO_DISPLAY := if `if [ -n "${DISPLAY:-}" ] || [ -n "${WAYLAND_DISPLAY:-}" ]; then echo true; fi` == "true" { "true" } else { "false" } -export SUDOIF := if `id -u` == "0" { "" } else { if SUDO_DISPLAY == "true" { "sudo --askpass" } else { "sudo" } } -export PODMAN := if path_exists("/usr/bin/podman") == "true" { env("PODMAN", "/usr/bin/podman") } else { if path_exists("/usr/bin/docker") == "true" { env("PODMAN", "docker") } else { env("PODMAN", "exit 1 ; ") } } - alias build-vm := build-qcow2 alias rebuild-vm := rebuild-qcow2 alias run-vm := run-vm-qcow2 @@ -52,54 +50,136 @@ clean: [group('Utility')] [private] sudo-clean: - ${SUDOIF} just clean + just sudoif just clean -build $target_image=image_name $tag=default_tag: +# sudoif bash function +[group('Utility')] +[private] +sudoif command *args: + #!/usr/bin/bash + function sudoif(){ + if [[ "${UID}" -eq 0 ]]; then + "$@" + elif [[ "$(command -v sudo)" && -n "${SSH_ASKPASS:-}" ]] && [[ -n "${DISPLAY:-}" || -n "${WAYLAND_DISPLAY:-}" ]]; then + /usr/bin/sudo --askpass "$@" || exit 1 + elif [[ "$(command -v sudo)" ]]; then + /usr/bin/sudo "$@" || exit 1 + else + exit 1 + fi + } + sudoif {{ command }} {{ args }} + +# This Justfile recipe builds a container image using Podman. +# +# Arguments: +# $target_image - The tag you want to apply to the image (default: aurora). +# $tag - The tag for the image (default: lts). +# $dx - Enable DX (default: "0"). +# $hwe - Enable HWE (default: "0"). +# $gdx - Enable GDX (default: "0"). +# +# DX: +# Developer Experience (DX) is a feature that allows you to install the latest developer tools for your system. +# Packages include VScode, Docker, Distrobox, and more. +# HWE: +# Hardware Enablement (HWE) is a feature that allows you to install the latest hardware support for your system. +# Currently this install the Hyperscale SIG kernel which will stay ahead of the CentOS Stream kernel and enables btrfs +# GDX: https://docs.projectaurora.io/gdx/ +# GPU Developer Experience (GDX) creates a base as an AI and Graphics platform. +# Installs Nvidia drivers, CUDA, and other tools. +# +# The script constructs the version string using the tag and the current date. +# If the git working directory is clean, it also includes the short SHA of the current HEAD. +# +# just build $target_image $tag $dx $hwe $gdx +# +# Example usage: +# just build aurora lts 1 0 1 +# +# This will build an image 'aurora:lts' with DX and GDX enabled. +# + +# Build the image using the specified parameters +build $target_image=image_name $tag=default_tag $dx="0" $hwe="0" $gdx="0": #!/usr/bin/env bash # Get Version - ver="${tag}-$(date +%Y%m%d)" + ver="${tag}-${centos_version}.$(date +%Y%m%d)" BUILD_ARGS=() + BUILD_ARGS+=("--build-arg" "MAJOR_VERSION=${centos_version}") BUILD_ARGS+=("--build-arg" "IMAGE_NAME=${image_name}") BUILD_ARGS+=("--build-arg" "IMAGE_VENDOR=${repo_organization}") + BUILD_ARGS+=("--build-arg" "ENABLE_DX=${dx}") + BUILD_ARGS+=("--build-arg" "ENABLE_HWE=${hwe}") + BUILD_ARGS+=("--build-arg" "ENABLE_GDX=${gdx}") if [[ -z "$(git status -s)" ]]; then BUILD_ARGS+=("--build-arg" "SHA_HEAD_SHORT=$(git rev-parse --short HEAD)") fi - ${PODMAN} build \ + podman build \ "${BUILD_ARGS[@]}" \ --pull=newer \ - --tag "${image_name}:${tag}" \ + --tag "${target_image}:${tag}" \ . +# Command: _rootful_load_image +# Description: This script checks if the current user is root or running under sudo. If not, it attempts to resolve the image tag using podman inspect. +# If the image is found, it loads it into rootful podman. If the image is not found, it pulls it from the repository. +# +# Parameters: +# $target_image - The name of the target image to be loaded or pulled. +# $tag - The tag of the target image to be loaded or pulled. Default is 'default_tag'. +# +# Example usage: +# _rootful_load_image my_image latest +# +# Steps: +# 1. Check if the script is already running as root or under sudo. +# 2. Check if target image is in the non-root podman container storage) +# 3. If the image is found, load it into rootful podman using podman scp. +# 4. If the image is not found, pull it from the remote repository into reootful podman. + _rootful_load_image $target_image=image_name $tag=default_tag: #!/usr/bin/bash set -eoux pipefail + # Check if already running as root or under sudo if [[ -n "${SUDO_USER:-}" || "${UID}" -eq "0" ]]; then - echo "Already root or running under sudo, no need to load image from user ${PODMAN}." + echo "Already root or running under sudo, no need to load image from user podman." exit 0 fi + # Try to resolve the image tag using podman inspect set +e - resolved_tag=$(${PODMAN} inspect -t image "${target_image}:${tag}" | jq -r '.[].RepoTags.[0]') + resolved_tag=$(podman inspect -t image "${target_image}:${tag}" | jq -r '.[].RepoTags.[0]') return_code=$? set -e if [[ $return_code -eq 0 ]]; then - # Load into Rootful ${PODMAN} - ID=$(${SUDOIF} ${PODMAN} images --filter reference="${target_image}:${tag}" --format "'{{ '{{.ID}}' }}'") + # If the image is found, load it into rootful podman + ID=$(just sudoif podman images --filter reference="${target_image}:${tag}" --format "'{{ '{{.ID}}' }}'") if [[ -z "$ID" ]]; then + # If the image ID is not found, copy the image from user podman to root podman COPYTMP=$(mktemp -p "${PWD}" -d -t _build_podman_scp.XXXXXXXXXX) - ${SUDOIF} TMPDIR=${COPYTMP} ${PODMAN} image scp ${UID}@localhost::"${target_image}:${tag}" root@localhost::"${target_image}:${tag}" + just sudoif TMPDIR=${COPYTMP} podman image scp ${UID}@localhost::"${target_image}:${tag}" root@localhost::"${target_image}:${tag}" rm -rf "${COPYTMP}" fi else - # Make sure the image is present and/or up to date - ${SUDOIF} ${PODMAN} pull "${target_image}:${tag}" + # If the image is not found, pull it from the repository + just sudoif podman pull "${target_image}:${tag}" fi +# Build a bootc bootable image using Bootc Image Builder (BIB) +# Converts a container image to a bootable image +# Parameters: +# target_image: The name of the image to build (ex. localhost/fedora) +# tag: The tag of the image to build (ex. latest) +# type: The type of image to build (ex. qcow2, raw, iso) +# config: The configuration file to use for the build (default: image.toml) + +# Example: just _rebuild-bib localhost/fedora latest qcow2 image.toml _build-bib $target_image $tag $type $config: (_rootful_load_image target_image tag) #!/usr/bin/env bash set -euo pipefail @@ -113,13 +193,14 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t sudo rm -rf "output/${type}" || true fi - args="--type ${type}" + args="--type ${type} " + args+="--use-librepo=True" if [[ $target_image == localhost/* ]]; then args+=" --local" fi - sudo ${PODMAN} run \ + sudo podman run \ --rm \ -it \ --privileged \ @@ -130,53 +211,70 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t -v $(pwd)/output:/output \ -v /var/lib/containers/storage:/var/lib/containers/storage \ "${bib_image}" \ - --rootfs btrfs \ ${args} \ - "${target_image}" + "${target_image}:${tag}" sudo chown -R $USER:$USER output +# Podman builds the image from the Containerfile and creates a bootable image +# Parameters: +# target_image: The name of the image to build (ex. localhost/fedora) +# tag: The tag of the image to build (ex. latest) +# type: The type of image to build (ex. qcow2, raw, iso) +# config: The configuration file to use for the build (deafult: image.toml) + +# Example: just _rebuild-bib localhost/fedora latest qcow2 image.toml _rebuild-bib $target_image $tag $type $config: (build target_image tag) && (_build-bib target_image tag type config) -[group('Build Virtual Machine Image')] +# Build a QCOW2 virtual machine image +[group('Build Virtal Machine Image')] build-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "qcow2" "image.toml") -[group('Build Virtual Machine Image')] +# Build a RAW virtual machine image +[group('Build Virtal Machine Image')] build-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "raw" "image.toml") -[group('Build Virtual Machine Image')] +# Build an ISO virtual machine image +[group('Build Virtal Machine Image')] build-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "iso" "iso.toml") -[group('Build Virtual Machine Image')] +# Rebuild a QCOW2 virtual machine image +[group('Build Virtal Machine Image')] rebuild-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "qcow2" "image.toml") -[group('Build Virtual Machine Image')] +# Rebuild a RAW virtual machine image +[group('Build Virtal Machine Image')] rebuild-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "raw" "image.toml") -[group('Build Virtual Machine Image')] +# Rebuild an ISO virtual machine image +[group('Build Virtal Machine Image')] rebuild-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "iso" "iso.toml") +# Run a virtual machine with the specified image type and configuration _run-vm $target_image $tag $type $config: #!/usr/bin/bash set -eoux pipefail + # Determine the image file based on the type image_file="output/${type}/disk.${type}" - if [[ $type == iso ]]; then image_file="output/bootiso/install.iso" fi + # Build the image if it does not exist if [[ ! -f "${image_file}" ]]; then just "build-${type}" "$target_image" "$tag" fi - # Determine which port to use - port=8006; + # Determine an available port to use + port=8006 while grep -q :${port} <<< $(ss -tunalp); do port=$(( port + 1 )) done echo "Using Port: ${port}" echo "Connect to http://localhost:${port}" + + # Set up the arguments for running the VM run_args=() run_args+=(--rm --privileged) run_args+=(--pull=newer) @@ -184,21 +282,52 @@ _run-vm $target_image $tag $type $config: run_args+=(--env "CPU_CORES=4") run_args+=(--env "RAM_SIZE=8G") run_args+=(--env "DISK_SIZE=64G") - # run_args+=(--env "BOOT_MODE=windows_secure") run_args+=(--env "TPM=Y") run_args+=(--env "GPU=Y") run_args+=(--device=/dev/kvm) run_args+=(--volume "${PWD}/${image_file}":"/boot.${type}") run_args+=(docker.io/qemux/qemu-docker) - ${PODMAN} run "${run_args[@]}" & + + # Run the VM and open the browser to connect + podman run "${run_args[@]}" & xdg-open http://localhost:${port} - fg "%${PODMAN}" + fg "%podman" + +# Run a virtual machine from a QCOW2 image +[group('Run Virtal Machine')] +run-vm-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "qcow2" "image.toml") + +# Run a virtual machine from a RAW image +[group('Run Virtal Machine')] +run-vm-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "raw" "image.toml") + +# Run a virtual machine from an ISO +[group('Run Virtal Machine')] +run-vm-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "iso" "iso.toml") + +# Run a virtual machine using systemd-vmspawn +[group('Run Virtal Machine')] +spawn-vm rebuild="0" type="qcow2" ram="6G": + #!/usr/bin/env bash + + set -euo pipefail + + [ "{{ rebuild }}" -eq 1 ] && echo "Rebuilding the ISO" && just build-vm {{ rebuild }} {{ type }} + + systemd-vmspawn \ + -M "bootc-image" \ + --console=gui \ + --cpus=2 \ + --ram=$(echo {{ ram }}| /usr/bin/numfmt --from=iec) \ + --network-user-mode \ + --vsock=false --pass-ssh-key=false \ + -i ./output/**/*.{{ type }} -[group('Run Virtual Machine')] -run-vm-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "qcow2" "image-builder.config.toml") -[group('Run Virtual Machine')] -run-vm-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "raw" "image-builder.config.toml") +# Runs shell check on all Bash scripts +lint: + /usr/bin/find . -iname "*.sh" -type f -exec shellcheck "{}" ';' -[group('Run Virtual Machine')] -run-vm-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "iso" "image-builder-iso.config.toml") +# Runs shfmt on all Bash scripts +format: + /usr/bin/find . -iname "*.sh" -type f -exec shfmt --write "{}" ';' -- cgit v1.2.3 From 59c13c995848795495dd44039b76433849e79bb2 Mon Sep 17 00:00:00 2001 From: Nathan Ellenfield Date: Fri, 14 Mar 2025 17:26:44 -0400 Subject: fix: Justfile variable usage and formatting (#65) Co-authored-by: Tulip Blossom --- Justfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 4315601..ff51345 100644 --- a/Justfile +++ b/Justfile @@ -109,7 +109,7 @@ build $target_image=image_name $tag=default_tag $dx="0" $hwe="0" $gdx="0": BUILD_ARGS=() BUILD_ARGS+=("--build-arg" "MAJOR_VERSION=${centos_version}") - BUILD_ARGS+=("--build-arg" "IMAGE_NAME=${image_name}") + BUILD_ARGS+=("--build-arg" "IMAGE_NAME=${target_image}") BUILD_ARGS+=("--build-arg" "IMAGE_VENDOR=${repo_organization}") BUILD_ARGS+=("--build-arg" "ENABLE_DX=${dx}") BUILD_ARGS+=("--build-arg" "ENABLE_HWE=${hwe}") @@ -188,16 +188,16 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t echo "Cleaning up previous build" if [[ $type == iso ]]; then - sudo rm -rf "output/bootiso" || true + sudo rm -rf "output/bootiso" || true else - sudo rm -rf "output/${type}" || true + sudo rm -rf "output/${type}" || true fi args="--type ${type} " args+="--use-librepo=True" if [[ $target_image == localhost/* ]]; then - args+=" --local" + args+=" --local" fi sudo podman run \ -- cgit v1.2.3 From 007130fe49f5497f299765b0e479eb1ee1d27435 Mon Sep 17 00:00:00 2001 From: R0flcopt3r <12752060+R0flcopt3r@users.noreply.github.com> Date: Sun, 16 Mar 2025 18:33:49 +0100 Subject: fix: _rootful_load_image would not copy if the user image was different (#88) Co-authored-by: Eirik O. Lavik --- Justfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index ff51345..f12166c 100644 --- a/Justfile +++ b/Justfile @@ -157,11 +157,13 @@ _rootful_load_image $target_image=image_name $tag=default_tag: return_code=$? set -e + USER_IMG_ID=$(podman images --filter reference="${target_image}:${tag}" --format "'{{ '{{.ID}}' }}'") + if [[ $return_code -eq 0 ]]; then # If the image is found, load it into rootful podman ID=$(just sudoif podman images --filter reference="${target_image}:${tag}" --format "'{{ '{{.ID}}' }}'") - if [[ -z "$ID" ]]; then - # If the image ID is not found, copy the image from user podman to root podman + if [[ "$ID" != "$USER_IMG_ID" ]]; then + # If the image ID is not found or different from user, copy the image from user podman to root podman COPYTMP=$(mktemp -p "${PWD}" -d -t _build_podman_scp.XXXXXXXXXX) just sudoif TMPDIR=${COPYTMP} podman image scp ${UID}@localhost::"${target_image}:${tag}" root@localhost::"${target_image}:${tag}" rm -rf "${COPYTMP}" -- cgit v1.2.3 From 2f0632547afb6fb48442820ed755b7a1f64e5d40 Mon Sep 17 00:00:00 2001 From: R0flcopt3r <12752060+R0flcopt3r@users.noreply.github.com> Date: Mon, 17 Mar 2025 01:15:55 +0100 Subject: feat: build in tempdir and move files on success (#82) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: build in tempdir and move files on success Before it would delete your outputs before starting the build. That means miss-typing the command for example could lead to losing data. This also creates separate folders for each type to avoid collision. * fix: tempdir naming this follows the convention set in the `_rootful_load_image` target. * fix: delete output folder in clean target * fix: move contents of temp build directory This ensures a flatter folder structure, bib allready seem to ensure there aren't any file name collisions. output folder would look like this after building a raw and qcow2. output ├── image │   └── disk.raw ├── manifest-qcow2.json ├── manifest-raw.json └── qcow2 └── disk.qcow2 * fix: overwrite previous output directory From conversations in https://github.com/ublue-os/image-template/pull/82 this is the wanted behaviour for this project. * revert: overwrite previous output directory This reverts commit 75448d72fa624cea01524d5651c926ae772460bf. * chore(gitignore): ensure build directories are not showing up on diffs --------- Co-authored-by: Tulip Blossom --- Justfile | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index f12166c..000a0c6 100644 --- a/Justfile +++ b/Justfile @@ -45,6 +45,7 @@ clean: rm -f previous.manifest.json rm -f changelog.md rm -f output.env + rm -f output/ # Sudo Clean Repo [group('Utility')] @@ -186,15 +187,6 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t #!/usr/bin/env bash set -euo pipefail - mkdir -p "output" - - echo "Cleaning up previous build" - if [[ $type == iso ]]; then - sudo rm -rf "output/bootiso" || true - else - sudo rm -rf "output/${type}" || true - fi - args="--type ${type} " args+="--use-librepo=True" @@ -202,6 +194,8 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t args+=" --local" fi + BUILDTMP=$(mktemp -p "${PWD}" -d -t _build-bib.XXXXXXXXXX) + sudo podman run \ --rm \ -it \ @@ -210,13 +204,16 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t --net=host \ --security-opt label=type:unconfined_t \ -v $(pwd)/${config}:/config.toml:ro \ - -v $(pwd)/output:/output \ + -v $BUILDTMP:/output \ -v /var/lib/containers/storage:/var/lib/containers/storage \ "${bib_image}" \ ${args} \ "${target_image}:${tag}" - sudo chown -R $USER:$USER output + mkdir -p output + sudo mv -f $BUILDTMP/* output/ + sudo rmdir $BUILDTMP + sudo chown -R $USER:$USER output/ # Podman builds the image from the Containerfile and creates a bootable image # Parameters: -- cgit v1.2.3 From fad4bd120b84a16906cde9018735394c81405499 Mon Sep 17 00:00:00 2001 From: MymeType <109294126+MymeType@users.noreply.github.com> Date: Sun, 13 Apr 2025 21:59:24 +0200 Subject: fix: Add rootfs argument to _build-bib (#96) --- Justfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 000a0c6..61e89df 100644 --- a/Justfile +++ b/Justfile @@ -188,7 +188,8 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t set -euo pipefail args="--type ${type} " - args+="--use-librepo=True" + args+="--use-librepo=True " + args+="--rootfs=btrfs" if [[ $target_image == localhost/* ]]; then args+=" --local" -- cgit v1.2.3 From 0069787411643484727210be663f88f81619fa81 Mon Sep 17 00:00:00 2001 From: MymeType <109294126+MymeType@users.noreply.github.com> Date: Fri, 18 Apr 2025 14:24:02 +0200 Subject: Update Justfile (#97) --- Justfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 61e89df..f9c481c 100644 --- a/Justfile +++ b/Justfile @@ -289,9 +289,8 @@ _run-vm $target_image $tag $type $config: run_args+=(docker.io/qemux/qemu-docker) # Run the VM and open the browser to connect - podman run "${run_args[@]}" & - xdg-open http://localhost:${port} - fg "%podman" + (sleep 30 && xdg-open http://localhost:"$port") & + podman run "${run_args[@]}" # Run a virtual machine from a QCOW2 image [group('Run Virtal Machine')] -- cgit v1.2.3 From 84bf48b851bef473f1a0fcaf2daa8d8a45487f14 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Wed, 14 May 2025 22:13:36 +0530 Subject: fix(justfile): `just lint` and `just format` pass when `shellcheck` and `shfmt` do not exist (#105) --- Justfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Justfile') diff --git a/Justfile b/Justfile index f9c481c..0078339 100644 --- a/Justfile +++ b/Justfile @@ -325,8 +325,24 @@ spawn-vm rebuild="0" type="qcow2" ram="6G": # Runs shell check on all Bash scripts lint: + #!/usr/bin/env bash + set -eoux pipefail + # Check if shellcheck is installed + if ! command -v shellcheck &> /dev/null; then + echo "shellcheck could not be found. Please install it." + exit 1 + fi + # Run shellcheck on all Bash scripts /usr/bin/find . -iname "*.sh" -type f -exec shellcheck "{}" ';' # Runs shfmt on all Bash scripts format: + #!/usr/bin/env bash + set -eoux pipefail + # Check if shfmt is installed + if ! command -v shfmt &> /dev/null; then + echo "shellcheck could not be found. Please install it." + exit 1 + fi + # Run shfmt on all Bash scripts /usr/bin/find . -iname "*.sh" -type f -exec shfmt --write "{}" ';' -- cgit v1.2.3 From 2c18f745dc9cd8e54a0fab823576a16488fcd7cc Mon Sep 17 00:00:00 2001 From: James Reilly Date: Tue, 20 May 2025 05:02:39 +0530 Subject: Fix(justfile): update qemu image name (#107) --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 0078339..3fe162f 100644 --- a/Justfile +++ b/Justfile @@ -286,7 +286,7 @@ _run-vm $target_image $tag $type $config: run_args+=(--env "GPU=Y") run_args+=(--device=/dev/kvm) run_args+=(--volume "${PWD}/${image_file}":"/boot.${type}") - run_args+=(docker.io/qemux/qemu-docker) + run_args+=(docker.io/qemux/qemu) # Run the VM and open the browser to connect (sleep 30 && xdg-open http://localhost:"$port") & -- cgit v1.2.3 From 71ade0d1a24aca0e1319ec6634e0dbc5500436eb Mon Sep 17 00:00:00 2001 From: renner <80410025+renner0e@users.noreply.github.com> Date: Mon, 26 May 2025 02:34:51 +0200 Subject: fix(just): fix syntax error (#109) --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 3fe162f..098ad43 100644 --- a/Justfile +++ b/Justfile @@ -337,7 +337,7 @@ lint: # Runs shfmt on all Bash scripts format: - #!/usr/bin/env bash + #!/usr/bin/env bash set -eoux pipefail # Check if shfmt is installed if ! command -v shfmt &> /dev/null; then -- cgit v1.2.3 From 3e88d8228dc12c32c316d8be1b638e17ccbdeeed Mon Sep 17 00:00:00 2001 From: Christian Glombek Date: Tue, 10 Jun 2025 02:15:44 +0200 Subject: chore: simplify (#111) --- Justfile | 67 ++++++++++++++++++---------------------------------------------- 1 file changed, 19 insertions(+), 48 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 098ad43..6ea8bcf 100644 --- a/Justfile +++ b/Justfile @@ -1,7 +1,4 @@ -export repo_organization := env("GITHUB_REPOSITORY_OWNER", "yourname") -export image_name := env("IMAGE_NAME", "yourimage") -export centos_version := env("CENTOS_VERSION", "stream10") -export fedora_version := env("CENTOS_VERSION", "41") +export image_name := env("IMAGE_NAME", "image-template") # output image name, usually same as repo name, change as needed export default_tag := env("DEFAULT_TAG", "latest") export bib_image := env("BIB_IMAGE", "quay.io/centos-bootc/bootc-image-builder:latest") @@ -74,47 +71,25 @@ sudoif command *args: # This Justfile recipe builds a container image using Podman. # # Arguments: -# $target_image - The tag you want to apply to the image (default: aurora). -# $tag - The tag for the image (default: lts). -# $dx - Enable DX (default: "0"). -# $hwe - Enable HWE (default: "0"). -# $gdx - Enable GDX (default: "0"). -# -# DX: -# Developer Experience (DX) is a feature that allows you to install the latest developer tools for your system. -# Packages include VScode, Docker, Distrobox, and more. -# HWE: -# Hardware Enablement (HWE) is a feature that allows you to install the latest hardware support for your system. -# Currently this install the Hyperscale SIG kernel which will stay ahead of the CentOS Stream kernel and enables btrfs -# GDX: https://docs.projectaurora.io/gdx/ -# GPU Developer Experience (GDX) creates a base as an AI and Graphics platform. -# Installs Nvidia drivers, CUDA, and other tools. +# $target_image - The tag you want to apply to the image (default: $image_name). +# $tag - The tag for the image (default: $default_tag). # # The script constructs the version string using the tag and the current date. # If the git working directory is clean, it also includes the short SHA of the current HEAD. # -# just build $target_image $tag $dx $hwe $gdx +# just build $target_image $tag # # Example usage: -# just build aurora lts 1 0 1 +# just build aurora lts # # This will build an image 'aurora:lts' with DX and GDX enabled. # # Build the image using the specified parameters -build $target_image=image_name $tag=default_tag $dx="0" $hwe="0" $gdx="0": +build $target_image=image_name $tag=default_tag: #!/usr/bin/env bash - # Get Version - ver="${tag}-${centos_version}.$(date +%Y%m%d)" - BUILD_ARGS=() - BUILD_ARGS+=("--build-arg" "MAJOR_VERSION=${centos_version}") - BUILD_ARGS+=("--build-arg" "IMAGE_NAME=${target_image}") - BUILD_ARGS+=("--build-arg" "IMAGE_VENDOR=${repo_organization}") - BUILD_ARGS+=("--build-arg" "ENABLE_DX=${dx}") - BUILD_ARGS+=("--build-arg" "ENABLE_HWE=${hwe}") - BUILD_ARGS+=("--build-arg" "ENABLE_GDX=${gdx}") if [[ -z "$(git status -s)" ]]; then BUILD_ARGS+=("--build-arg" "SHA_HEAD_SHORT=$(git rev-parse --short HEAD)") fi @@ -180,9 +155,9 @@ _rootful_load_image $target_image=image_name $tag=default_tag: # target_image: The name of the image to build (ex. localhost/fedora) # tag: The tag of the image to build (ex. latest) # type: The type of image to build (ex. qcow2, raw, iso) -# config: The configuration file to use for the build (default: image.toml) +# config: The configuration file to use for the build (default: disk_config/disk.toml) -# Example: just _rebuild-bib localhost/fedora latest qcow2 image.toml +# Example: just _rebuild-bib localhost/fedora latest qcow2 disk_config/disk.toml _build-bib $target_image $tag $type $config: (_rootful_load_image target_image tag) #!/usr/bin/env bash set -euo pipefail @@ -191,10 +166,6 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t args+="--use-librepo=True " args+="--rootfs=btrfs" - if [[ $target_image == localhost/* ]]; then - args+=" --local" - fi - BUILDTMP=$(mktemp -p "${PWD}" -d -t _build-bib.XXXXXXXXXX) sudo podman run \ @@ -221,34 +192,34 @@ _build-bib $target_image $tag $type $config: (_rootful_load_image target_image t # target_image: The name of the image to build (ex. localhost/fedora) # tag: The tag of the image to build (ex. latest) # type: The type of image to build (ex. qcow2, raw, iso) -# config: The configuration file to use for the build (deafult: image.toml) +# config: The configuration file to use for the build (deafult: disk_config/disk.toml) -# Example: just _rebuild-bib localhost/fedora latest qcow2 image.toml +# Example: just _rebuild-bib localhost/fedora latest qcow2 disk_config/disk.toml _rebuild-bib $target_image $tag $type $config: (build target_image tag) && (_build-bib target_image tag type config) # Build a QCOW2 virtual machine image [group('Build Virtal Machine Image')] -build-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "qcow2" "image.toml") +build-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "qcow2" "disk_config/disk.toml") # Build a RAW virtual machine image [group('Build Virtal Machine Image')] -build-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "raw" "image.toml") +build-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "raw" "disk_config/disk.toml") # Build an ISO virtual machine image [group('Build Virtal Machine Image')] -build-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "iso" "iso.toml") +build-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "iso" "disk_config/iso.toml") # Rebuild a QCOW2 virtual machine image [group('Build Virtal Machine Image')] -rebuild-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "qcow2" "image.toml") +rebuild-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "qcow2" "disk_config/disk.toml") # Rebuild a RAW virtual machine image [group('Build Virtal Machine Image')] -rebuild-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "raw" "image.toml") +rebuild-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "raw" "disk_config/disk.toml") # Rebuild an ISO virtual machine image [group('Build Virtal Machine Image')] -rebuild-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "iso" "iso.toml") +rebuild-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "iso" "disk_config/iso.toml") # Run a virtual machine with the specified image type and configuration _run-vm $target_image $tag $type $config: @@ -294,15 +265,15 @@ _run-vm $target_image $tag $type $config: # Run a virtual machine from a QCOW2 image [group('Run Virtal Machine')] -run-vm-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "qcow2" "image.toml") +run-vm-qcow2 $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "qcow2" "disk_config/disk.toml") # Run a virtual machine from a RAW image [group('Run Virtal Machine')] -run-vm-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "raw" "image.toml") +run-vm-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "raw" "disk_config/disk.toml") # Run a virtual machine from an ISO [group('Run Virtal Machine')] -run-vm-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "iso" "iso.toml") +run-vm-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "iso" "disk_config/iso.toml") # Run a virtual machine using systemd-vmspawn [group('Run Virtal Machine')] -- cgit v1.2.3 From 4a44f56dbe43c6bb3ff4a73b4429e8543288569b Mon Sep 17 00:00:00 2001 From: ro62t2 <244381118+ro62t2@users.noreply.github.com> Date: Sat, 2 May 2026 17:35:55 +0100 Subject: added -r flag to rm command for output dir (#216) --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 6ea8bcf..9266507 100644 --- a/Justfile +++ b/Justfile @@ -42,7 +42,7 @@ clean: rm -f previous.manifest.json rm -f changelog.md rm -f output.env - rm -f output/ + rm -rf output/ # Sudo Clean Repo [group('Utility')] -- cgit v1.2.3 From 91cda143ef09e943332cdecd6eebde526e8bddcb Mon Sep 17 00:00:00 2001 From: renner <80410025+renner0e@users.noreply.github.com> Date: Thu, 7 May 2026 08:39:37 +0200 Subject: fix(just): correct shfmt typo (#217) --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 9266507..555cca8 100644 --- a/Justfile +++ b/Justfile @@ -312,7 +312,7 @@ format: set -eoux pipefail # Check if shfmt is installed if ! command -v shfmt &> /dev/null; then - echo "shellcheck could not be found. Please install it." + echo "shfmt could not be found. Please install it." exit 1 fi # Run shfmt on all Bash scripts -- cgit v1.2.3 From a65bb3da1f7c5ed04ac3d8b5f69878c5ecee14ea Mon Sep 17 00:00:00 2001 From: renner <80410025+renner0e@users.noreply.github.com> Date: Wed, 17 Jun 2026 16:16:34 +0200 Subject: refactor: rewrite in just, saner defaults (#218) * refactor: rewrite in just, saner defaults I think it makes sense to do this as it is longterm easier to maintain, locally iterate and extend. Documents how to rebase to a local image, it pains me greatly when people iterate on github and wait forever for things to build and then to download the image for trivial things they could also quickly do locally. Rpm-ostree rechunker by default instead of opt-in legacy-rechunker, chunkah is also available if people want to use it already, if we deem it ready then we can enable it later on. They can all be opted-out of. Have a way to copy files to /{usr,etc} by default. We should sign the digest of the image instead of the tag. Co-Authored-by: a lot of sugar and bad music * docs: bump fedora-bootc version Co-authored-by: Jill Fiore * fix: formatting inconsistency Co-authored-by: Jill Fiore * docs: remove variable mentions from workflows These are now defined in the image-template.env file * fix: small nits in labels Co-authored-by: Adam Fidel --------- Co-authored-by: Jill Fiore Co-authored-by: Adam Fidel --- Justfile | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 142 insertions(+), 12 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 555cca8..150c89c 100644 --- a/Justfile +++ b/Justfile @@ -1,6 +1,13 @@ -export image_name := env("IMAGE_NAME", "image-template") # output image name, usually same as repo name, change as needed -export default_tag := env("DEFAULT_TAG", "latest") -export bib_image := env("BIB_IMAGE", "quay.io/centos-bootc/bootc-image-builder:latest") +set dotenv-filename := "image-template.env" +set dotenv-load + +export image_name := env_var("IMAGE_NAME") +export repo_organization := env_var("REPO_ORGANIZATION") +export image_desc := env_var("IMAGE_DESC") +export image_keywords := env_var("IMAGE_KEYWORDS") +export image_logo_url := env_var("IMAGE_LOGO_URL") +export default_tag := env_var("DEFAULT_TAG") +export bib_image := env_var("BIB_IMAGE") alias build-vm := build-qcow2 alias rebuild-vm := rebuild-qcow2 @@ -80,25 +87,149 @@ sudoif command *args: # just build $target_image $tag # # Example usage: -# just build aurora lts +# just build myimage mytag # -# This will build an image 'aurora:lts' with DX and GDX enabled. +# This will build an image 'myimage:mytag' # # Build the image using the specified parameters build $target_image=image_name $tag=default_tag: #!/usr/bin/env bash + set -euox pipefail + BUILD_ARGS=() + LABELS=() + if [[ -z "$(git status -s)" ]]; then + GIT_SHA=$(git rev-parse --short HEAD) + LABELS+=("--label" "io.artifacthub.package.readme-url=https://raw.githubusercontent.com/{{ repo_organization }}/{{ image_name }}/${GIT_SHA}/README.md") + LABELS+=("--label" "org.opencontainers.image.documentation=https://raw.githubusercontent.com/{{ repo_organization }}/{{ image_name }}/${GIT_SHA}/README.md") + LABELS+=("--label" "org.opencontainers.image.source=https://github.com/{{ repo_organization }}/{{ image_name }}/blob/${GIT_SHA}/Containerfile") + LABELS+=("--label" "org.opencontainers.image.url=https://github.com/{{ repo_organization }}/{{ image_name }}/tree/${GIT_SHA}") + LABELS+=("--label" "org.opencontainers.image.version={{ default_tag }}.$(date +%Y%m%d)-${GIT_SHA}") + fi + + # Image metadata for https://artifacthub.io/ - This is optional but is highly recommended so we all can get a index of all the custom images + # The metadata by itself is not going to do anything, you choose if you want your image to be on ArtifactHub or not. + LABELS+=("--label" "io.artifacthub.package.deprecated=false") + LABELS+=("--label" "io.artifacthub.package.keywords={{ image_keywords }}") + LABELS+=("--label" "io.artifacthub.package.license=Apache-2.0") + LABELS+=("--label" "io.artifacthub.package.logo-url={{ image_logo_url }}") + LABELS+=("--label" "io.artifacthub.package.prerelease=false") + LABELS+=("--label" "org.opencontainers.image.created=$(date -u +%Y\-%m\-%d\T%H\:%M\:%S\Z)") + LABELS+=("--label" "org.opencontainers.image.description={{ image_desc }}") + LABELS+=("--label" "org.opencontainers.image.title={{ image_name }}") + LABELS+=("--label" "org.opencontainers.image.vendor={{ repo_organization }}") + + # This actually builds the image! + PODMAN_BUILD_ARGS=("${BUILD_ARGS[@]}" "${LABELS[@]}" --pull=newer --tag "${target_image}:${tag}" --file Containerfile) + + podman build "${PODMAN_BUILD_ARGS[@]}" . + +# Split the image for smaller updates (New)! +rechunk $target_image=image_name $tag=default_tag: + #!/usr/bin/env bash + + set -xeuo pipefail + + # TODO: pin chunkah image to hash once mature enough + # You may run into space issues on github runenrs as we are making a + # complete copy of the image + export CHUNKAH_CONFIG_STR=$(podman inspect "${target_image}") + podman run --rm --mount=type=image,src="${target_image}",target=/chunkah \ + -e CHUNKAH_CONFIG_STR quay.io/coreos/chunkah:latest \ + build \ + --verbose \ + --compressed \ + --max-layers 128 \ + --prune /sysroot/ \ + --label ostree.commit- --label ostree.final-diffid- \ + --tag "${target_image}:${tag}" | podman load + +# Split the image for smaller updates (Classical)! +ostree-rechunk $target_image=image_name $tag=default_tag: + #!/usr/bin/env bash + + set -xeuo pipefail + + # TODO: This is the only blocker for rootless CI + # https://github.com/coreos/rpm-ostree/issues/5346 + if [[ ! "${UID}" -eq "0" ]]; then + echo "This needs to run as root." + exit 1 + fi + + # You can use your own base image here to avoid pulling fedora-bootc + RPM_OSTREE_CHUNKER_IMAGE="quay.io/fedora/fedora-bootc:latest" + + podman run --rm \ + --pull=newer \ + --privileged \ + -v "/var/lib/containers:/var/lib/containers" \ + --entrypoint /usr/bin/rpm-ostree \ + "${RPM_OSTREE_CHUNKER_IMAGE}" \ + compose build-chunked-oci \ + --max-layers 127 \ + --format-version=2 \ + --bootc \ + --from "localhost/${target_image}:${tag}" \ + --output containers-storage:"localhost/${target_image}:${tag}" + +# Generate Default Tag +[group('Utility')] +generate-default-tag $tag=default_tag: + #!/usr/bin/env bash + set -eoux pipefail + + echo "${tag}" + +# Generate Tags +[group('Utility')] +generate-build-tags $target_image=image_name $tag=default_tag: + #!/usr/bin/bash + set -eoux pipefail + + DATE=$(date +%Y%m%d) + BUILD_TAGS=() if [[ -z "$(git status -s)" ]]; then - BUILD_ARGS+=("--build-arg" "SHA_HEAD_SHORT=$(git rev-parse --short HEAD)") + GIT_SHA=$(git rev-parse --short HEAD) + BUILD_TAGS+=("${tag}-${GIT_SHA}") + BUILD_TAGS+=("${tag}-${DATE}-${GIT_SHA}") + BUILD_TAGS+=("${DATE}-${GIT_SHA}") fi - podman build \ - "${BUILD_ARGS[@]}" \ - --pull=newer \ - --tag "${target_image}:${tag}" \ - . + BUILD_TAGS+=("${DATE}") + BUILD_TAGS+=("${tag}") + BUILD_TAGS+=("${tag}-${DATE}") + + echo "${BUILD_TAGS[@]}" + +# Tag Images +[group('Utility')] +tag-images $target_image=image_name $tag=default_tag tags="": + #!/usr/bin/env bash + set -eoux pipefail + + # Get Image, and untag + IMAGE=$(podman inspect ${target_image}:${tag} | jq -r .[].Id) + podman untag ${IMAGE} + + # Tag Image + for tag in {{ tags }}; do + podman tag $IMAGE "${target_image}:${tag}" + done + + # Show Images + podman images + +# Image Name +[group('Utility')] +[private] +image_name $target_image=image_name: + #!/usr/bin/env bash + set -eoux pipefail + + echo "${image_name}" # Command: _rootful_load_image # Description: This script checks if the current user is root or running under sudo. If not, it attempts to resolve the image tag using podman inspect. @@ -293,7 +424,6 @@ spawn-vm rebuild="0" type="qcow2" ram="6G": --vsock=false --pass-ssh-key=false \ -i ./output/**/*.{{ type }} - # Runs shell check on all Bash scripts lint: #!/usr/bin/env bash -- cgit v1.2.3 From ed40e44b610cac878f17fa4233d8e3d19b8d67bb Mon Sep 17 00:00:00 2001 From: tranch Date: Thu, 9 Jul 2026 16:53:52 +0800 Subject: Configure AeroCore image mirrors Add build-time mirror configuration for Flatpak and Homebrew, expose the related build args, and install an AeroCore-owned profile script to load mirror environment files. Rename the mirror configuration files from the Bazzite-prefixed names to AeroCore-prefixed names while keeping the upstream Bazzite helper reference intact. Verification: bash -n system_files/etc/profile.d/aerocore-mirrors.sh && bash -n build_files/build.sh --- Justfile | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 150c89c..e83466d 100644 --- a/Justfile +++ b/Justfile @@ -8,6 +8,10 @@ export image_keywords := env_var("IMAGE_KEYWORDS") export image_logo_url := env_var("IMAGE_LOGO_URL") export default_tag := env_var("DEFAULT_TAG") export bib_image := env_var("BIB_IMAGE") +export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:stable") +export FLATPAK_REMOTE_URL := env_var_or_default("FLATPAK_REMOTE_URL", "") +export HOMEBREW_BOTTLE_DOMAIN := env_var_or_default("HOMEBREW_BOTTLE_DOMAIN", "") +export HOMEBREW_API_DOMAIN := env_var_or_default("HOMEBREW_API_DOMAIN", "") alias build-vm := build-qcow2 alias rebuild-vm := rebuild-qcow2 @@ -100,6 +104,12 @@ build $target_image=image_name $tag=default_tag: BUILD_ARGS=() LABELS=() + for arg in BASE_IMAGE FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN; do + if [[ -n "${!arg:-}" ]]; then + BUILD_ARGS+=("--build-arg" "${arg}=${!arg}") + fi + done + if [[ -z "$(git status -s)" ]]; then GIT_SHA=$(git rev-parse --short HEAD) LABELS+=("--label" "io.artifacthub.package.readme-url=https://raw.githubusercontent.com/{{ repo_organization }}/{{ image_name }}/${GIT_SHA}/README.md") -- cgit v1.2.3 From 42a6ff3286804854c1c21a7e62158f09e19a9b09 Mon Sep 17 00:00:00 2001 From: tranch Date: Sun, 12 Jul 2026 23:33:44 +0800 Subject: Add live installer build workflow Add a Bazzite-style installer payload, CI workflow, and local\nPodman commands for building and testing the live ISO.\n\nFix stale disk image configuration references and installer targets. --- Justfile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index e83466d..9ec4dd1 100644 --- a/Justfile +++ b/Justfile @@ -16,11 +16,21 @@ export HOMEBREW_API_DOMAIN := env_var_or_default("HOMEBREW_API_DOMAIN", "") alias build-vm := build-qcow2 alias rebuild-vm := rebuild-qcow2 alias run-vm := run-vm-qcow2 +alias build-live-iso := build-live-installer +alias run-live-iso := run-live-installer [private] default: @just --list +# Build a Bazzite-style live installer ISO +build-live-installer: + @./just_scripts/build-live-installer.sh + +# Boot the live installer ISO with QEMU +run-live-installer: + @./just_scripts/run-live-installer.sh + # Check Just Syntax [group('Just')] check: @@ -348,7 +358,7 @@ build-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_build # Build an ISO virtual machine image [group('Build Virtal Machine Image')] -build-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "iso" "disk_config/iso.toml") +build-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_build-bib target_image tag "iso" "disk_config/iso-kde.toml") # Rebuild a QCOW2 virtual machine image [group('Build Virtal Machine Image')] @@ -360,7 +370,7 @@ rebuild-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_reb # Rebuild an ISO virtual machine image [group('Build Virtal Machine Image')] -rebuild-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "iso" "disk_config/iso.toml") +rebuild-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_rebuild-bib target_image tag "iso" "disk_config/iso-kde.toml") # Run a virtual machine with the specified image type and configuration _run-vm $target_image $tag $type $config: @@ -414,7 +424,7 @@ run-vm-raw $target_image=("localhost/" + image_name) $tag=default_tag: && (_run- # Run a virtual machine from an ISO [group('Run Virtal Machine')] -run-vm-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "iso" "disk_config/iso.toml") +run-vm-iso $target_image=("localhost/" + image_name) $tag=default_tag: && (_run-vm target_image tag "iso" "disk_config/iso-kde.toml") # Run a virtual machine using systemd-vmspawn [group('Run Virtal Machine')] -- cgit v1.2.3 From 78bc16acebffcffcb5e544139cb4c5169f652985 Mon Sep 17 00:00:00 2001 From: tranch Date: Mon, 13 Jul 2026 00:17:46 +0800 Subject: Allow env override for image update ref Pass OSTREE_IMAGE_REF from GitHub repository variables into the image build so image-info.json can point systems at the configured update source. --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 9ec4dd1..5b5cc02 100644 --- a/Justfile +++ b/Justfile @@ -114,7 +114,7 @@ build $target_image=image_name $tag=default_tag: BUILD_ARGS=() LABELS=() - for arg in BASE_IMAGE FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN; do + for arg in BASE_IMAGE FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN OSTREE_IMAGE_REF; do if [[ -n "${!arg:-}" ]]; then BUILD_ARGS+=("--build-arg" "${arg}=${!arg}") fi -- cgit v1.2.3 From 5a41b4c5daf60b45105d0dc552c4d46022c92b04 Mon Sep 17 00:00:00 2001 From: tranch Date: Wed, 15 Jul 2026 14:04:06 +0800 Subject: Integrate Instruments release seed Download and verify the selected release during image builds. Bootstrap it once into the first graphical user's XDG directories. --- Justfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 5b5cc02..5e73752 100644 --- a/Justfile +++ b/Justfile @@ -12,6 +12,10 @@ export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite- export FLATPAK_REMOTE_URL := env_var_or_default("FLATPAK_REMOTE_URL", "") export HOMEBREW_BOTTLE_DOMAIN := env_var_or_default("HOMEBREW_BOTTLE_DOMAIN", "") export HOMEBREW_API_DOMAIN := env_var_or_default("HOMEBREW_API_DOMAIN", "") +export INSTRUMENTS_ENABLED := env_var_or_default("INSTRUMENTS_ENABLED", "true") +export INSTRUMENTS_RELEASE_REPOSITORY := env_var_or_default("INSTRUMENTS_RELEASE_REPOSITORY", "AeroCore-IO/booster-installer") +export INSTRUMENTS_VERSION := env_var_or_default("INSTRUMENTS_VERSION", "latest") +export INSTRUMENTS_RELEASE_API_BASE := env_var_or_default("INSTRUMENTS_RELEASE_API_BASE", "https://api.github.com") alias build-vm := build-qcow2 alias rebuild-vm := rebuild-qcow2 @@ -114,7 +118,7 @@ build $target_image=image_name $tag=default_tag: BUILD_ARGS=() LABELS=() - for arg in BASE_IMAGE FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN OSTREE_IMAGE_REF; do + for arg in BASE_IMAGE FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN OSTREE_IMAGE_REF INSTRUMENTS_ENABLED INSTRUMENTS_RELEASE_REPOSITORY INSTRUMENTS_VERSION INSTRUMENTS_RELEASE_API_BASE; do if [[ -n "${!arg:-}" ]]; then BUILD_ARGS+=("--build-arg" "${arg}=${!arg}") fi -- cgit v1.2.3 From 04b8dcbbc3d5707f488c9b67ba96ce88ccd15181 Mon Sep 17 00:00:00 2001 From: tranch Date: Fri, 17 Jul 2026 06:56:56 +0800 Subject: Fix live installer ISO build Build the live installer from the requested local AeroCore image, use a separate Fedora live base, pass the payload through rootful container storage, and write reproducible checksum entries without host paths. --- Justfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 5e73752..b65d2c9 100644 --- a/Justfile +++ b/Justfile @@ -9,6 +9,8 @@ export image_logo_url := env_var("IMAGE_LOGO_URL") export default_tag := env_var("DEFAULT_TAG") export bib_image := env_var("BIB_IMAGE") export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:stable") +export LIVE_BASE_IMAGE := env_var_or_default("LIVE_BASE_IMAGE", "quay.io/fedora/fedora-kinoite:43") +export INSTALLER_BUILDER_IMAGE := env_var_or_default("INSTALLER_BUILDER_IMAGE", "ghcr.io/jasonn3/build-container-installer:v1.5.0") export FLATPAK_REMOTE_URL := env_var_or_default("FLATPAK_REMOTE_URL", "") export HOMEBREW_BOTTLE_DOMAIN := env_var_or_default("HOMEBREW_BOTTLE_DOMAIN", "") export HOMEBREW_API_DOMAIN := env_var_or_default("HOMEBREW_API_DOMAIN", "") @@ -28,8 +30,8 @@ default: @just --list # Build a Bazzite-style live installer ISO -build-live-installer: - @./just_scripts/build-live-installer.sh +build-live-installer $target_image=("localhost/" + image_name) $tag=default_tag: + @IMAGE_NAME="{{ target_image }}" IMAGE_TAG="{{ tag }}" ./just_scripts/build-live-installer.sh # Boot the live installer ISO with QEMU run-live-installer: -- cgit v1.2.3 From 4dd41315acaa07112864a3833dfb7775d9b44274 Mon Sep 17 00:00:00 2001 From: tranch Date: Fri, 24 Jul 2026 17:29:04 +0800 Subject: Rename live installer to installer ISO Use installer ISO terminology across Just, workflows, scripts, docs, and image payloads while preserving compatibility aliases for existing commands. --- Justfile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index b65d2c9..f77828b 100644 --- a/Justfile +++ b/Justfile @@ -22,20 +22,25 @@ export INSTRUMENTS_RELEASE_API_BASE := env_var_or_default("INSTRUMENTS_RELEASE_A alias build-vm := build-qcow2 alias rebuild-vm := rebuild-qcow2 alias run-vm := run-vm-qcow2 -alias build-live-iso := build-live-installer -alias run-live-iso := run-live-installer +alias build-installer := build-installer-iso +alias run-installer := run-installer-iso +# Backward-compatible aliases; these refer to the installer ISO, not a Live OS. +alias build-live-iso := build-installer-iso +alias run-live-iso := run-installer-iso +alias build-live-installer := build-installer-iso +alias run-live-installer := run-installer-iso [private] default: @just --list -# Build a Bazzite-style live installer ISO -build-live-installer $target_image=("localhost/" + image_name) $tag=default_tag: - @IMAGE_NAME="{{ target_image }}" IMAGE_TAG="{{ tag }}" ./just_scripts/build-live-installer.sh +# Build a Bazzite-style installer ISO +build-installer-iso $target_image=("localhost/" + image_name) $tag=default_tag: + @IMAGE_NAME="{{ target_image }}" IMAGE_TAG="{{ tag }}" ./just_scripts/build-installer-iso.sh -# Boot the live installer ISO with QEMU -run-live-installer: - @./just_scripts/run-live-installer.sh +# Boot the installer ISO with QEMU +run-installer-iso: + @./just_scripts/run-installer-iso.sh # Check Just Syntax [group('Just')] -- cgit v1.2.3 From 0ebf76e160c1e45d537e24d145fed47a38d8d99d Mon Sep 17 00:00:00 2001 From: tranch Date: Sat, 25 Jul 2026 22:49:06 +0800 Subject: Route installer updates through OSTREE_IMAGE_REF Use the configured ref for ISO boot origins and derive GHCR fallbacks from the current repository instead of hardcoding the image path. --- Justfile | 1 + 1 file changed, 1 insertion(+) (limited to 'Justfile') diff --git a/Justfile b/Justfile index f77828b..257ec46 100644 --- a/Justfile +++ b/Justfile @@ -9,6 +9,7 @@ export image_logo_url := env_var("IMAGE_LOGO_URL") export default_tag := env_var("DEFAULT_TAG") export bib_image := env_var("BIB_IMAGE") export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:stable") +export OSTREE_IMAGE_REF := env_var_or_default("OSTREE_IMAGE_REF", "ostree-image-signed:docker://ghcr.io/" + repo_organization + "/" + image_name) export LIVE_BASE_IMAGE := env_var_or_default("LIVE_BASE_IMAGE", "quay.io/fedora/fedora-kinoite:43") export INSTALLER_BUILDER_IMAGE := env_var_or_default("INSTALLER_BUILDER_IMAGE", "ghcr.io/jasonn3/build-container-installer:v1.5.0") export FLATPAK_REMOTE_URL := env_var_or_default("FLATPAK_REMOTE_URL", "") -- cgit v1.2.3 From 05c9b9bd017e8e20b70bd791e1f04cabd6664cd4 Mon Sep 17 00:00:00 2001 From: tranch Date: Sat, 25 Jul 2026 23:28:23 +0800 Subject: Add branch-aware versioned image tags Generate Fedora/date version tags and publish stable or testing aliases from the corresponding Git branch. --- Justfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index b65d2c9..6bc9957 100644 --- a/Justfile +++ b/Justfile @@ -8,6 +8,9 @@ export image_keywords := env_var("IMAGE_KEYWORDS") export image_logo_url := env_var("IMAGE_LOGO_URL") export default_tag := env_var("DEFAULT_TAG") export bib_image := env_var("BIB_IMAGE") +export IMAGE_BRANCH := env_var_or_default("IMAGE_BRANCH", "stable") +export VERSION_TAG := env_var_or_default("VERSION_TAG", default_tag) +export VERSION_PRETTY := env_var_or_default("VERSION_PRETTY", VERSION_TAG) export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:stable") export LIVE_BASE_IMAGE := env_var_or_default("LIVE_BASE_IMAGE", "quay.io/fedora/fedora-kinoite:43") export INSTALLER_BUILDER_IMAGE := env_var_or_default("INSTALLER_BUILDER_IMAGE", "ghcr.io/jasonn3/build-container-installer:v1.5.0") @@ -120,7 +123,7 @@ build $target_image=image_name $tag=default_tag: BUILD_ARGS=() LABELS=() - for arg in BASE_IMAGE FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN OSTREE_IMAGE_REF INSTRUMENTS_ENABLED INSTRUMENTS_RELEASE_REPOSITORY INSTRUMENTS_VERSION INSTRUMENTS_RELEASE_API_BASE; do + for arg in BASE_IMAGE IMAGE_BRANCH VERSION_TAG VERSION_PRETTY FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN OSTREE_IMAGE_REF INSTRUMENTS_ENABLED INSTRUMENTS_RELEASE_REPOSITORY INSTRUMENTS_VERSION INSTRUMENTS_RELEASE_API_BASE; do if [[ -n "${!arg:-}" ]]; then BUILD_ARGS+=("--build-arg" "${arg}=${!arg}") fi -- cgit v1.2.3 From 21c68e32f7a8d77876ba782016a8063c42167963 Mon Sep 17 00:00:00 2001 From: tranch Date: Sun, 26 Jul 2026 01:23:31 +0800 Subject: Make stable the default image channel Keep latest as a main-branch alias while using Fedora/date versions for image metadata and release tags. --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index d3252c6..68939a1 100644 --- a/Justfile +++ b/Justfile @@ -140,7 +140,7 @@ build $target_image=image_name $tag=default_tag: LABELS+=("--label" "org.opencontainers.image.documentation=https://raw.githubusercontent.com/{{ repo_organization }}/{{ image_name }}/${GIT_SHA}/README.md") LABELS+=("--label" "org.opencontainers.image.source=https://github.com/{{ repo_organization }}/{{ image_name }}/blob/${GIT_SHA}/Containerfile") LABELS+=("--label" "org.opencontainers.image.url=https://github.com/{{ repo_organization }}/{{ image_name }}/tree/${GIT_SHA}") - LABELS+=("--label" "org.opencontainers.image.version={{ default_tag }}.$(date +%Y%m%d)-${GIT_SHA}") + LABELS+=("--label" "org.opencontainers.image.version={{ version_tag }}.$(date +%Y%m%d)-${GIT_SHA}") fi # Image metadata for https://artifacthub.io/ - This is optional but is highly recommended so we all can get a index of all the custom images -- cgit v1.2.3 From 632a225e1aa0e5c024a38b1367d8c755479a889f Mon Sep 17 00:00:00 2001 From: tranch Date: Sun, 26 Jul 2026 01:29:22 +0800 Subject: Fix Justfile version tag variable Use the uppercase VERSION_TAG variable defined by Just. --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 68939a1..a8590e2 100644 --- a/Justfile +++ b/Justfile @@ -140,7 +140,7 @@ build $target_image=image_name $tag=default_tag: LABELS+=("--label" "org.opencontainers.image.documentation=https://raw.githubusercontent.com/{{ repo_organization }}/{{ image_name }}/${GIT_SHA}/README.md") LABELS+=("--label" "org.opencontainers.image.source=https://github.com/{{ repo_organization }}/{{ image_name }}/blob/${GIT_SHA}/Containerfile") LABELS+=("--label" "org.opencontainers.image.url=https://github.com/{{ repo_organization }}/{{ image_name }}/tree/${GIT_SHA}") - LABELS+=("--label" "org.opencontainers.image.version={{ version_tag }}.$(date +%Y%m%d)-${GIT_SHA}") + LABELS+=("--label" "org.opencontainers.image.version={{ VERSION_TAG }}.$(date +%Y%m%d)-${GIT_SHA}") fi # Image metadata for https://artifacthub.io/ - This is optional but is highly recommended so we all can get a index of all the custom images -- cgit v1.2.3 From b91d3103578f0e812f1ab05ae9beb2e889cac8f1 Mon Sep 17 00:00:00 2001 From: tranch Date: Tue, 28 Jul 2026 02:08:21 +0800 Subject: fix: avoid duplicate date in image version label --- Justfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index af61316..8161c52 100644 --- a/Justfile +++ b/Justfile @@ -110,8 +110,8 @@ sudoif command *args: # $target_image - The tag you want to apply to the image (default: $image_name). # $tag - The tag for the image (default: $default_tag). # -# The script constructs the version string using the tag and the current date. -# If the git working directory is clean, it also includes the short SHA of the current HEAD. +# If the git working directory is clean, it appends the short SHA of the current HEAD +# to the version tag supplied by the build environment. # # just build $target_image $tag # @@ -141,7 +141,7 @@ build $target_image=image_name $tag=default_tag: LABELS+=("--label" "org.opencontainers.image.documentation=https://raw.githubusercontent.com/{{ repo_organization }}/{{ image_name }}/${GIT_SHA}/README.md") LABELS+=("--label" "org.opencontainers.image.source=https://github.com/{{ repo_organization }}/{{ image_name }}/blob/${GIT_SHA}/Containerfile") LABELS+=("--label" "org.opencontainers.image.url=https://github.com/{{ repo_organization }}/{{ image_name }}/tree/${GIT_SHA}") - LABELS+=("--label" "org.opencontainers.image.version={{ VERSION_TAG }}.$(date +%Y%m%d)-${GIT_SHA}") + LABELS+=("--label" "org.opencontainers.image.version={{ VERSION_TAG }}-${GIT_SHA}") fi # Image metadata for https://artifacthub.io/ - This is optional but is highly recommended so we all can get a index of all the custom images -- cgit v1.2.3 From 2d1118b6860c0e80ccc78883d6b814d73df4da67 Mon Sep 17 00:00:00 2001 From: tranch Date: Wed, 29 Jul 2026 14:50:10 +0800 Subject: Align local installer ISO build with CI Use the pinned Titanoboa builder and matching build arguments so just build-installer-iso produces the same media as the GitHub Actions workflow. --- Justfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 8161c52..47567b5 100644 --- a/Justfile +++ b/Justfile @@ -14,7 +14,8 @@ export VERSION_PRETTY := env_var_or_default("VERSION_PRETTY", VERSION_TAG) export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:stable") export OSTREE_IMAGE_REF := env_var_or_default("OSTREE_IMAGE_REF", "ostree-image-signed:docker://ghcr.io/" + repo_organization + "/" + image_name) export LIVE_BASE_IMAGE := env_var_or_default("LIVE_BASE_IMAGE", "quay.io/fedora/fedora-kinoite:43") -export INSTALLER_BUILDER_IMAGE := env_var_or_default("INSTALLER_BUILDER_IMAGE", "ghcr.io/jasonn3/build-container-installer:v1.5.0") +export TITANOBOA_REPOSITORY := env_var_or_default("TITANOBOA_REPOSITORY", "https://github.com/Zeglius/titanoboa.git") +export TITANOBOA_REVISION := env_var_or_default("TITANOBOA_REVISION", "7737f4748458252ac827dca14b3d6dd09298472a") export FLATPAK_REMOTE_URL := env_var_or_default("FLATPAK_REMOTE_URL", "") export HOMEBREW_BOTTLE_DOMAIN := env_var_or_default("HOMEBREW_BOTTLE_DOMAIN", "") export HOMEBREW_API_DOMAIN := env_var_or_default("HOMEBREW_API_DOMAIN", "") @@ -38,7 +39,7 @@ alias run-live-installer := run-installer-iso default: @just --list -# Build a Bazzite-style installer ISO +# Build the same Titanoboa-based installer ISO as CI build-installer-iso $target_image=("localhost/" + image_name) $tag=default_tag: @IMAGE_NAME="{{ target_image }}" IMAGE_TAG="{{ tag }}" ./just_scripts/build-installer-iso.sh -- cgit v1.2.3 From 636dcb9dc7af0c23bddeb855da8479eb06df090a Mon Sep 17 00:00:00 2001 From: tranch Date: Wed, 5 Aug 2026 06:50:26 +0800 Subject: Align ISO workflow live naming Match Bazzite's live ISO workflow label and output filename while keeping local build and run helpers pointed at the same artifact. --- Justfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 47567b5..b8d0be9 100644 --- a/Justfile +++ b/Justfile @@ -29,7 +29,7 @@ alias rebuild-vm := rebuild-qcow2 alias run-vm := run-vm-qcow2 alias build-installer := build-installer-iso alias run-installer := run-installer-iso -# Backward-compatible aliases; these refer to the installer ISO, not a Live OS. +# Backward-compatible aliases for the Titanoboa live ISO build. alias build-live-iso := build-installer-iso alias run-live-iso := run-installer-iso alias build-live-installer := build-installer-iso @@ -39,11 +39,11 @@ alias run-live-installer := run-installer-iso default: @just --list -# Build the same Titanoboa-based installer ISO as CI +# Build the same Titanoboa-based live ISO as CI build-installer-iso $target_image=("localhost/" + image_name) $tag=default_tag: @IMAGE_NAME="{{ target_image }}" IMAGE_TAG="{{ tag }}" ./just_scripts/build-installer-iso.sh -# Boot the installer ISO with QEMU +# Boot the live ISO with QEMU run-installer-iso: @./just_scripts/run-installer-iso.sh -- cgit v1.2.3 From 80cde14b9c368f58e8f16ad121396ce2f1a50f44 Mon Sep 17 00:00:00 2001 From: tranch Date: Fri, 21 Aug 2026 08:42:38 +0800 Subject: Adapt to Bazzite 44 Update Deck identity matching for the new upstream scripts and add fixture coverage for patch idempotence. Move the live installer base to Fedora 44 while retaining the Fedora 43 Anaconda workaround for explicit legacy builds. --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index b8d0be9..c412abb 100644 --- a/Justfile +++ b/Justfile @@ -13,7 +13,7 @@ export VERSION_TAG := env_var_or_default("VERSION_TAG", default_tag) export VERSION_PRETTY := env_var_or_default("VERSION_PRETTY", VERSION_TAG) export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:stable") export OSTREE_IMAGE_REF := env_var_or_default("OSTREE_IMAGE_REF", "ostree-image-signed:docker://ghcr.io/" + repo_organization + "/" + image_name) -export LIVE_BASE_IMAGE := env_var_or_default("LIVE_BASE_IMAGE", "quay.io/fedora/fedora-kinoite:43") +export LIVE_BASE_IMAGE := env_var_or_default("LIVE_BASE_IMAGE", "quay.io/fedora/fedora-kinoite:44") export TITANOBOA_REPOSITORY := env_var_or_default("TITANOBOA_REPOSITORY", "https://github.com/Zeglius/titanoboa.git") export TITANOBOA_REVISION := env_var_or_default("TITANOBOA_REVISION", "7737f4748458252ac827dca14b3d6dd09298472a") export FLATPAK_REMOTE_URL := env_var_or_default("FLATPAK_REMOTE_URL", "") -- cgit v1.2.3 From 10411b5e32b78f57b6ad995c434cfc4fc390d689 Mon Sep 17 00:00:00 2001 From: tranch Date: Wed, 26 Aug 2026 10:59:21 +0800 Subject: fix(config): make local dotenv optional Load a private .env when present, but keep CI configuration in GitHub runtime variables and retain the tracked template as a guide. --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index c412abb..0d8772c 100644 --- a/Justfile +++ b/Justfile @@ -1,4 +1,4 @@ -set dotenv-filename := "image-template.env" +set dotenv-filename := ".env" set dotenv-load export image_name := env_var("IMAGE_NAME") -- cgit v1.2.3 From 8f9bc7c6133f466355e5538e066379e7f3366ae4 Mon Sep 17 00:00:00 2001 From: tranch Date: Wed, 26 Aug 2026 17:29:49 +0800 Subject: fix: align testing channel metadata Make the build tag authoritative for image branch and version metadata. Avoid hard-coded stable image tags and add regression coverage. --- Justfile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 0d8772c..96b988f 100644 --- a/Justfile +++ b/Justfile @@ -130,7 +130,17 @@ build $target_image=image_name $tag=default_tag: BUILD_ARGS=() LABELS=() - for arg in BASE_IMAGE IMAGE_BRANCH VERSION_TAG VERSION_PRETTY FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN OSTREE_IMAGE_REF INSTRUMENTS_ENABLED INSTRUMENTS_RELEASE_REPOSITORY INSTRUMENTS_VERSION INSTRUMENTS_RELEASE_API_BASE; do + # The recipe tag is the channel selected by commands such as + # `just build localhost/aerocore-os testing`. Keep the image's internal + # channel/version metadata aligned with that tag instead of allowing a + # stale dotenv value (for example, `stable`) to leak into the image. + BUILD_CHANNEL_ARGS=( + "--build-arg" "IMAGE_BRANCH={{ tag }}" + "--build-arg" "VERSION_TAG={{ tag }}" + "--build-arg" "VERSION_PRETTY={{ tag }}" + ) + + for arg in BASE_IMAGE FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN OSTREE_IMAGE_REF INSTRUMENTS_ENABLED INSTRUMENTS_RELEASE_REPOSITORY INSTRUMENTS_VERSION INSTRUMENTS_RELEASE_API_BASE; do if [[ -n "${!arg:-}" ]]; then BUILD_ARGS+=("--build-arg" "${arg}=${!arg}") fi @@ -142,7 +152,7 @@ build $target_image=image_name $tag=default_tag: LABELS+=("--label" "org.opencontainers.image.documentation=https://raw.githubusercontent.com/{{ repo_organization }}/{{ image_name }}/${GIT_SHA}/README.md") LABELS+=("--label" "org.opencontainers.image.source=https://github.com/{{ repo_organization }}/{{ image_name }}/blob/${GIT_SHA}/Containerfile") LABELS+=("--label" "org.opencontainers.image.url=https://github.com/{{ repo_organization }}/{{ image_name }}/tree/${GIT_SHA}") - LABELS+=("--label" "org.opencontainers.image.version={{ VERSION_TAG }}-${GIT_SHA}") + LABELS+=("--label" "org.opencontainers.image.version={{ tag }}-${GIT_SHA}") fi # Image metadata for https://artifacthub.io/ - This is optional but is highly recommended so we all can get a index of all the custom images @@ -158,7 +168,7 @@ build $target_image=image_name $tag=default_tag: LABELS+=("--label" "org.opencontainers.image.vendor={{ repo_organization }}") # This actually builds the image! - PODMAN_BUILD_ARGS=("${BUILD_ARGS[@]}" "${LABELS[@]}" --pull=newer --tag "${target_image}:${tag}" --file Containerfile) + PODMAN_BUILD_ARGS=("${BUILD_CHANNEL_ARGS[@]}" "${BUILD_ARGS[@]}" "${LABELS[@]}" --pull=newer --tag "${target_image}:${tag}" --file Containerfile) podman build "${PODMAN_BUILD_ARGS[@]}" . -- cgit v1.2.3 From 8774e3cf7db1f8ad37e659017f6b363f54f9d79d Mon Sep 17 00:00:00 2001 From: tranch Date: Thu, 27 Aug 2026 04:37:18 +0800 Subject: fix: authenticate Booster release downloads Mount the CI token as a build secret for release asset requests. --- Justfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 96b988f..9a9c75a 100644 --- a/Justfile +++ b/Justfile @@ -168,7 +168,9 @@ build $target_image=image_name $tag=default_tag: LABELS+=("--label" "org.opencontainers.image.vendor={{ repo_organization }}") # This actually builds the image! - PODMAN_BUILD_ARGS=("${BUILD_CHANNEL_ARGS[@]}" "${BUILD_ARGS[@]}" "${LABELS[@]}" --pull=newer --tag "${target_image}:${tag}" --file Containerfile) + # The build always exposes a secret mount. Local builds use /dev/null; + # CI supplies a short-lived GitHub token file for private release assets. + PODMAN_BUILD_ARGS=("${BUILD_CHANNEL_ARGS[@]}" "${BUILD_ARGS[@]}" "${LABELS[@]}" --secret "id=GITHUB_TOKEN,src=${GITHUB_TOKEN_FILE:-/dev/null}" --pull=newer --tag "${target_image}:${tag}" --file Containerfile) podman build "${PODMAN_BUILD_ARGS[@]}" . -- cgit v1.2.3 From 61db44fb679bb3d2606cca0dcadac309edff0475 Mon Sep 17 00:00:00 2001 From: tranch Date: Wed, 9 Sep 2026 14:15:56 +0800 Subject: chore: add Bazzite 44 testing candidate flow --- Justfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index 9a9c75a..bf8e217 100644 --- a/Justfile +++ b/Justfile @@ -8,10 +8,10 @@ export image_keywords := env_var("IMAGE_KEYWORDS") export image_logo_url := env_var("IMAGE_LOGO_URL") export default_tag := env_var("DEFAULT_TAG") export bib_image := env_var("BIB_IMAGE") -export IMAGE_BRANCH := env_var_or_default("IMAGE_BRANCH", "stable") +export IMAGE_BRANCH := env_var_or_default("IMAGE_BRANCH", "testing-candidate") export VERSION_TAG := env_var_or_default("VERSION_TAG", default_tag) export VERSION_PRETTY := env_var_or_default("VERSION_PRETTY", VERSION_TAG) -export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:stable") +export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:testing-44.20260908.3") export OSTREE_IMAGE_REF := env_var_or_default("OSTREE_IMAGE_REF", "ostree-image-signed:docker://ghcr.io/" + repo_organization + "/" + image_name) export LIVE_BASE_IMAGE := env_var_or_default("LIVE_BASE_IMAGE", "quay.io/fedora/fedora-kinoite:44") export TITANOBOA_REPOSITORY := env_var_or_default("TITANOBOA_REPOSITORY", "https://github.com/Zeglius/titanoboa.git") -- cgit v1.2.3 From 740a8e2cfce7579ddc0068413490b6ad8ea3fcc7 Mon Sep 17 00:00:00 2001 From: tranch Date: Thu, 10 Sep 2026 22:24:31 +0800 Subject: Align image versions with Bazzite date tags Generate date-based image versions in CI and preserve VERSION_TAG through the Justfile build. --- Justfile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index bf8e217..c8a38a0 100644 --- a/Justfile +++ b/Justfile @@ -111,8 +111,8 @@ sudoif command *args: # $target_image - The tag you want to apply to the image (default: $image_name). # $tag - The tag for the image (default: $default_tag). # -# If the git working directory is clean, it appends the short SHA of the current HEAD -# to the version tag supplied by the build environment. +# If the git working directory is clean, it labels the image with the current HEAD +# revision while keeping the image version on the build environment's VERSION_TAG. # # just build $target_image $tag # @@ -131,13 +131,13 @@ build $target_image=image_name $tag=default_tag: BUILD_ARGS=() LABELS=() # The recipe tag is the channel selected by commands such as - # `just build localhost/aerocore-os testing`. Keep the image's internal - # channel/version metadata aligned with that tag instead of allowing a - # stale dotenv value (for example, `stable`) to leak into the image. + # `just build localhost/aerocore-os testing`. VERSION_TAG and + # VERSION_PRETTY may be supplied by CI and should remain the release + # version stamped inside the image. BUILD_CHANNEL_ARGS=( "--build-arg" "IMAGE_BRANCH={{ tag }}" - "--build-arg" "VERSION_TAG={{ tag }}" - "--build-arg" "VERSION_PRETTY={{ tag }}" + "--build-arg" "VERSION_TAG=${VERSION_TAG:-{{ tag }}}" + "--build-arg" "VERSION_PRETTY=${VERSION_PRETTY:-${VERSION_TAG:-{{ tag }}}}" ) for arg in BASE_IMAGE FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN OSTREE_IMAGE_REF INSTRUMENTS_ENABLED INSTRUMENTS_RELEASE_REPOSITORY INSTRUMENTS_VERSION INSTRUMENTS_RELEASE_API_BASE; do @@ -150,9 +150,10 @@ build $target_image=image_name $tag=default_tag: GIT_SHA=$(git rev-parse --short HEAD) LABELS+=("--label" "io.artifacthub.package.readme-url=https://raw.githubusercontent.com/{{ repo_organization }}/{{ image_name }}/${GIT_SHA}/README.md") LABELS+=("--label" "org.opencontainers.image.documentation=https://raw.githubusercontent.com/{{ repo_organization }}/{{ image_name }}/${GIT_SHA}/README.md") + LABELS+=("--label" "org.opencontainers.image.revision=${GIT_SHA}") LABELS+=("--label" "org.opencontainers.image.source=https://github.com/{{ repo_organization }}/{{ image_name }}/blob/${GIT_SHA}/Containerfile") LABELS+=("--label" "org.opencontainers.image.url=https://github.com/{{ repo_organization }}/{{ image_name }}/tree/${GIT_SHA}") - LABELS+=("--label" "org.opencontainers.image.version={{ tag }}-${GIT_SHA}") + LABELS+=("--label" "org.opencontainers.image.version=${VERSION_TAG:-{{ tag }}}") fi # Image metadata for https://artifacthub.io/ - This is optional but is highly recommended so we all can get a index of all the custom images -- cgit v1.2.3 From d209ea6aa515d7e356cfb4ae32f612459e36dafe Mon Sep 17 00:00:00 2001 From: tranch Date: Fri, 11 Sep 2026 02:34:45 +0800 Subject: =?UTF-8?q?=E4=BB=A5=20Bazzite=20stable-44.20260908=20=E4=B8=BA=20?= =?UTF-8?q?testing=20=E9=AA=8C=E8=AF=81=E5=9F=BA=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Justfile') diff --git a/Justfile b/Justfile index c8a38a0..a83ba0a 100644 --- a/Justfile +++ b/Justfile @@ -11,7 +11,7 @@ export bib_image := env_var("BIB_IMAGE") export IMAGE_BRANCH := env_var_or_default("IMAGE_BRANCH", "testing-candidate") export VERSION_TAG := env_var_or_default("VERSION_TAG", default_tag) export VERSION_PRETTY := env_var_or_default("VERSION_PRETTY", VERSION_TAG) -export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:testing-44.20260908.3") +export BASE_IMAGE := env_var_or_default("BASE_IMAGE", "ghcr.io/ublue-os/bazzite-deck:stable-44.20260908") export OSTREE_IMAGE_REF := env_var_or_default("OSTREE_IMAGE_REF", "ostree-image-signed:docker://ghcr.io/" + repo_organization + "/" + image_name) export LIVE_BASE_IMAGE := env_var_or_default("LIVE_BASE_IMAGE", "quay.io/fedora/fedora-kinoite:44") export TITANOBOA_REPOSITORY := env_var_or_default("TITANOBOA_REPOSITORY", "https://github.com/Zeglius/titanoboa.git") -- cgit v1.2.3