diff --git a/Containerfile.common b/Containerfile.common index 1e4e6da1..af22b5af 100644 --- a/Containerfile.common +++ b/Containerfile.common @@ -61,6 +61,17 @@ 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 +# FIXME: The sed is a gross hack, maybe PR upstream? +RUN set -e; \ + sed -i -e 's/args = \["rpmbuild", "-bb"\]/args = \["rpmbuild", "-bb", "--buildroot", "#{build_path}\/BUILD"\]/g' /usr/local/share/gems/gems/fpm-*/lib/fpm/package/rpm.rb; \ + for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \ + basename=$(basename ${rpm}); \ + name=${basename%%-6*}; \ + fpm --verbose -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..5e3e0012 100644 --- a/Containerfile.extra +++ b/Containerfile.extra @@ -61,6 +61,17 @@ 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 +# FIXME: The sed is a gross hack, maybe PR upstream? +RUN set -e; \ + sed -i -e 's/args = \["rpmbuild", "-bb"\]/args = \["rpmbuild", "-bb", "--buildroot", "#{build_path}\/BUILD"\]/g' /usr/local/share/gems/gems/fpm-*/lib/fpm/package/rpm.rb; \ + for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \ + basename=$(basename ${rpm}); \ + name=${basename%%-6*}; \ + fpm --verbose -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..be15ec0a 100644 --- a/Containerfile.nvidia +++ b/Containerfile.nvidia @@ -58,6 +58,17 @@ 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 +# FIXME: The sed is a gross hack, maybe PR upstream? +RUN set -e; \ + sed -i -e 's/args = \["rpmbuild", "-bb"\]/args = \["rpmbuild", "-bb", "--buildroot", "#{build_path}\/BUILD"\]/g' /usr/local/share/gems/gems/fpm-*/lib/fpm/package/rpm.rb; \ + for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \ + basename=$(basename ${rpm}); \ + name=${basename%%-6*}; \ + fpm --verbose -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..bf6b7184 100644 --- a/Containerfile.nvidia-open +++ b/Containerfile.nvidia-open @@ -58,6 +58,17 @@ 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 +# FIXME: The sed is a gross hack, maybe PR upstream? +RUN set -e; \ + sed -i -e 's/args = \["rpmbuild", "-bb"\]/args = \["rpmbuild", "-bb", "--buildroot", "#{build_path}\/BUILD"\]/g' /usr/local/share/gems/gems/fpm-*/lib/fpm/package/rpm.rb; \ + for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \ + basename=$(basename ${rpm}); \ + name=${basename%%-6*}; \ + fpm --verbose -s rpm -t rpm -p ${rpm} -f --name ${name} ${rpm}; \ + done + FROM scratch COPY --from=builder /var/cache/rpms /rpms diff --git a/Containerfile.zfs b/Containerfile.zfs index 52de7c55..91b55ccb 100644 --- a/Containerfile.zfs +++ b/Containerfile.zfs @@ -35,6 +35,17 @@ RUN --mount=type=cache,dst=/var/cache/dnf \ /tmp/build-kmod-zfs.sh && \ /tmp/dual-sign-zfs.sh +# Remove kernel version from kmod package names +# FIXME: This will only work for 6.* kernels unfortunately +# FIXME: The sed is a gross hack, maybe PR upstream? +RUN set -e; \ + sed -i -e 's/args = \["rpmbuild", "-bb"\]/args = \["rpmbuild", "-bb", "--buildroot", "#{build_path}\/BUILD"\]/g' /usr/local/share/gems/gems/fpm-*/lib/fpm/package/rpm.rb; \ + for rpm in $(find /var/cache/rpms/kmods -type f -name \*.rpm); do \ + basename=$(basename ${rpm}); \ + name=${basename%%-6*}; \ + fpm --verbose -s rpm -t rpm -p ${rpm} -f --name ${name} ${rpm}; \ + done + FROM scratch COPY --from=builder /var/cache/rpms /rpms diff --git a/build-prep.sh b/build-prep.sh index f1d0f756..a4912473 100755 --- a/build-prep.sh +++ b/build-prep.sh @@ -50,7 +50,10 @@ fi ### PREPARE BUILD ENV dnf install -y \ akmods \ - mock + mock \ + ruby-devel + +gem install fpm if [[ ! -s "/tmp/certs/private_key.priv" ]]; then echo "WARNING: Using test signing key. Run './generate-akmods-key' for production builds."