-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: build nvidia open source kernel module (#220)
Co-authored-by: Kyle Gospodnetich <[email protected]>
- Loading branch information
Showing
4 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ jobs: | |
- common | ||
- extra | ||
- nvidia | ||
- nvidia-open | ||
- zfs | ||
exclude: | ||
- fedora_version: 39 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
### | ||
### Containerfile.nvidia - used to build ONLY NVIDIA kmods | ||
### | ||
|
||
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-40}" | ||
ARG KERNEL_FLAVOR="${KERNEL_FLAVOR:-main}" | ||
ARG KERNEL_IMAGE="${KERNEL_IMAGE:-${KERNEL_FLAVOR}-kernel}" | ||
ARG KERNEL_ORG="${KERNEL_ORG:-ublue-os}" | ||
ARG KERNEL_BASE="ghcr.io/${KERNEL_ORG}/${KERNEL_IMAGE}:${FEDORA_MAJOR_VERSION}" | ||
ARG BUILDER_IMAGE="${BUILDER_IMAGE:-quay.io/fedora/fedora}" | ||
ARG BUILDER_BASE="${BUILDER_IMAGE}:${FEDORA_MAJOR_VERSION}" | ||
FROM ${KERNEL_BASE} AS kernel_cache | ||
FROM ${BUILDER_BASE} AS builder | ||
|
||
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-40}" | ||
ARG KERNEL_FLAVOR="${KERNEL_FLAVOR:-main}" | ||
ARG RPMFUSION_MIRROR="" | ||
ARG DUAL_SIGN="true" | ||
|
||
COPY build*.sh dual-sign*.sh /tmp/ | ||
COPY certs /tmp/certs | ||
|
||
# cached kernel rpms | ||
COPY --from=kernel_cache /tmp/rpms /tmp/kernel_cache | ||
|
||
# files for nvidia | ||
COPY ublue-os-nvidia-addons.spec /tmp/ublue-os-nvidia-addons/ublue-os-nvidia-addons.spec | ||
COPY ublue-os-ucore-nvidia.spec /tmp/ublue-os-ucore-nvidia/ublue-os-ucore-nvidia.spec | ||
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 | ||
|
||
|
||
RUN --mount=type=cache,dst=/var/cache/dnf \ | ||
/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/ && \ | ||
if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \ | ||
export KERNEL_NAME="kernel" \ | ||
; else \ | ||
export KERNEL_NAME="kernel-surface" \ | ||
; fi && \ | ||
/tmp/build-kmod-nvidia.sh kernel-open && \ | ||
/tmp/dual-sign.sh && \ | ||
for RPM in $(find /var/cache/akmods/ -type f -name \*.rpm); do \ | ||
cp "${RPM}" /var/cache/rpms/kmods/; \ | ||
done && \ | ||
for RPM in $(find /root/rpmbuild/RPMS/"$(uname -m)"/ -type f -name \*.rpm); do \ | ||
cp "${RPM}" /var/cache/rpms/kmods/; \ | ||
done && \ | ||
find /var/cache/rpms | ||
|
||
FROM scratch | ||
|
||
COPY --from=builder /var/cache/rpms /rpms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters