From 539d9df1f4737da8814f8aa523368923f2e2205c Mon Sep 17 00:00:00 2001 From: xtex Date: Sat, 14 Dec 2024 08:39:46 +0800 Subject: [PATCH] nvidia: split binaries and firmware packages --- runtime-display/nvidia-open/autobuild/build | 3 + runtime-display/nvidia-open/autobuild/defines | 4 +- runtime-display/nvidia-open/spec | 13 +- .../nvidia/{autobuild => 01-utils}/build | 81 +---------- .../{autobuild => 01-utils}/build-optenv32 | 6 - runtime-display/nvidia/01-utils/defines | 14 ++ runtime-display/nvidia/01-utils/prepare | 2 + runtime-display/nvidia/02-firmware/build | 22 +++ runtime-display/nvidia/02-firmware/defines | 9 ++ .../{autobuild => 03-kernel}/amd64/preinst | 0 runtime-display/nvidia/03-kernel/build | 135 ++++++++++++++++++ .../nvidia/{autobuild => 03-kernel}/defines | 2 +- .../overrides/usr/bin/prime-run | 0 .../lib/dracut/dracut.conf.d/50-nvidia.conf | 0 .../overrides/usr/lib/modprobe.d/nvidia.conf | 1 + .../overrides/usr/lib/sysusers.d/nvidia.conf | 3 + .../10-nvidia-drm-outputclass.conf | 0 .../applications/nvidia-settings.desktop | 0 .../nvidia/{autobuild => 03-kernel}/patch | 0 ...olic-links-for-Linux-kernel-6.13-rc1.patch | 0 ...nux-aperture.c-for-removing-conflict.patch | 0 ...C-TTM-fbdev-emulation-for-Linux-6.13.patch | 0 .../{autobuild => 03-kernel}/postinst.in | 4 +- .../nvidia/{autobuild => 03-kernel}/prepare | 5 +- .../nvidia/{autobuild => 03-kernel}/prerm.in | 0 .../nvidia/{autobuild => 03-kernel}/triggers | 0 runtime-display/nvidia/spec | 18 +-- 27 files changed, 213 insertions(+), 109 deletions(-) rename runtime-display/nvidia/{autobuild => 01-utils}/build (78%) rename runtime-display/nvidia/{autobuild => 01-utils}/build-optenv32 (94%) create mode 100644 runtime-display/nvidia/01-utils/defines create mode 100644 runtime-display/nvidia/01-utils/prepare create mode 100644 runtime-display/nvidia/02-firmware/build create mode 100644 runtime-display/nvidia/02-firmware/defines rename runtime-display/nvidia/{autobuild => 03-kernel}/amd64/preinst (100%) create mode 100644 runtime-display/nvidia/03-kernel/build rename runtime-display/nvidia/{autobuild => 03-kernel}/defines (91%) rename runtime-display/nvidia/{autobuild => 03-kernel}/overrides/usr/bin/prime-run (100%) rename runtime-display/nvidia/{autobuild => 03-kernel}/overrides/usr/lib/dracut/dracut.conf.d/50-nvidia.conf (100%) create mode 100644 runtime-display/nvidia/03-kernel/overrides/usr/lib/modprobe.d/nvidia.conf create mode 100644 runtime-display/nvidia/03-kernel/overrides/usr/lib/sysusers.d/nvidia.conf rename runtime-display/nvidia/{autobuild => 03-kernel}/overrides/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf (100%) rename runtime-display/nvidia/{autobuild => 03-kernel}/overrides/usr/share/applications/nvidia-settings.desktop (100%) rename runtime-display/nvidia/{autobuild => 03-kernel}/patch (100%) rename runtime-display/nvidia/{autobuild => 03-kernel}/patches/0001-Fix-symbolic-links-for-Linux-kernel-6.13-rc1.patch (100%) rename runtime-display/nvidia/{autobuild => 03-kernel}/patches/0002-FROM-AOSC-Use-linux-aperture.c-for-removing-conflict.patch (100%) rename runtime-display/nvidia/{autobuild => 03-kernel}/patches/0003-FROM-AOSC-TTM-fbdev-emulation-for-Linux-6.13.patch (100%) rename runtime-display/nvidia/{autobuild => 03-kernel}/postinst.in (70%) rename runtime-display/nvidia/{autobuild => 03-kernel}/prepare (52%) rename runtime-display/nvidia/{autobuild => 03-kernel}/prerm.in (100%) rename runtime-display/nvidia/{autobuild => 03-kernel}/triggers (100%) diff --git a/runtime-display/nvidia-open/autobuild/build b/runtime-display/nvidia-open/autobuild/build index f3020f8a2521..4632169fac40 100644 --- a/runtime-display/nvidia-open/autobuild/build +++ b/runtime-display/nvidia-open/autobuild/build @@ -17,6 +17,9 @@ make -C src install \ make -C doc install \ DESTDIR="$PKGDIR" \ PREFIX=/usr + +abinfo "Installing XNVCtrl headers ..." +install -Dvm644 "src/libXNVCtrl/*.h" -t "$PKGDIR"/usr/include/NVCtrl popd pushd "$SRCDIR"/nvidia-xconfig diff --git a/runtime-display/nvidia-open/autobuild/defines b/runtime-display/nvidia-open/autobuild/defines index 52832fd48d9a..c8a9be302ceb 100644 --- a/runtime-display/nvidia-open/autobuild/defines +++ b/runtime-display/nvidia-open/autobuild/defines @@ -2,8 +2,8 @@ PKGNAME=nvidia-open PKGSEC=x11 PKGDEP="libcl zlib opencl-registry-api xorg-server dkms \ libglvnd egl-wayland gtk-3 jansson libvdpau \ - libxnvctrl vulkan" -PKGDES="The open-source control panel for NVIDIA cards drivers" + libxnvctrl vulkan nvidia-firmware nvidia-utils" +PKGDES="The open-source drivers suite for NVIDIA cards" BUILDDEP="inetutils" FAIL_ARCH="!(amd64|arm64)" diff --git a/runtime-display/nvidia-open/spec b/runtime-display/nvidia-open/spec index 4824f0cc8f16..dac85622f823 100644 --- a/runtime-display/nvidia-open/spec +++ b/runtime-display/nvidia-open/spec @@ -1,8 +1,11 @@ -VER=565.77 -SRCS="git::rename=nvidia-driver;commit=tags/${VER}::https://github.com/NVIDIA/open-gpu-kernel-modules - git::rename=nvidia-settings;commit=tags/${VER}::https://github.com/NVIDIA/nvidia-settings - git::rename=nvidia-xconfig;commit=tags/${VER}::https://github.com/NVIDIA/nvidia-xconfig - git::rename=nvidia-persistenced;commit=tags/${VER}::https://github.com/NVIDIA/nvidia-persistenced" +_DRIVER_VER=565.77 +# Note: sometimes utilities are not updated timely +_UTILS_VERS=565.57.01 +VER=${_DRIVER_VER}+utils${_UTILS_VERS} +SRCS="git::rename=nvidia-driver;commit=tags/${_DRIVER_VER}::https://github.com/NVIDIA/open-gpu-kernel-modules + git::rename=nvidia-settings;commit=tags/${_UTILS_VERS}::https://github.com/NVIDIA/nvidia-settings + git::rename=nvidia-xconfig;commit=tags/${_UTILS_VERS}::https://github.com/NVIDIA/nvidia-xconfig + git::rename=nvidia-persistenced;commit=tags/${_UTILS_VERS}::https://github.com/NVIDIA/nvidia-persistenced" CHKSUMS="SKIP SKIP SKIP diff --git a/runtime-display/nvidia/autobuild/build b/runtime-display/nvidia/01-utils/build similarity index 78% rename from runtime-display/nvidia/autobuild/build rename to runtime-display/nvidia/01-utils/build index 1f6a276d20a7..c8a273ba8e2a 100644 --- a/runtime-display/nvidia/autobuild/build +++ b/runtime-display/nvidia/01-utils/build @@ -46,7 +46,7 @@ sanity_check() { # The regex glob matching so that should not be installed, due to # - Incompatibility with with GLVND, or # - A separate package containing this so. - BLACKLIST="(EGL|GL|GLESv1_CM|GLESv2|GLX|OpenGL|OpenCL|GLdispatch|nvidia-egl-wayland).so." + BLACKLIST="(EGL|GL|GLESv1_CM|GLESv2|GLX|OpenGL|OpenCL|GLdispatch|nvidia-egl-wayland|libnvidia-gtk3|libnvidia-wayland-client).so." # Assuming pwd is in NVIDIA-Linux-${NV_ARCH} abinfo "Checking whether all the .so provided has been installed" _PROVIDED=$(find -maxdepth 1 -name "*.so.*" -exec basename {} \; | sort | sed -E "/${BLACKLIST}/d") @@ -71,48 +71,7 @@ case "$ABHOST" in abdie "Unsupported architecture" esac - -cd "$SRCDIR"/NVIDIA-Linux-${NV_ARCH}-${PKGVER} - -if [[ -d "${SRCDIR}/autobuild/patches" ]]; then - abinfo "Patching kernel driver" - for i in $(find "${SRCDIR}/autobuild/patches/" -type f -name "*.patch" | sort); do - abinfo "Applying $(basename $i)" - ( - cd kernel - patch -Np1 -i "$i" - ) - done -else - abinfo "No kernel patches needed" -fi - -cd kernel - -abinfo "Processing DKMS configuration file..." -sed -i "s/__VERSION_STRING/$PKGVER/" dkms.conf -sed -i 's/__JOBS/`nproc`/' dkms.conf -sed -i 's/__DKMS_MODULES//' dkms.conf -sed -i '$iBUILT_MODULE_NAME[0]="nvidia"\ -DEST_MODULE_LOCATION[0]="/kernel/drivers/video"\ -BUILT_MODULE_NAME[1]="nvidia-uvm"\ -DEST_MODULE_LOCATION[1]="/kernel/drivers/video"\ -BUILT_MODULE_NAME[2]="nvidia-modeset"\ -DEST_MODULE_LOCATION[2]="/kernel/drivers/video"\ -BUILT_MODULE_NAME[3]="nvidia-drm"\ -DEST_MODULE_LOCATION[3]="/kernel/drivers/video"\ -BUILT_MODULE_NAME[4]="nvidia-peermem"\ -DEST_MODULE_LOCATION[4]="/kernel/drivers/video"' dkms.conf - -cd .. - -abinfo "NVIDIA blacklist for Nouveau..." -install -dm 755 "$PKGDIR"/usr/{lib/modprobe.d,src} -cp -dr --no-preserve='ownership' kernel "$PKGDIR"/usr/src/nvidia-$PKGVER -echo 'blacklist nouveau' > "$PKGDIR"/usr/lib/modprobe.d/nvidia.conf - -abinfo "NVIDIA Persistenced..." -tar xf nvidia-persistenced-init.tar.bz2 +pushd "$SRCDIR"/NVIDIA-Linux-${NV_ARCH}-${PKGVER} abinfo "Processing and installing OpenCL runtime..." install_for_all 644 nvidia.icd "$PKGDIR"/etc/OpenCL/vendors @@ -182,7 +141,8 @@ install_for_all 755 "libnvidia-api.so.1" "$PKGDIR"/usr/lib abinfo "Wayland support libraries and platform files..." install_for_all 755 "libnvidia-egl-gbm.so.1.1.2" "$PKGDIR"/usr/lib -install_if_amd64 755 "libnvidia-wayland-client.so.$PKGVER" "$PKGDIR"/usr/lib +# libnvidia-wayland-client.so is open-source + install -Dvm644 "15_nvidia_gbm.json" \ "$PKGDIR"/usr/share/egl/egl_external_platform.d/15_nvidia_gbm.json mkdir -vp "$PKGDIR/usr/lib/gbm" @@ -240,12 +200,6 @@ abinfo "Debug and core dump utility..." install -Dvm755 nvidia-debugdump \ "$PKGDIR"/usr/bin/nvidia-debugdump -abinfo "NVIDIA X configurator..." -install -Dvm755 nvidia-xconfig \ - "$PKGDIR"/usr/bin/nvidia-xconfig -install -Dvm644 nvidia-xconfig.1.gz \ - "$PKGDIR"/usr/share/man/man1/nvidia-xconfig.1.gz - abinfo "NVIDIA Bug Reporter..." install -Dvm755 nvidia-bug-report.sh \ "$PKGDIR"/usr/bin/nvidia-bug-report @@ -270,17 +224,6 @@ install -Dvm4755 nvidia-modprobe \ install -Dvm644 nvidia-modprobe.1.gz \ "$PKGDIR"/usr/share/man/man1/nvidia-modprobe.1.gz -abinfo "NVIDIA Persistence Daemon..." -install -Dvm755 nvidia-persistenced \ - "$PKGDIR"/usr/bin/nvidia-persistenced -install -Dvm644 nvidia-persistenced.1.gz \ - "$PKGDIR"/usr/share/man/man1/nvidia-persistenced.1.gz -install -Dvm644 \ - nvidia-persistenced-init/systemd/nvidia-persistenced.service.template \ - "$PKGDIR"/usr/lib/systemd/system/nvidia-persistenced.service -sed -e 's/__USER__/nvidia-persistenced/' \ - -i "$PKGDIR"/usr/lib/systemd/system/nvidia-persistenced.service - abinfo "Application profiles..." install -Dvm644 nvidia-application-profiles-$PKGVER-rc \ "$PKGDIR"/usr/share/nvidia/nvidia-application-profiles-$PKGVER-rc @@ -288,11 +231,7 @@ install -Dvm644 nvidia-application-profiles-$PKGVER-key-documentation \ "$PKGDIR"/usr/share/nvidia/nvidia-application-profiles-$PKGVER-key-documentation abinfo "NVIDIA Control Panel..." -install_for_all 755 nvidia-settings "$PKGDIR"/usr/bin -install_for_all 644 nvidia-settings.1.gz "$PKGDIR"/usr/share/man/man1 -install_for_all 644 nvidia-settings.png "$PKGDIR"/usr/share/pixmaps install_for_all 755 libnvidia-gtk2.so.$PKGVER "$PKGDIR"/usr/lib -install_for_all 755 libnvidia-gtk3.so.$PKGVER "$PKGDIR"/usr/lib abinfo "Power management services" for i in suspend hibernate resume; do @@ -305,10 +244,6 @@ install_for_all 755 nvidia-powerd "${PKGDIR}/usr/bin" install_for_all 644 nvidia-dbus.conf "${PKGDIR}/usr/share/dbus-1/system.d" install_for_all 644 systemd/system/nvidia-powerd.service "$PKGDIR"/usr/lib/systemd/system -abinfo "Card Firmware" -install_for_all 644 firmware/gsp_ga10x.bin "${PKGDIR}"/usr/lib/firmware/nvidia/${PKGVER} -install_for_all 644 firmware/gsp_tu10x.bin "${PKGDIR}"/usr/lib/firmware/nvidia/${PKGVER} - if ((NEED_FIX)); then aberr "Additional files should be installed. See errors above." abdir @@ -327,14 +262,10 @@ ln -sv "libglxserver_nvidia.so.$PKGVER" \ abinfo "License and help texts" for i in README.txt LICENSE NVIDIA_Changelog; do - install -Dvm644 $i "$PKGDIR"/usr/share/doc/nvidia/$i + install -Dvm644 $i "$PKGDIR"/usr/share/doc/nvidia-utils/$i done -cd "$SRCDIR" - -abinfo "Installing XNVCtrl headers ..." -install -Dvm644 "$SRCDIR"/nvidia-settings-*/src/libXNVCtrl/*.h \ - -t "$PKGDIR"/usr/include/NVCtrl +popd if [[ $NV_ARCH == "x86_64" ]]; then abinfo "Installing optenv32 libraries" diff --git a/runtime-display/nvidia/autobuild/build-optenv32 b/runtime-display/nvidia/01-utils/build-optenv32 similarity index 94% rename from runtime-display/nvidia/autobuild/build-optenv32 rename to runtime-display/nvidia/01-utils/build-optenv32 index 87632b801beb..24610cbf0681 100644 --- a/runtime-display/nvidia/autobuild/build-optenv32 +++ b/runtime-display/nvidia/01-utils/build-optenv32 @@ -63,9 +63,3 @@ install -Dvm755 "libnvidia-glvkspirv.so.$PKGVER" \ sanity_check "${PKGDIR}/opt/32" create_links - -cd .. - -abinfo "Installing XNVCtrl headers ..." -install -Dvm644 "$SRCDIR"/nvidia-settings-*/src/libXNVCtrl/*.h \ - -t "$PKGDIR"/opt/32/include/NVCtrl diff --git a/runtime-display/nvidia/01-utils/defines b/runtime-display/nvidia/01-utils/defines new file mode 100644 index 000000000000..21d1b5c98fdc --- /dev/null +++ b/runtime-display/nvidia/01-utils/defines @@ -0,0 +1,14 @@ +PKGNAME=nvidia-utils +PKGSEC=x11 +# Note: this package includes all proprietary binaries from NVIDIA driver that +# are not open-source. +# If a binary is both source-available and available in the proprietary +# .run driver package, please put its pre-built binary in nvidia +# and open source version in nvidia-open respectively. +PKGDES="The proprietary utilities for NVIDIA cards" + +PKGCONFL="nvidia<=565.77" +PKGBREAK="nvidia<=565.77" +ABSTRIP=0 + +FAIL_ARCH="!(amd64|arm64)" diff --git a/runtime-display/nvidia/01-utils/prepare b/runtime-display/nvidia/01-utils/prepare new file mode 100644 index 000000000000..f19081c8f31b --- /dev/null +++ b/runtime-display/nvidia/01-utils/prepare @@ -0,0 +1,2 @@ +abinfo "Extracting archive" +sh NVIDIA-Linux-$PKGVER.run --extract-only diff --git a/runtime-display/nvidia/02-firmware/build b/runtime-display/nvidia/02-firmware/build new file mode 100644 index 000000000000..aa17ac73212c --- /dev/null +++ b/runtime-display/nvidia/02-firmware/build @@ -0,0 +1,22 @@ +NV_ARCH="undefined" + +case "$ABHOST" in + amd64) + NV_ARCH="x86_64" + ;; + arm64) + NV_ARCH="aarch64" + ;; + *) + abdie "Unsupported architecture" +esac + +pushd "$SRCDIR"/NVIDIA-Linux-${NV_ARCH}-${PKGVER} + +abinfo "Installing GSP binaries ..." +install -Dvm644 firmware/gsp_ga10x.bin \ + "${PKGDIR}"/usr/lib/firmware/nvidia/"${PKGVER}"/gsp_ga10x.bin +install -Dvm644 firmware/gsp_tu10x.bin \ + "${PKGDIR}"/usr/lib/firmware/nvidia/"${PKGVER}"/gsp_tu10x.bin + +popd diff --git a/runtime-display/nvidia/02-firmware/defines b/runtime-display/nvidia/02-firmware/defines new file mode 100644 index 000000000000..56b7e48f5f2f --- /dev/null +++ b/runtime-display/nvidia/02-firmware/defines @@ -0,0 +1,9 @@ +PKGNAME=nvidia-firmware +PKGSEC=x11 +PKGDES="The proprietary GPS firmwares for NVIDIA cards" + +PKGCONFL="nvidia<=565.77" +PKGBREAK="nvidia<=565.77" +ABSTRIP=0 + +FAIL_ARCH="!(amd64|arm64)" diff --git a/runtime-display/nvidia/autobuild/amd64/preinst b/runtime-display/nvidia/03-kernel/amd64/preinst similarity index 100% rename from runtime-display/nvidia/autobuild/amd64/preinst rename to runtime-display/nvidia/03-kernel/amd64/preinst diff --git a/runtime-display/nvidia/03-kernel/build b/runtime-display/nvidia/03-kernel/build new file mode 100644 index 000000000000..aafb0330bff8 --- /dev/null +++ b/runtime-display/nvidia/03-kernel/build @@ -0,0 +1,135 @@ +# vim: set expandtab sts=4 ts=4 sw=4: + +create_links() { + # FIXME: libglxserver_nvidia.so has no soname so this function won't create a symlink for it + find "$PKGDIR" -type f -name '*.so*' ! -path '*xorg/*' -print0 | while read -d $'\0' _lib; do + _soname=$(dirname "${_lib}")/$(readelf -d "${_lib}" | grep -Po 'SONAME.*: \[\K[^]]*' || true) + _base=$(echo ${_soname} | sed -r 's/(.*).so.*/\1.so/') + if [[ -e "${_soname}" ]]; then + abwarn "${_lib} does not have soname! Not creating symlink for it" + else + ln -sv $(basename "${_lib}") "${_soname}" + fi + [[ -e "${_base}" ]] || ln -sv $(basename "${_soname}") "${_base}" + done +} + +install_for_all() { + MOD="$1" + SRC="$2" + DESTDIR="$3" + install -Dvm${MOD} "$SRC" "$DESTDIR/$(basename ${SRC})" + return $? +} + +NEED_FIX=0 + +install_if_amd64() { + MOD="$1" + SRC="$2" + DESTDIR="$3" + if [[ $NV_ARCH = x86_64 ]]; then + install -Dvm${MOD} "$SRC" "$DESTDIR/$(basename ${SRC})" + return $? + elif [[ -f "${SRC}" ]]; then + # Make sure the file really doesn't exist + aberr "File $SRC exists for non-amd64. Fix build scripts!" + # Set fail flag. Catch all errors in one go + NEED_FIX=1 + fi + return 0 +} + +NV_ARCH="undefined" + +case "$ABHOST" in + amd64) + NV_ARCH="x86_64" + ;; + arm64) + NV_ARCH="aarch64" + ;; + *) + abdie "Unsupported architecture" +esac + + +cd "$SRCDIR"/NVIDIA-Linux-${NV_ARCH}-${PKGVER} + +if [[ -d "${SRCDIR}/autobuild/patches" ]]; then + abinfo "Patching kernel driver" + for i in $(find "${SRCDIR}/autobuild/patches/" -type f -name "*.patch" | sort); do + abinfo "Applying $(basename $i)" + ( + cd kernel + patch -Np1 -i "$i" + ) + done +else + abinfo "No kernel patches needed" +fi + +cd kernel + +abinfo "Processing DKMS configuration file..." +sed -i "s/__VERSION_STRING/$PKGVER/" dkms.conf +sed -i 's/__JOBS/`nproc`/' dkms.conf +sed -i 's/__DKMS_MODULES//' dkms.conf +sed -i '$iBUILT_MODULE_NAME[0]="nvidia"\ +DEST_MODULE_LOCATION[0]="/kernel/drivers/video"\ +BUILT_MODULE_NAME[1]="nvidia-uvm"\ +DEST_MODULE_LOCATION[1]="/kernel/drivers/video"\ +BUILT_MODULE_NAME[2]="nvidia-modeset"\ +DEST_MODULE_LOCATION[2]="/kernel/drivers/video"\ +BUILT_MODULE_NAME[3]="nvidia-drm"\ +DEST_MODULE_LOCATION[3]="/kernel/drivers/video"\ +BUILT_MODULE_NAME[4]="nvidia-peermem"\ +DEST_MODULE_LOCATION[4]="/kernel/drivers/video"' dkms.conf + +cd .. + +abinfo "Installing kernel sources ..." +install -dm 755 "$PKGDIR"/usr/src +cp -dr --no-preserve='ownership' kernel "$PKGDIR"/usr/src/nvidia-$PKGVER + +abinfo "Wayland support libraries and platform files ..." +install_if_amd64 755 "libnvidia-wayland-client.so.$PKGVER" "$PKGDIR"/usr/lib + +abinfo "NVIDIA X configurator ..." +install -Dvm755 nvidia-xconfig \ + "$PKGDIR"/usr/bin/nvidia-xconfig +install -Dvm644 nvidia-xconfig.1.gz \ + "$PKGDIR"/usr/share/man/man1/nvidia-xconfig.1.gz + +abinfo "NVIDIA Persistence Daemon..." +tar xf nvidia-persistenced-init.tar.bz2 +install -Dvm755 nvidia-persistenced \ + "$PKGDIR"/usr/bin/nvidia-persistenced +install -Dvm644 nvidia-persistenced.1.gz \ + "$PKGDIR"/usr/share/man/man1/nvidia-persistenced.1.gz +install -Dvm644 \ + nvidia-persistenced-init/systemd/nvidia-persistenced.service.template \ + "$PKGDIR"/usr/lib/systemd/system/nvidia-persistenced.service +sed -e 's/__USER__/nvidia-persistenced/' \ + -i "$PKGDIR"/usr/lib/systemd/system/nvidia-persistenced.service + +abinfo "NVIDIA Control Panel..." +install_for_all 755 nvidia-settings "$PKGDIR"/usr/bin +install_for_all 644 nvidia-settings.1.gz "$PKGDIR"/usr/share/man/man1 +install_for_all 644 nvidia-settings.png "$PKGDIR"/usr/share/pixmaps +install_for_all 755 libnvidia-gtk3.so.$PKGVER "$PKGDIR"/usr/lib + +if ((NEED_FIX)); then + aberr "Additional files should be installed. See errors above." + abdir +fi + +abinfo "Creating symbolic links for shared objects ..." +create_links + +abinfo "License and help texts ..." +for i in README.txt LICENSE NVIDIA_Changelog; do + install -Dvm644 $i "$PKGDIR"/usr/share/doc/nvidia/$i +done + +cd "$SRCDIR" diff --git a/runtime-display/nvidia/autobuild/defines b/runtime-display/nvidia/03-kernel/defines similarity index 91% rename from runtime-display/nvidia/autobuild/defines rename to runtime-display/nvidia/03-kernel/defines index 6fe8cc8ce32a..2674dd5ac96e 100644 --- a/runtime-display/nvidia/autobuild/defines +++ b/runtime-display/nvidia/03-kernel/defines @@ -1,7 +1,7 @@ PKGNAME=nvidia PKGSEC=x11 PKGDEP="libcl zlib opencl-registry-api xorg-server gtk-2 dkms \ - libglvnd egl-wayland" + libglvnd egl-wayland nvidia-firmware nvidia-utils" PKGDES="The proprietary drivers suite for NVIDIA cards" PKGCONFL="mesa<=11.1.0 xorg-server<=1.18.0-2 nvidia+340 nvidia+390 nvidia-open" diff --git a/runtime-display/nvidia/autobuild/overrides/usr/bin/prime-run b/runtime-display/nvidia/03-kernel/overrides/usr/bin/prime-run similarity index 100% rename from runtime-display/nvidia/autobuild/overrides/usr/bin/prime-run rename to runtime-display/nvidia/03-kernel/overrides/usr/bin/prime-run diff --git a/runtime-display/nvidia/autobuild/overrides/usr/lib/dracut/dracut.conf.d/50-nvidia.conf b/runtime-display/nvidia/03-kernel/overrides/usr/lib/dracut/dracut.conf.d/50-nvidia.conf similarity index 100% rename from runtime-display/nvidia/autobuild/overrides/usr/lib/dracut/dracut.conf.d/50-nvidia.conf rename to runtime-display/nvidia/03-kernel/overrides/usr/lib/dracut/dracut.conf.d/50-nvidia.conf diff --git a/runtime-display/nvidia/03-kernel/overrides/usr/lib/modprobe.d/nvidia.conf b/runtime-display/nvidia/03-kernel/overrides/usr/lib/modprobe.d/nvidia.conf new file mode 100644 index 000000000000..31075c0ddfaa --- /dev/null +++ b/runtime-display/nvidia/03-kernel/overrides/usr/lib/modprobe.d/nvidia.conf @@ -0,0 +1 @@ +blacklist nouveau diff --git a/runtime-display/nvidia/03-kernel/overrides/usr/lib/sysusers.d/nvidia.conf b/runtime-display/nvidia/03-kernel/overrides/usr/lib/sysusers.d/nvidia.conf new file mode 100644 index 000000000000..0baf5c4feaae --- /dev/null +++ b/runtime-display/nvidia/03-kernel/overrides/usr/lib/sysusers.d/nvidia.conf @@ -0,0 +1,3 @@ +u nvidia-persistenced - "NVIDIA Persistence Daemon" / /bin/nologin +g nvidia-persistenced - - +m nvidia-persistenced nvidia-persistenced diff --git a/runtime-display/nvidia/autobuild/overrides/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf b/runtime-display/nvidia/03-kernel/overrides/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf similarity index 100% rename from runtime-display/nvidia/autobuild/overrides/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf rename to runtime-display/nvidia/03-kernel/overrides/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf diff --git a/runtime-display/nvidia/autobuild/overrides/usr/share/applications/nvidia-settings.desktop b/runtime-display/nvidia/03-kernel/overrides/usr/share/applications/nvidia-settings.desktop similarity index 100% rename from runtime-display/nvidia/autobuild/overrides/usr/share/applications/nvidia-settings.desktop rename to runtime-display/nvidia/03-kernel/overrides/usr/share/applications/nvidia-settings.desktop diff --git a/runtime-display/nvidia/autobuild/patch b/runtime-display/nvidia/03-kernel/patch similarity index 100% rename from runtime-display/nvidia/autobuild/patch rename to runtime-display/nvidia/03-kernel/patch diff --git a/runtime-display/nvidia/autobuild/patches/0001-Fix-symbolic-links-for-Linux-kernel-6.13-rc1.patch b/runtime-display/nvidia/03-kernel/patches/0001-Fix-symbolic-links-for-Linux-kernel-6.13-rc1.patch similarity index 100% rename from runtime-display/nvidia/autobuild/patches/0001-Fix-symbolic-links-for-Linux-kernel-6.13-rc1.patch rename to runtime-display/nvidia/03-kernel/patches/0001-Fix-symbolic-links-for-Linux-kernel-6.13-rc1.patch diff --git a/runtime-display/nvidia/autobuild/patches/0002-FROM-AOSC-Use-linux-aperture.c-for-removing-conflict.patch b/runtime-display/nvidia/03-kernel/patches/0002-FROM-AOSC-Use-linux-aperture.c-for-removing-conflict.patch similarity index 100% rename from runtime-display/nvidia/autobuild/patches/0002-FROM-AOSC-Use-linux-aperture.c-for-removing-conflict.patch rename to runtime-display/nvidia/03-kernel/patches/0002-FROM-AOSC-Use-linux-aperture.c-for-removing-conflict.patch diff --git a/runtime-display/nvidia/autobuild/patches/0003-FROM-AOSC-TTM-fbdev-emulation-for-Linux-6.13.patch b/runtime-display/nvidia/03-kernel/patches/0003-FROM-AOSC-TTM-fbdev-emulation-for-Linux-6.13.patch similarity index 100% rename from runtime-display/nvidia/autobuild/patches/0003-FROM-AOSC-TTM-fbdev-emulation-for-Linux-6.13.patch rename to runtime-display/nvidia/03-kernel/patches/0003-FROM-AOSC-TTM-fbdev-emulation-for-Linux-6.13.patch diff --git a/runtime-display/nvidia/autobuild/postinst.in b/runtime-display/nvidia/03-kernel/postinst.in similarity index 70% rename from runtime-display/nvidia/autobuild/postinst.in rename to runtime-display/nvidia/03-kernel/postinst.in index f9db7829b312..a784dbddfd58 100644 --- a/runtime-display/nvidia/autobuild/postinst.in +++ b/runtime-display/nvidia/03-kernel/postinst.in @@ -13,7 +13,5 @@ if test -d /usr/lib/modules; then done fi -getent group nvidia-persistenced &>/dev/null || groupadd -g 143 nvidia-persistenced -getent passwd nvidia-persistenced &>/dev/null || useradd -c 'NVIDIA Persistence Daemon' -u 143 -g nvidia-persistenced -d '/' -s /sbin/nologin nvidia-persistenced - +systemd-sysusers nvidia.conf systemctl enable nvidia-persistenced diff --git a/runtime-display/nvidia/autobuild/prepare b/runtime-display/nvidia/03-kernel/prepare similarity index 52% rename from runtime-display/nvidia/autobuild/prepare rename to runtime-display/nvidia/03-kernel/prepare index 2dbecf574967..158e4cefc44c 100644 --- a/runtime-display/nvidia/autobuild/prepare +++ b/runtime-display/nvidia/03-kernel/prepare @@ -1,7 +1,4 @@ -abinfo "Extracting archive" -sh NVIDIA-Linux-$PKGVER.run --extract-only - -abinfo "Generating postinst and prerm" +abinfo "Generating postinst and prerm ..." for i in postinst prerm; do sed -e "s/@DRV_VER@/${PKGVER}/g" ${SRCDIR}/autobuild/${i}.in > ${SRCDIR}/autobuild/${i} done diff --git a/runtime-display/nvidia/autobuild/prerm.in b/runtime-display/nvidia/03-kernel/prerm.in similarity index 100% rename from runtime-display/nvidia/autobuild/prerm.in rename to runtime-display/nvidia/03-kernel/prerm.in diff --git a/runtime-display/nvidia/autobuild/triggers b/runtime-display/nvidia/03-kernel/triggers similarity index 100% rename from runtime-display/nvidia/autobuild/triggers rename to runtime-display/nvidia/03-kernel/triggers diff --git a/runtime-display/nvidia/spec b/runtime-display/nvidia/spec index a60e0a8a53ba..d914e149ec19 100644 --- a/runtime-display/nvidia/spec +++ b/runtime-display/nvidia/spec @@ -1,18 +1,10 @@ VER=565.77 -_SETTINGS_VER=565.57.01 +REL=1 -SRCS__AMD64=" - file::rename=NVIDIA-Linux-$VER.run::https://us.download.nvidia.com/XFree86/Linux-x86_64/$VER/NVIDIA-Linux-x86_64-$VER.run - tbl::https://github.com/NVIDIA/nvidia-settings/archive/${_SETTINGS_VER}.tar.gz -" -CHKSUMS__AMD64="sha256::0a7aa742c46bcf34d766982402d17b3db1fdb3bc1b89344d70cd123c1cb3147c \ - sha256::f9947a71d24783fbc3df2b793a310aaab42a60e958606135881001f1606203be" -SRCS__ARM64=" - file::rename=NVIDIA-Linux-$VER.run::https://us.download.nvidia.com/XFree86/aarch64/$VER/NVIDIA-Linux-aarch64-${VER}.run - tbl::https://github.com/NVIDIA/nvidia-settings/archive/${_SETTINGS_VER}.tar.gz -" -CHKSUMS__ARM64="sha256::2d201852785f9cadeb72e3ded5d8b13b002e8d2a1fd7d90d39f7511c4edb4e81 \ - sha256::f9947a71d24783fbc3df2b793a310aaab42a60e958606135881001f1606203be" +SRCS__AMD64="file::rename=NVIDIA-Linux-$VER.run::https://us.download.nvidia.com/XFree86/Linux-x86_64/$VER/NVIDIA-Linux-x86_64-$VER.run" +CHKSUMS__AMD64="sha256::0a7aa742c46bcf34d766982402d17b3db1fdb3bc1b89344d70cd123c1cb3147c" +SRCS__ARM64="file::rename=NVIDIA-Linux-$VER.run::https://us.download.nvidia.com/XFree86/aarch64/$VER/NVIDIA-Linux-aarch64-${VER}.run" +CHKSUMS__ARM64="sha256::2d201852785f9cadeb72e3ded5d8b13b002e8d2a1fd7d90d39f7511c4edb4e81 " SUBDIR=. CHKUPDATE="anitya::id=5454"