Skip to content

Commit

Permalink
feat: rename kmods to not include kernel name
Browse files Browse the repository at this point in the history
  • Loading branch information
antheas committed Oct 19, 2024
1 parent a1d215e commit 749b769
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Containerfile.common
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions Containerfile.extra
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions Containerfile.nvidia
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions Containerfile.nvidia-open
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 749b769

Please sign in to comment.