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:
parent
2c525854c9
commit
3a0be4099a
65 changed files with 2991 additions and 1857 deletions
|
|
@ -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)"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue