mirror-ublue-os-akmods/Containerfile.nvidia
Benjamin Sherman 8dcc14db8d
feat: add support for kernel-longterm-6.12 (#353)
* feat: add support for kernel-longterm-6.12

This adds kmods builds for kwizart/kernel-longterm-6.12

* disable extra builds and fix condition

* download proper name

* get correct version

* oops

* more generic?

* use kernel-longterm

* rebuild longterm

* fix Containerfile contidionals

* i welcome the new refactor

* verify longterm secureboot

* query proper kernel name in build zfs

* use KERNEL_NAME in test

* include  libatomic

* fun atomic typos

* handle non-standard kernel names in ZFS build

* need the variable to work

* re-enable other builds
2025-06-29 19:23:57 +00:00

52 lines
2.3 KiB
Text

###
### Containerfile.nvidia - used to build ONLY NVIDIA kmods
###
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-42}"
ARG BUILDER_IMAGE="${BUILDER_IMAGE:-quay.io/fedora/fedora}"
ARG BUILDER_BASE="${BUILDER_IMAGE}:${FEDORA_MAJOR_VERSION}"
FROM ${BUILDER_BASE} AS builder
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-42}"
ARG KERNEL_FLAVOR="${KERNEL_FLAVOR:-main}"
ARG RPMFUSION_MIRROR=""
ARG DUAL_SIGN="true"
COPY build_files/nvidia build_files/shared /tmp/
COPY certs /tmp/certs
# files for nvidia
COPY files/etc/sway/environment /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/environment
COPY files/usr/lib/systemd/system/ublue-nvctk-cdi.service /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/ublue-nvctk-cdi.service
COPY files/usr/lib/systemd/system/ublue-nvctk-cdi.service /tmp/ublue-os-ucore-nvidia/rpmbuild/SOURCES/ublue-nvctk-cdi.service
COPY files/usr/lib/systemd/system-preset/70-ublue-nvctk-cdi.preset /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/70-ublue-nvctk-cdi.preset
COPY files/usr/lib/systemd/system-preset/70-ublue-nvctk-cdi.preset /tmp/ublue-os-ucore-nvidia/rpmbuild/SOURCES/70-ublue-nvctk-cdi.preset
COPY files/etc/udev/rules.d/60-nvidia-extra-devices-pm.rules /tmp/ublue-os-nvidia-addons/rpmbuild/SOURCES/60-nvidia-extra-devices-pm.rules
RUN --mount=type=bind,src=kernel_cache,dst=/tmp/kernel_cache,ro \
--mount=type=cache,dst=/var/cache/dnf \
ls -sh /tmp/kernel_cache; \
if [[ "${KERNEL_FLAVOR}" =~ "surface" ]]; then \
export KERNEL_NAME="kernel-surface" \
; elif [[ "${KERNEL_FLAVOR}" =~ "longterm" ]]; then \
export KERNEL_NAME="kernel-longterm" \
; else \
export KERNEL_NAME="kernel" \
; fi && \
/tmp/build-prep.sh && \
if [[ "${KERNEL_FLAVOR}" =~ "coreos" ]]; then \
/tmp/build-ublue-os-ucore-nvidia.sh && \
cp /tmp/ublue-os-ucore-nvidia/rpmbuild/RPMS/noarch/ublue-os-ucore-nvidia*.rpm \
/var/cache/rpms/ucore/ \
; fi && \
/tmp/build-ublue-os-nvidia-addons.sh && \
cp /tmp/ublue-os-nvidia-addons/rpmbuild/RPMS/noarch/ublue-os-nvidia-addons*.rpm \
/var/cache/rpms/ublue-os/ && \
/tmp/build-kmod-nvidia.sh kernel && \
/tmp/dual-sign.sh && \
/tmp/build-post.sh
FROM scratch
COPY --from=builder /var/cache/kernel-rpms /kernel-rpms
COPY --from=builder /var/cache/rpms /rpms