From 3e567793ab4c5fbb3741cd737c1db136b98ca3d7 Mon Sep 17 00:00:00 2001 From: Gregory Giguashvili Date: Sat, 10 Jan 2026 10:21:43 +0200 Subject: [PATCH 1/4] Add rpm repo configuration script to RHEL base images --- .../group1/rhel94-test-agent.containerfile | 10 +++--- .../group1/rhel96-test-agent.containerfile | 10 +++--- .../group1/rpm-repo-config.sh.template | 35 +++++++++++++++++++ 3 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 test/image-blueprints-bootc/layer1-base/group1/rpm-repo-config.sh.template diff --git a/test/image-blueprints-bootc/layer1-base/group1/rhel94-test-agent.containerfile b/test/image-blueprints-bootc/layer1-base/group1/rhel94-test-agent.containerfile index 0f675e600a..190dcabb27 100644 --- a/test/image-blueprints-bootc/layer1-base/group1/rhel94-test-agent.containerfile +++ b/test/image-blueprints-bootc/layer1-base/group1/rhel94-test-agent.containerfile @@ -4,16 +4,18 @@ FROM registry.redhat.io/rhel9-eus/rhel-9.4-bootc:9.4 ARG USHIFT_RPM_REPO_NAME=microshift-local ARG USHIFT_RPM_REPO_PATH=/tmp/$USHIFT_RPM_REPO_NAME +# Configure the RPM repositories (without EUS enabled) +COPY --chmod=755 ./bootc-images/rpm-repo-config.sh /tmp/rpm-repo-config.sh +RUN /tmp/rpm-repo-config.sh && rm -f /tmp/rpm-repo-config.sh + # Copy the MicroShift repository contents COPY ./rpm-repos/$USHIFT_RPM_REPO_NAME $USHIFT_RPM_REPO_PATH # Copy repository configuration COPY ./bootc-images/$USHIFT_RPM_REPO_NAME.repo /etc/yum.repos.d/ -# Print repository configuration contents. -# Install test agent and cleanup. -RUN dnf repoinfo --enabled && \ - dnf install -y microshift-test-agent && \ +# Install the test agent and cleanup +RUN dnf install -y microshift-test-agent && \ systemctl enable microshift-test-agent && \ rm -vf /etc/yum.repos.d/microshift-*.repo && \ rm -rvf $USHIFT_RPM_REPO_PATH && \ diff --git a/test/image-blueprints-bootc/layer1-base/group1/rhel96-test-agent.containerfile b/test/image-blueprints-bootc/layer1-base/group1/rhel96-test-agent.containerfile index 0fb3dc0573..d08f10fb5d 100644 --- a/test/image-blueprints-bootc/layer1-base/group1/rhel96-test-agent.containerfile +++ b/test/image-blueprints-bootc/layer1-base/group1/rhel96-test-agent.containerfile @@ -4,16 +4,18 @@ FROM registry.redhat.io/rhel9-eus/rhel-9.6-bootc:9.6 ARG USHIFT_RPM_REPO_NAME=microshift-local ARG USHIFT_RPM_REPO_PATH=/tmp/$USHIFT_RPM_REPO_NAME +# Configure the RPM repositories (with EUS enabled) +COPY --chmod=755 ./bootc-images/rpm-repo-config.sh /tmp/rpm-repo-config.sh +RUN /tmp/rpm-repo-config.sh --enable-eus && rm -f /tmp/rpm-repo-config.sh + # Copy the MicroShift repository contents COPY ./rpm-repos/$USHIFT_RPM_REPO_NAME $USHIFT_RPM_REPO_PATH # Copy repository configuration COPY ./bootc-images/$USHIFT_RPM_REPO_NAME.repo /etc/yum.repos.d/ -# Print repository configuration contents. -# Install test agent and cleanup. -RUN dnf repoinfo --enabled && \ - dnf install -y microshift-test-agent && \ +# Install the test agent and cleanup +RUN dnf install -y microshift-test-agent && \ systemctl enable microshift-test-agent && \ rm -vf /etc/yum.repos.d/microshift-*.repo && \ rm -rvf $USHIFT_RPM_REPO_PATH && \ diff --git a/test/image-blueprints-bootc/layer1-base/group1/rpm-repo-config.sh.template b/test/image-blueprints-bootc/layer1-base/group1/rpm-repo-config.sh.template new file mode 100644 index 0000000000..7e85fae676 --- /dev/null +++ b/test/image-blueprints-bootc/layer1-base/group1/rpm-repo-config.sh.template @@ -0,0 +1,35 @@ +#!/bin/bash +set -euo pipefail +set -x + +function enable_eus_repositories() { + local -r vmajor="$(awk -F. '{print $1}' <<< "${VERSION_ID}")" + local -r vminor="$(awk -F. '{print $2}' <<< "${VERSION_ID}")" + + dnf config-manager --set-disabled '*' + dnf config-manager --set-enabled \ + "rhel-${vmajor}-for-$(uname -m)-baseos-eus-rpms" \ + "rhel-${vmajor}-for-$(uname -m)-appstream-eus-rpms" +} + +# Lock the OS release version to prevent the installation of packages belonging +# to a newer OS release +source /etc/os-release +echo "${VERSION_ID}" > /etc/dnf/vars/releasever + +# Process the command line arguments +while [ $# -gt 0 ] ; do + case "$1" in + --enable-eus) + enable_eus_repositories + shift + ;; + *) + echo "Unknown option: $1" + exit 1 + ;; + esac +done + +# Print the enabled repositories +dnf repoinfo --enabled From 2e271555ee92c09a2308d8ff5bf3214b2dbfa9f9 Mon Sep 17 00:00:00 2001 From: Gregory Giguashvili Date: Sat, 10 Jan 2026 10:24:03 +0200 Subject: [PATCH 2/4] Remove redundant rpm repo configuration from build-serialsim.sh script --- .../group2/build-serialsim.sh.template | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/test/image-blueprints-bootc/layer1-base/group2/build-serialsim.sh.template b/test/image-blueprints-bootc/layer1-base/group2/build-serialsim.sh.template index e2c8d9a3ca..1477ea37fa 100644 --- a/test/image-blueprints-bootc/layer1-base/group2/build-serialsim.sh.template +++ b/test/image-blueprints-bootc/layer1-base/group2/build-serialsim.sh.template @@ -13,25 +13,12 @@ function get_kernel_ver() { # Set the current kernel version and architecture variables. get_kernel_ver -# Lock the OS release version to prevent the installation of a newer kernel package -# belonging to a newer OS release. +# On CentOS, attempt to install the kernel-devel package for the current kernel +# version, falling back to kernel-devel-matched if the former is not available. source /etc/os-release -echo "${VERSION_ID}" > /etc/dnf/vars/releasever - if [[ "${ID}" == "rhel" ]] ; then - # On RHEL, enable RHEL EUS repositories to allow the installation of the - # kernel-devel package for the current kernel version. - VERSION_ID_MAJOR="$(awk -F. '{print $1}' <<< "${VERSION_ID}")" - VERSION_ID_MINOR="$(awk -F. '{print $2}' <<< "${VERSION_ID}")" - if (( "${VERSION_ID_MINOR}" % 2 == 0 )) ; then - dnf config-manager --set-enabled \ - "rhel-${VERSION_ID_MAJOR}-for-$(uname -m)-baseos-eus-rpms" \ - "rhel-${VERSION_ID_MAJOR}-for-$(uname -m)-appstream-eus-rpms" - fi dnf install -y "kernel-devel-${KERNEL_VER}" else - # On CentOS, attempt to install the kernel-devel package for the current kernel - # version, falling back to kernel-devel-matched if the former is not available. dnf install -y "kernel-devel-${KERNEL_VER}" || dnf install -y kernel-devel-matched fi From 243ba977faa26b537214558ae379308fa78c2fbb Mon Sep 17 00:00:00 2001 From: Gregory Giguashvili Date: Fri, 16 Jan 2026 09:32:38 +0200 Subject: [PATCH 3/4] Enable EUS repos for rhel-9.4 bootc images --- .../layer1-base/group1/rhel94-test-agent.containerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/image-blueprints-bootc/layer1-base/group1/rhel94-test-agent.containerfile b/test/image-blueprints-bootc/layer1-base/group1/rhel94-test-agent.containerfile index 190dcabb27..200ae4e05d 100644 --- a/test/image-blueprints-bootc/layer1-base/group1/rhel94-test-agent.containerfile +++ b/test/image-blueprints-bootc/layer1-base/group1/rhel94-test-agent.containerfile @@ -6,7 +6,7 @@ ARG USHIFT_RPM_REPO_PATH=/tmp/$USHIFT_RPM_REPO_NAME # Configure the RPM repositories (without EUS enabled) COPY --chmod=755 ./bootc-images/rpm-repo-config.sh /tmp/rpm-repo-config.sh -RUN /tmp/rpm-repo-config.sh && rm -f /tmp/rpm-repo-config.sh +RUN /tmp/rpm-repo-config.sh --enable-eus && rm -f /tmp/rpm-repo-config.sh # Copy the MicroShift repository contents COPY ./rpm-repos/$USHIFT_RPM_REPO_NAME $USHIFT_RPM_REPO_PATH From 95c3943b99179e05cf729f848e31459b4d9d0cd2 Mon Sep 17 00:00:00 2001 From: Gregory Giguashvili Date: Fri, 16 Jan 2026 17:37:29 +0200 Subject: [PATCH 4/4] Do not remove releasever in serialsim.sh script --- .../layer1-base/group2/build-serialsim.sh.template | 1 - 1 file changed, 1 deletion(-) diff --git a/test/image-blueprints-bootc/layer1-base/group2/build-serialsim.sh.template b/test/image-blueprints-bootc/layer1-base/group2/build-serialsim.sh.template index 1477ea37fa..de23aa49a7 100644 --- a/test/image-blueprints-bootc/layer1-base/group2/build-serialsim.sh.template +++ b/test/image-blueprints-bootc/layer1-base/group2/build-serialsim.sh.template @@ -28,7 +28,6 @@ get_kernel_ver # Install the necessary dependencies and clean up. dnf install -y git make python3-pyserial dnf clean all -rm -f /etc/dnf/vars/releasever # Clone the serialsim repository and build the serialsim module. git clone https://github.com/pmtk/serialsim.git /tmp/serialsim