Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 --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 && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -41,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
Expand Down