feat: Add bootc support (#448)

Adds support for using `bootc` as the preferred method for booting from
a locally created image. This new method gets rid of the need to create
a tarball and move it to the correct place and instead it will make use
of `podman scp` which copies the image to the root `containers-storage`
and then has `rpm-ostree` and `bootc` boot from that store.

Closes #418 
Closes #200
This commit is contained in:
Gerald Pinder 2025-08-09 14:05:59 -04:00 committed by GitHub
parent 2c525854c9
commit 3a0be4099a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
65 changed files with 2991 additions and 1857 deletions

View file

@ -44,6 +44,35 @@ color_string() {
fi
}
feature_enabled() {
# Ensure the function is called with exactly one argument
if [ "$#" -ne 1 ]; then
echo "Usage: feature_enabled <feature_name>" >&2
return 1
fi
local feature="$1"
local -a features
# Split BB_BUILD_FEATURES by commas and read into an array
IFS=,
read -r -a features <<< "$BB_BUILD_FEATURES"
# Loop through the array and check for a match
for f in "${features[@]}"; do
# Trim leading and trailing whitespace
local trimmed_f="${f## }"
trimmed_f="${trimmed_f%% }"
if [[ "$trimmed_f" == "$feature" ]]; then
return 0
fi
done
# Feature not found
return 1
}
# Parse OS version and export it
export OS_VERSION="$(awk -F= '/^VERSION_ID=/ {gsub(/"/, "", $2); print $2}' /usr/lib/os-release)"
export OS_ARCH="$(uname -m)"

View file

@ -1,9 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
. /scripts/exports.sh
rm -rf /tmp/* /var/*
# if command -v bootc > /dev/null; then
# bootc container lint
# fi
if feature_enabled "bootc" && command -v bootc > /dev/null; then
bootc container lint
fi