Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove kernel version from kmod name #257

Merged
merged 6 commits into from
Oct 20, 2024
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
11 changes: 11 additions & 0 deletions Containerfile.common
Original file line number Diff line number Diff line change
Expand Up @@ -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
antheas marked this conversation as resolved.
Show resolved Hide resolved
# FIXME: The sed is a gross hack, maybe PR upstream?
bsherman marked this conversation as resolved.
Show resolved Hide resolved
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}; \
bsherman marked this conversation as resolved.
Show resolved Hide resolved
done

FROM scratch

COPY --from=builder /var/cache/rpms /rpms
11 changes: 11 additions & 0 deletions Containerfile.extra
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions Containerfile.nvidia
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions Containerfile.nvidia-open
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions Containerfile.zfs
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion build-prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down