diff --git a/docker/Dockerfile.rhel7 b/docker/Dockerfile.rhel7 index 2d0bd0dba..cfb1ed56c 100644 --- a/docker/Dockerfile.rhel7 +++ b/docker/Dockerfile.rhel7 @@ -21,7 +21,6 @@ RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Cri make \ patch \ perl \ - redhat-rpm-config \ yum-utils \ && \ yum clean all -y && \ diff --git a/docker/Dockerfile.rhel8 b/docker/Dockerfile.rhel8 index e4b45779c..64e62290c 100644 --- a/docker/Dockerfile.rhel8 +++ b/docker/Dockerfile.rhel8 @@ -3,7 +3,7 @@ FROM $EXTRAPKGS as extrapkgs # by checking for /pkgs we can cache that step # and prepare images that already contain the packages. RUN mkdir /pkgs -RUN dnf install -y 'dnf-command(download)' && cd /pkgs && dnf download elfutils-libelf-devel kernel-rpm-macros && rm -f *.i686.rpm # !lbbuild +RUN dnf install -y 'dnf-command(download)' && cd /pkgs && dnf download elfutils-libelf-devel && rm -f *.i686.rpm # !lbbuild FROM registry.access.redhat.com/ubi8/ubi MAINTAINER Roland Kammerer @@ -39,7 +39,7 @@ RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Cri COPY --from=extrapkgs /pkgs /pkgs RUN yum install -y /pkgs/*.rpm # !lbbuild # or -# =lbbuild RUN curl -fsSL https://nexus.at.linbit.com/repository/lbbuild/from_rhel_repos.sh | bash -s -- elfutils-libelf-devel kernel-rpm-macros +# =lbbuild RUN curl -fsSL https://nexus.at.linbit.com/repository/lbbuild/from_rhel_repos.sh | bash -s -- elfutils-libelf-devel RUN rm -rf /pkgs diff --git a/docker/Dockerfile.rhel9 b/docker/Dockerfile.rhel9 index f1734822d..db3d339a2 100644 --- a/docker/Dockerfile.rhel9 +++ b/docker/Dockerfile.rhel9 @@ -3,7 +3,7 @@ FROM $EXTRAPKGS as extrapkgs # by checking for /pkgs we can cache that step # and prepare images that already contain the packages. RUN mkdir /pkgs -RUN dnf install -y 'dnf-command(download)' && cd /pkgs && dnf download elfutils-libelf-devel kernel-rpm-macros && rm -f *.i686.rpm # !lbbuild +RUN dnf install -y 'dnf-command(download)' && cd /pkgs && dnf download elfutils-libelf-devel && rm -f *.i686.rpm # !lbbuild FROM registry.access.redhat.com/ubi9/ubi MAINTAINER Roland Kammerer @@ -37,7 +37,7 @@ RUN dnf -y update-minimal --security --sec-severity=Important --sec-severity=Cri COPY --from=extrapkgs /pkgs /pkgs RUN dnf install -y /pkgs/*.rpm # !lbbuild # or -# =lbbuild RUN curl -fsSL https://nexus.at.linbit.com/repository/lbbuild/from_rhel_repos.sh | bash -s -- elfutils-libelf-devel kernel-rpm-macros +# =lbbuild RUN curl -fsSL https://nexus.at.linbit.com/repository/lbbuild/from_rhel_repos.sh | bash -s -- elfutils-libelf-devel RUN rm -rf /pkgs diff --git a/docker/entry.sh b/docker/entry.sh index 50ec3ce14..c196bd7a8 100755 --- a/docker/entry.sh +++ b/docker/entry.sh @@ -189,9 +189,26 @@ kos::rpm::bestbyrpmprovides() { local drbd_requires_file shift 1 - sort > "$kernel_provides_file" \ - <(find "/lib/modules/$(uname -r)" -name "symvers*" | /lib/rpm/kabi.sh) \ - <(find "/lib/modules/$(uname -r)/kernel" -type f | /lib/rpm/redhat/find-provides.ksyms) + local kernel_symvers + local cat_prog + if [ -e "/lib/modules/"$(uname -r)"/symvers" ]; then + kernel_symvers="/lib/modules/"$(uname -r)"/symvers" + cat_prog=cat + elif [ -e "/lib/modules/"$(uname -r)"/symvers.gz" ]; then + kernel_symvers="/lib/modules/"$(uname -r)"/symvers.gz" + cat_prog=zcat + elif [ -e "/lib/modules/"$(uname -r)"/symvers.xz" ]; then + kernel_symvers="/lib/modules/"$(uname -r)"/symvers.xz" + cat_prog=xzcat + else + debug "Failed to find kernel symvers file" + return 1 + fi + + "$cat_prog" "$kernel_symvers" \ + | awk -F"\t" '{ print "kernel(" $2 ") = " $1 }' \ + | sort \ + > "$kernel_provides_file" if [ ! -s "$kernel_provides_file" ]; then debug "Failed to generate kernel provides"