This commit is contained in:
JkktBkkt 2025-04-04 01:59:36 +00:00 committed by GitHub
commit 8d9aa01342
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,26 @@
PACKAGE_NAME="nvidia"
PACKAGE_VERSION="__VERSION_STRING"
AUTOINSTALL="yes"
# By default, DKMS will add KERNELRELEASE to the make command line; however,
# this will cause the kernel module build to infer that it was invoked via
# Kbuild directly instead of DKMS. The dkms(8) manual page recommends quoting
# the 'make' command name to suppress this behavior.
MAKE[0]="'make' -j`nproc` NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=${kernelver} modules"
# The list of kernel modules will be generated by nvidia-installer at runtime.
BUILT_MODULE_NAME[0]="nvidia"
BUILT_MODULE_LOCATION[0]="kernel-open"
DEST_MODULE_LOCATION[0]="/kernel/drivers/video"
BUILT_MODULE_NAME[1]="nvidia-uvm"
BUILT_MODULE_LOCATION[1]="kernel-open"
DEST_MODULE_LOCATION[1]="/kernel/drivers/video"
BUILT_MODULE_NAME[2]="nvidia-modeset"
BUILT_MODULE_LOCATION[2]="kernel-open"
DEST_MODULE_LOCATION[2]="/kernel/drivers/video"
BUILT_MODULE_NAME[3]="nvidia-drm"
BUILT_MODULE_LOCATION[3]="kernel-open"
DEST_MODULE_LOCATION[3]="/kernel/drivers/video"
BUILT_MODULE_NAME[4]="nvidia-peermem"
BUILT_MODULE_LOCATION[4]="kernel-open"
DEST_MODULE_LOCATION[4]="/kernel/drivers/video"

View file

@ -0,0 +1,43 @@
# Template file for 'nvidia-open-dkms'
# In the current state, for first install you can install nvidia from repos and then installing nvidia-open-dkms via xbps-src
# Updating requires rebasing/locally merging PR onto master
# (unless you just manually recreate the files to not mess with git) and either:
# A) adjusting the nvidia template to no longer require nvidia-dkms package and building both locally
# B) temporarily switching to the proprietary dkms module, building nvidia-open-dkms and installing it afterwards
pkgname=nvidia-open-dkms
version=570.133.07
revision=1
archs="x86_64"
depends="dkms nvidia"
short_desc="NVIDIA Linux open GPU kernel module source"
maintainer="JkktBkkt <apkabikov@gmail.com>"
license="GPL-2.0-only, MIT"
homepage="https://github.com/NVIDIA/open-gpu-kernel-modules"
changelog="https://github.com/NVIDIA/open-gpu-kernel-modules/blob/main/CHANGELOG.md"
distfiles="https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/${version}.tar.gz"
checksum=9b5682c6bbef09272dc689965920111198b27feac172049fff217837b10e9882
replaces="nvidia-dkms>=0"
dkms_modules="nvidia-open-dkms ${version}"
triggers="dkms initramfs-regenerate"
do_install() {
vmkdir usr/src/nvidia-open-dkms-${version}
vcopy "*" usr/src/nvidia-open-dkms-${version}
cp ${FILESDIR}/dkms.conf ${DESTDIR}/usr/src/nvidia-open-dkms-${version}/dkms.conf
vsed -e "s/__VERSION_STRING/${version}/" -i ${DESTDIR}/usr/src/nvidia-open-dkms-${version}/dkms.conf
vmkdir usr/lib/modprobe.d
echo "blacklist nouveau" > ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
echo "options nvidia NVreg_OpenRmEnableUnsupportedGpus=1" >> ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
chmod 644 ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
vdoc README.md
vlicense COPYING
pkg_install() {
vmove usr/src
vmove usr/lib/modprobe.d
}
}