Skip to content

Commit

Permalink
docker: add rockylinux:9
Browse files Browse the repository at this point in the history
Closes #415

Signed-off-by: Seow, Wen Jie <[email protected]>
Co-authored-by: Wei Shan <[email protected]>
  • Loading branch information
j-chiam and weishan18 authored Mar 5, 2025
1 parent 3dea438 commit 1c87076
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 4 deletions.
1 change: 1 addition & 0 deletions distro/adaptation-pkg/rocky
2 changes: 1 addition & 1 deletion distro/adaptation/centos-9
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ grub-common: grub2-common
libbabeltrace-ctf-dev: libbabeltrace-devel
libbabeltrace-ctf1: libbabeltrace
libbabeltrace-dev: libbabeltrace-devel
libbpf-dev: libbpf-devel-1.3.0
libbpf-dev: libbpf-devel
libclang-dev: clang-devel
libcunit1-dev: CUnit-devel
libdw1: libdwarves1
Expand Down
1 change: 1 addition & 0 deletions distro/adaptation/rocky
1 change: 1 addition & 0 deletions distro/adaptation/rocky-9
1 change: 1 addition & 0 deletions distro/installer/rocky
27 changes: 27 additions & 0 deletions docker/rockylinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# base image can be fedora:38, fedora:39 and etc
ARG base_image
FROM ${base_image}

# lkp install generates hosts/$HOSTNAME during create_host_config. Here it requires
# user to pass hostname arg to specify a consistent name instead of the container
# hostname when building the image.
ARG hostname=lkp-docker
ENV HOSTNAME=${hostname}

WORKDIR /lkp/lkp-tests

COPY . ./

RUN dnf upgrade -y && \
dnf install -y \
# kernel-tools installs turbostat
kernel-tools \
make \
# procps installs vmstat, sysctl, etc to partially persistent commonly used dependencies
procps \
perf \
hostname && \
make install && \
lkp install

ENTRYPOINT ["bash", "-c", "sleep infinity"]
6 changes: 6 additions & 0 deletions lib/detect-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ detect_system()
then
_system_version="$(awk -F'=' '$1=="VERSION_ID"{gsub(/"/,"");print $2}' ${rootfs}/etc/os-release | head -n 1)"
_system_name="Amazon Linux"
elif
[ -f ${rootfs}/etc/os-release ] &&
GREP_OPTIONS="" \command \grep 'ID="rocky"' ${rootfs}/etc/os-release >/dev/null
then
_system_name="Rocky"
_system_version="$(awk -F'=' '$1=="VERSION_ID"{gsub(/"/,"");print $2}' ${rootfs}/etc/os-release | awk -F'.' '{print $1}' | head -n 1)"
elif
[ -f ${rootfs}/etc/os-release ] &&
(GREP_OPTIONS="" \command \grep 'ID="opensuse-leap"' ${rootfs}/etc/os-release >/dev/null ||
Expand Down
5 changes: 4 additions & 1 deletion lib/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sync_distro_sources()
else
yum update
fi ;;
redhat) yum update ;;
redhat|rocky) yum update ;;
archlinux) yay -Sy --needed;;
opensuse)
zypper update ;;
Expand Down Expand Up @@ -151,6 +151,9 @@ map_python_packages()
opensuse-*)
map_python2_to_python3
;;
rocky-[9]*)
map_python2_to_python3
;;
esac
}

Expand Down
7 changes: 5 additions & 2 deletions lkp-exec/install
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ install_base_support()
create_host_config
}

enable_centos_source()
enable_source_repository()
{
if ! yum list installed | grep -q yum-utils; then
yum install -y yum-utils
Expand All @@ -388,7 +388,10 @@ distro=$_system_name_lowercase
echo "distro=$distro"
echo "version=$_system_version"

[ "$distro" = "centos" ] && enable_centos_source
# Enable source repositories for CentOS and Rocky Linux
if [ "$distro" = "centos" ] || [ "$distro" = "rocky" ]; then
enable_source_repository
fi

DISTRO=$distro
export DISTRO
Expand Down

0 comments on commit 1c87076

Please sign in to comment.