1
0
mirror of https://github.com/coreos/fedora-coreos-config.git synced 2026-02-05 09:45:30 +01:00

Add concept of a buildroot-prep script

We want to fast-track the backport of
https://github.com/coreos/rpm-ostree/pull/5475 to unblock switch f44
and f43 over to the buildah path. Since this is likely not the first
time we'll do this and likely not only for FCOS, add a new concept of
an optional `buildroot-prep` script which can do $things like updating
packages before entering build-rootfs.

That specific script added here will not be automatically inherited by
coreos/rhel-coreos-config.
This commit is contained in:
Jonathan Lebon
2025-08-27 15:24:07 -04:00
committed by Dusty Mabe
parent 534fa61e80
commit 1c0725eb93
2 changed files with 21 additions and 0 deletions

View File

@@ -23,6 +23,10 @@ ARG MANIFEST=overridden
# XXX: see inject_passwd_group() in build-rootfs
ARG PASSWD_GROUP_DIR
# this allows FCOS/SCOS/RHCOS to do specific things before going into the shared build-rootfs script
RUN --mount=type=bind,target=/run/src \
if test -x /run/src/buildroot-prep; then /run/src/buildroot-prep; fi
# useful if you're hacking on rpm-ostree/bootc-base-imagectl
# COPY rpm-ostree /usr/bin/
# COPY bootc-base-imagectl /usr/libexec/

17
buildroot-prep Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail
arch=$(uname -m)
. /etc/os-release
# fast-track backport of https://github.com/coreos/rpm-ostree/pull/5475
case "$VERSION_ID" in
43) urls=(https://kojipkgs.fedoraproject.org//packages/rpm-ostree/2025.10/3.fc43/"$arch"/rpm-ostree-{,libs-}2025.10-3.fc43."$arch".rpm);;
44) urls=(https://kojipkgs.fedoraproject.org//packages/rpm-ostree/2025.10/3.fc44/"$arch"/rpm-ostree-{,libs-}2025.10-3.fc44."$arch".rpm);;
*) exit 0;;
esac
if rpm -q "rpm-ostree-2025.10-1.fc43.$arch"; then
sudo dnf install -y "${urls[@]}"
fi