From f411c55c839fd213906e55eb3d2a0892e8325b7d Mon Sep 17 00:00:00 2001 From: heftig Date: Wed, 10 May 2023 09:55:12 +0000 Subject: [PATCH] archrelease: copy trunk to testing-x86_64 git-svn-id: file:///srv/repos/svn-packages/svn@477044 eb2447ed-0c53-47e4-bac8-5bc4a241df78 --- nvidia-open/repos/testing-x86_64/PKGBUILD | 94 ++++++++++++++++++++++ .../testing-x86_64/nvidia-open-gcc-ibt-sls.patch | 10 +++ 2 files changed, 104 insertions(+) create mode 100644 nvidia-open/repos/testing-x86_64/PKGBUILD create mode 100644 nvidia-open/repos/testing-x86_64/nvidia-open-gcc-ibt-sls.patch diff --git a/nvidia-open/repos/testing-x86_64/PKGBUILD b/nvidia-open/repos/testing-x86_64/PKGBUILD new file mode 100644 index 00000000000..70bd162a6c0 --- /dev/null +++ b/nvidia-open/repos/testing-x86_64/PKGBUILD @@ -0,0 +1,94 @@ +# Maintainer: Sven-Hendrik Haase +pkgbase=nvidia-open +pkgname=(nvidia-open nvidia-open-dkms) +pkgver=530.41.03 +pkgrel=10 +pkgdesc="NVIDIA open kernel modules" +arch=('x86_64') +url="https://github.com/NVIDIA/open-gpu-kernel-modules" +depends=("nvidia-utils=${pkgver}" 'libglvnd') +makedepends=('linux-headers') +license=('GPL') +options=('!lto' '!buildflags') +source=("$pkgname-$pkgver.tar.gz::https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/${pkgver}.tar.gz" + nvidia-open-gcc-ibt-sls.patch) +sha512sums=('159f913ec6c46ec29f8b9ba7858965f7f4ff34cf5ea5fdf2e48a59b2145a1e113330f574148213a98b475113db920ecde4d5059a31a251c204ee838c662e854e' + '263c4c5e75ef8cb8ca2641c022dfaf8bd9222fadf68ed15120b0ae7dd9cc901a04ce2e55625d513a0995759c9d82dfbdc4c33d4751159124915d7404b1400e34') + +prepare() { + cd open-gpu-kernel-modules-${pkgver} + + # Fix for https://bugs.archlinux.org/task/74886 + patch -Np1 --no-backup-if-mismatch -i "$srcdir"/nvidia-open-gcc-ibt-sls.patch + + # Attempt to make this reproducible + sed -i "s/^HOSTNAME.*/HOSTNAME = echo archlinux"/ utils.mk + sed -i "s/^WHOAMI.*/WHOAMI = echo archlinux-builder"/ utils.mk + sed -i "s/^DATE.*/DATE = date -r version.mk"/ utils.mk + + sed -i "s/__VERSION_STRING/${pkgver}/" kernel-open/dkms.conf + sed -i 's/__JOBS/`nproc`/' kernel-open/dkms.conf + sed -i 's/__EXCLUDE_MODULES//' kernel-open/dkms.conf + sed -i 's/__DKMS_MODULES//' kernel-open/dkms.conf + sed -i '$i\ +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"' kernel-open/dkms.conf + + # Clean version for later copying for DKMS + cp -r ../open-gpu-kernel-modules-${pkgver} "$srcdir"/open-gpu-kernel-modules-dkms +} + +build() { + cd open-gpu-kernel-modules-${pkgver} + make SYSSRC="/usr/src/linux" +} + +package_nvidia-open() { + depends+=('linux') + conflicts=('NVIDIA-MODULE') + provides=('NVIDIA-MODULE') + + cd open-gpu-kernel-modules-${pkgver} + _extradir="/usr/lib/modules/$( "$pkgdir"/usr/lib/modprobe.d/nvidia-open.conf + + install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname +} + +package_nvidia-open-dkms() { + depends+=('dkms') + conflicts=('nvidia-open' 'NVIDIA-MODULE') + provides=('nvidia-open' 'NVIDIA-MODULE') + + install -dm 755 "${pkgdir}"/usr/src + # cp -dr --no-preserve='ownership' kernel-open "${pkgdir}/usr/src/nvidia-$pkgver" + cp -dr --no-preserve='ownership' open-gpu-kernel-modules-dkms "${pkgdir}/usr/src/nvidia-$pkgver" + mv "${pkgdir}/usr/src/nvidia-$pkgver/kernel-open/dkms.conf" "${pkgdir}/usr/src/nvidia-$pkgver/dkms.conf" + + # Force module to load even on unsupported GPUs + mkdir -p "$pkgdir"/usr/lib/modprobe.d + echo "options nvidia NVreg_OpenRmEnableUnsupportedGpus=1" > "$pkgdir"/usr/lib/modprobe.d/nvidia-open.conf + + install -Dm644 open-gpu-kernel-modules-${pkgver}/COPYING "$pkgdir"/usr/share/licenses/$pkgname +} + +# vim:set sw=2 et: diff --git a/nvidia-open/repos/testing-x86_64/nvidia-open-gcc-ibt-sls.patch b/nvidia-open/repos/testing-x86_64/nvidia-open-gcc-ibt-sls.patch new file mode 100644 index 00000000000..258026c64a7 --- /dev/null +++ b/nvidia-open/repos/testing-x86_64/nvidia-open-gcc-ibt-sls.patch @@ -0,0 +1,10 @@ +--- a/src/nvidia-modeset/Makefile ++++ b/src/nvidia-modeset/Makefile +@@ -142,6 +142,7 @@ ifeq ($(TARGET_ARCH),x86_64) + CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fno-jump-tables) + CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch=thunk-extern) + CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch-register) ++ CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mharden-sls=all) + endif + + CFLAGS += $(CONDITIONAL_CFLAGS) -- 2.11.4.GIT