diff --git a/Containerfile.common b/Containerfile.common index 1e4e6da1..5c6b88e3 100644 --- a/Containerfile.common +++ b/Containerfile.common @@ -61,6 +61,14 @@ RUN --mount=type=cache,dst=/var/cache/dnf \ done && \ find /var/cache/rpms +# Remove kernel version from kmod package names +# FIXME: This will only work for 6.* kernels unfortunately +RUN set -e; for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \ + basename=$(basename ${rpm}); \ + name=${basename%%-6*}; \ + fpm -s rpm -t rpm -p ${rpm} -f --name ${name} ${rpm}; \ + done + FROM scratch COPY --from=builder /var/cache/rpms /rpms diff --git a/Containerfile.extra b/Containerfile.extra index 62a6744e..2fcc02ab 100644 --- a/Containerfile.extra +++ b/Containerfile.extra @@ -61,6 +61,14 @@ RUN --mount=type=cache,dst=/var/cache/dnf \ done && \ find /var/cache/rpms +# Remove kernel version from kmod package names +# FIXME: This will only work for 6.* kernels unfortunately +RUN set -e; for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \ + basename=$(basename ${rpm}); \ + name=${basename%%-6*}; \ + fpm -s rpm -t rpm -p ${rpm} -f --name ${name} ${rpm}; \ + done + FROM scratch COPY --from=builder /var/cache/rpms /rpms diff --git a/Containerfile.nvidia b/Containerfile.nvidia index 6569f72a..63da8f21 100644 --- a/Containerfile.nvidia +++ b/Containerfile.nvidia @@ -58,6 +58,14 @@ RUN --mount=type=cache,dst=/var/cache/dnf \ done && \ find /var/cache/rpms +# Remove kernel version from kmod package names +# FIXME: This will only work for 6.* kernels unfortunately +RUN set -e; for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \ + basename=$(basename ${rpm}); \ + name=${basename%%-6*}; \ + fpm -s rpm -t rpm -p ${rpm} -f --name ${name} ${rpm}; \ + done + FROM scratch COPY --from=builder /var/cache/rpms /rpms diff --git a/Containerfile.nvidia-open b/Containerfile.nvidia-open index 71f008de..f869bcd0 100644 --- a/Containerfile.nvidia-open +++ b/Containerfile.nvidia-open @@ -58,6 +58,14 @@ RUN --mount=type=cache,dst=/var/cache/dnf \ done && \ find /var/cache/rpms +# Remove kernel version from kmod package names +# FIXME: This will only work for 6.* kernels unfortunately +RUN set -e; for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \ + basename=$(basename ${rpm}); \ + name=${basename%%-6*}; \ + fpm -s rpm -t rpm -p ${rpm} -f --name ${name} ${rpm}; \ + done + FROM scratch COPY --from=builder /var/cache/rpms /rpms