Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mkgraham
x11-video-nvidiaG04
nvidia-gfxG04.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File nvidia-gfxG04.spec of Package x11-video-nvidiaG04
# # spec file for package nvidia-gfxG04 # # Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # kABI symbols are no longer generated with openSUSE >= 13.1, since they # became useless with zypper's 'multiversion' feature enabled for the kernel # as default (multiple kernels can be installed at the same time; with # different kABI symbols of course!). So it has been decided to match on the # uname output of the kernel only. We cannot use that one for NVIDIA, since we # only build against GA kernel. So let's get rid of this requirement. # %global __requires_exclude kernel-uname-r* Name: nvidia-gfxG04 Version: 390.157 Release: 0 License: SUSE-NonFree Summary: NVIDIA graphics driver kernel module for GeForce 400 series and newer URL: https://www.nvidia.com/object/unix.html Group: System/Kernel Source0: http://download.nvidia.com/XFree86/Linux-x86/%{version}/NVIDIA-Linux-x86-%{version}.run Source1: http://download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}.run Source2: pci_ids-%{version}.legacy Source3: preamble Source4: pci_ids-%{version} Source5: pci_ids-%{version}.new Source6: generate-service-file.sh Source7: README Source8: kmp-filelist Source10: kmp-post.sh Source12: my-find-supplements Source13: kmp-preun.sh Source15: kmp-pre.sh Source16: alternate-install-present Source18: kmp-postun.sh Source19: modprobe.nvidia Source20: modprobe.nvidia.install.non_uvm Source21: modprobe.nvidia.install Source22: kmp-trigger.sh Source24: kmp-triggerpostun.sh Source25: %{name}.rpmlintrc NoSource: 0 NoSource: 1 NoSource: 6 NoSource: 7 Patch0: kernel-6.2.patch Patch1: kernel-6.3.patch Patch2: kernel-6.3-i586.patch Patch3: kernel-6.4.patch Patch4: kernel-6.5.patch Patch5: kernel-6.6.patch Patch6: kernel-6.8.patch BuildRequires: bison BuildRequires: flex BuildRequires: kernel-source BuildRequires: kernel-syms %if 0%{?sle_version} >= 120400 && !0%{?is_opensuse} BuildRequires: kernel-syms-azure %endif BuildRequires: %kernel_module_package_buildreqs BuildRequires: module-init-tools BuildRequires: update-alternatives %ifarch %ix86 BuildRequires: patchutils %endif BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: %ix86 x86_64 # patch the kmp template %define kmp_template -t %define kmp_filelist kmp-filelist %define kmp_post kmp-post.sh %define kmp_preun kmp-preun.sh %define kmp_pre kmp-pre.sh %define kmp_postun kmp-postun.sh %define kmp_trigger kmp-trigger.sh %if 0%{!?kmp_template_name:1} %define kmp_template_name /usr/lib/rpm/kernel-module-subpackage %endif %if %{undefined kernel_module_directory} %define kernel_module_directory /lib/modules %endif # Tumbleweed uses %triggerin instead of %post script in order to generate # and install kernel module %if 0%{?suse_version} >= 1550 && 0%{?is_opensuse} %(sed -e '/^%%preun\>/ r %_sourcedir/%kmp_preun' -e '/^%%pre\>/ r %_sourcedir/%kmp_pre' -e '/^%%postun\>/ r %_sourcedir/%kmp_postun' -e '/^Provides: multiversion(kernel)/d' %kmp_template_name >%_builddir/nvidia-kmp-template) %(cp %_builddir/nvidia-kmp-template %_builddir/nvidia-kmp-template.old) # if %pre scriptlet sample missing in template %(grep -q "^%pre -n" %_builddir/nvidia-kmp-template || (echo "%pre -n %%{-n*}-kmp-%1" >> %_builddir/nvidia-kmp-template; cat %_sourcedir/%kmp_pre >> %_builddir/nvidia-kmp-template)) %(echo "%triggerin -n %%{-n*}-kmp-%1 -- kernel-default-devel" >> %_builddir/nvidia-kmp-template) %(cat %_sourcedir/%kmp_preun >> %_builddir/nvidia-kmp-template) %(cat %_sourcedir/%kmp_trigger >> %_builddir/nvidia-kmp-template) # Let all initrds get generated by regenerate-initrd-posttrans # if kernel-<flavor>-devel gets updated %(echo "%%{?regenerate_initrd_posttrans}" >> %_builddir/nvidia-kmp-template) # cleanup: remove no longer used kernel modules (boo#1164520) %(echo "%triggerpostun -n %%{-n*}-kmp-%1 -- kernel-default" >> %_builddir/nvidia-kmp-template) %(cat %_sourcedir/kmp-triggerpostun.sh >> %_builddir/nvidia-kmp-template) %ifarch %ix86 %(echo "%triggerin -n %%{-n*}-kmp-%1 -- kernel-pae-devel" >> %_builddir/nvidia-kmp-template) %(cat %_sourcedir/%kmp_preun >> %_builddir/nvidia-kmp-template) %(cat %_sourcedir/%kmp_trigger >> %_builddir/nvidia-kmp-template) # Let all initrds get generated by regenerate-initrd-posttrans # if kernel-<flavor>-devel gets updated %(echo "%%{?regenerate_initrd_posttrans}" >> %_builddir/nvidia-kmp-template) %endif %else %(sed -e '/^%%post\>/ r %_sourcedir/%kmp_post' -e '/^%%preun\>/ r %_sourcedir/%kmp_preun' -e '/^%%pre\>/ r %_sourcedir/%kmp_pre' -e '/^%%postun\>/ r %_sourcedir/%kmp_postun' -e '/^Provides: multiversion(kernel)/d' %kmp_template_name >%_builddir/nvidia-kmp-template) %(cp %_builddir/nvidia-kmp-template %_builddir/nvidia-kmp-template.old) # moved from %kmp_post snippet to this place (boo#1145316) %(sed -i '/^%%posttrans/i \ exit $RES' %_builddir/nvidia-kmp-template) # if %pre scriptlet sample missing in template %(grep -q "^%pre -n" %_builddir/nvidia-kmp-template || (echo "%pre -n %%{-n*}-kmp-%1" >> %_builddir/nvidia-kmp-template; cat %_sourcedir/%kmp_pre >> %_builddir/nvidia-kmp-template)) # Leap 42.3/sle12-sp3 needs this to recompile module after having # uninstalled drm-kmp package (%triggerpostun) %if 0%{?suse_version} < 1320 && 0%{?sle_version} >= 120300 %(echo "%triggerpostun -n %%{-n*}-kmp-%1 -- drm-kmp-default" >> %_builddir/nvidia-kmp-template) %(cat %_sourcedir/%kmp_preun >> %_builddir/nvidia-kmp-template) %(cat %_sourcedir/%kmp_post >> %_builddir/nvidia-kmp-template) %(echo 'nvr=%%{-n*}-kmp-%1-%_this_kmp_version-%%{-r*}' >> %_builddir/nvidia-kmp-template) %(echo 'wm2=/usr/lib/module-init-tools/weak-modules2' >> %_builddir/nvidia-kmp-template) %(echo 'if [ -x $wm2 ]; then' >> %_builddir/nvidia-kmp-template) %(echo ' %%{-b:KMP_NEEDS_MKINITRD=1} INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} $wm2 --add-kmp $nvr' >> %_builddir/nvidia-kmp-template) %(echo 'fi' >> %_builddir/nvidia-kmp-template) # moved from %kmp_post snippet to this place (boo#1145316) %(echo 'exit $RES' >> %_builddir/nvidia-kmp-template) # Let all initrds get generated by regenerate-initrd-posttrans # if drm-kmp-default gets uninstalled %(echo "%%{?regenerate_initrd_posttrans}" >> %_builddir/nvidia-kmp-template) %endif %endif %define x_flavors kdump um debug xen xenpae %if 0%{!?nvbuild:1} %define kver %(for dir in /usr/src/linux-obj/*/*/; do make %{?jobs:-j%jobs} -s -C "$dir" kernelversion 2>/dev/null; break; done |perl -ne '/(\\d+)\\.(\\d+)\\.(\\d+)?/&&printf "%%d%%02d%%03d\\n",$1,$2,$3') %if %kver >= 206027 %if %kver < 206031 %define x_flavors kdump um debug %endif %endif %endif %kernel_module_package %kmp_template %_builddir/nvidia-kmp-template -p %_sourcedir/preamble -f %_sourcedir/%kmp_filelist -x %x_flavors # supplements no longer depend on the driver %if 0%{?suse_version} > 1320 %if (0%{?sle_version} >= 150100 || 0%{?suse_version} >= 1550) %define pci_id_file %_sourcedir/pci_ids-%version.legacy %else %define pci_id_file %_sourcedir/pci_ids-%version %endif %else %define pci_id_file %_sourcedir/pci_ids-%version.new %endif # rpm 4.14.1 changed again (boo#1087460) %define __kmp_supplements %_sourcedir/my-find-supplements %pci_id_file # rpm 4.9+ using the internal dependency generators %define __ksyms_supplements %_sourcedir/my-find-supplements %pci_id_file %name # older rpm %define __find_supplements %_sourcedir/my-find-supplements %pci_id_file %name # newer rpmbuilds attach the kernel version and the major part of release to %%pci_id_file of the __kmp_supplements script # boo#1190210 %define kbuildver %(rpm -q --queryformat '%%{VERSION}_%%{RELEASE}' kernel-syms | sed -n 's/\\(.*\\)\\.[0-9]\\{1,\\}/\\1/p') # get rid of ksyms on Leap 15.1/15.2; for weird reasons they are not generated on TW %define __kmp_requires %{nil} %description This package provides the closed-source NVIDIA graphics driver kernel module for GeForce 400 series and newer GPUs. %package KMP License: SUSE-NonFree Summary: NVIDIA graphics driver kernel module for GeForce 400 series and newer Group: System/Kernel %description KMP This package provides the closed-source NVIDIA graphics driver kernel module for GeForce 400 series and newer GPUs. %prep echo "kver = %kver" %setup -T -c %{name}-%{version} %ifarch %ix86 sh %{SOURCE0} -x %endif %ifarch x86_64 sh %{SOURCE1} -x %endif pushd NVIDIA-Linux-x86*-%{version}*/ # apply patches here ... pushd kernel %patch0 -p2 %ifarch %ix86 %patch2 -p1 %else %patch1 -p1 %endif %patch3 -p3 %patch4 -p2 %patch5 -p1 %patch6 -p2 find . -name "*.orig" -exec rm {} \; popd popd #rm -rf NVIDIA-Linux-x86*-%{version}-*/usr/src/nv/precompiled mkdir -p source/%{version} cp -R NVIDIA-Linux-x86*-%{version}*/kernel/* source/%{version} || : pushd source/%{version} # mark support as external echo "nvidia.ko external" > Module.supported #already in G03 (meanwhile appears in G04 output after fixing script for ID generation) for id in 0x06D8 0x06D9 0x06DC 0x06DD 0x0FEC 0x109B; do sed -i /${id}/d %_sourcedir/pci_ids-%{version} sed -i /${id}/d %_sourcedir/pci_ids-%{version}.new done chmod 755 %_sourcedir/my-find-supplements* popd # symlink the %pci_id_file to the one, that rpmbuild generates, to enable my-find-supplement to succeed properly # boo#1190210 pushd %_sourcedir ln -sv %pci_id_file pci_ids-%{version}_k%{kbuildver} popd mkdir obj sed -i -e 's,-o "$ARCH" = "x86_64",-o "$ARCH" = "x86_64" -o "$ARCH" = "x86",' source/*/conftest.sh %build export EXTRA_CFLAGS='-DVERSION=\"%{version}\"' # radix_tree_preloads symbol becomes GPL-only in Kernel 5.8 (boo#1173445) %if 0%{?suse_version} >= 1550 export NV_EXCLUDE_KERNEL_MODULES=nvidia-uvm # needed since kernel 5.11, but only on i386 !?! %ifarch %ix86 export NV_EXCLUDE_KERNEL_MODULES="nvidia-uvm nvidia-drm" %endif %endif for flavor in %flavors_to_build; do src=/lib/modules/$(make %{?jobs:-j%jobs} -siC %{kernel_source $flavor} kernelrelease)/source rm -rf obj/$flavor cp -r source obj/$flavor make %{?jobs:-j%jobs} -C /usr/src/linux-obj/%_target_cpu/$flavor modules M=$PWD/obj/$flavor/%{version} SYSSRC="$src" SYSOUT=/usr/src/linux-obj/%_target_cpu/$flavor pushd $PWD/obj/$flavor/%{version} make %{?jobs:-j%jobs} -f Makefile nv-linux.o SYSSRC="$src" SYSOUT=/usr/src/linux-obj/%_target_cpu/$flavor popd done %install ### do not sign the ghost .ko file, it is generated on target system anyway export BRP_PESIGN_FILES="" export INSTALL_MOD_PATH=%{buildroot} export INSTALL_MOD_DIR=updates # radix_tree_preloads symbol became GPL-only in Kernel 5.8 (boo#1173445) %if 0%{?suse_version} >= 1550 export NV_EXCLUDE_KERNEL_MODULES=nvidia-uvm # needed since kernel 5.11, but only on i386 !?! %ifarch %ix86 export NV_EXCLUDE_KERNEL_MODULES="nvidia-uvm nvidia-drm" %endif %endif for flavor in %flavors_to_build; do export SYSSRC=/lib/modules/$(make %{?jobs:-j%jobs} -siC %{kernel_source $flavor} kernelrelease)/source make %{?jobs:-j%jobs} -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install M=$PWD/obj/$flavor/%{version} #install -m 644 $PWD/obj/$flavor/%{version}/{nv-linux.o,nv-kernel.o} \ # %{buildroot}/lib/modules/*-$flavor/updates mkdir -p %{buildroot}/usr/src/kernel-modules/nvidia-%{version}-${flavor} cp -r source/%{version}/* %{buildroot}/usr/src/kernel-modules/nvidia-%{version}-${flavor} done %if 0%{?suse_version} >= 1550 dracut_dir=//usr/lib/dracut modprobe_dir=/usr/lib/modprobe.d %else dracut_dir=/etc modprobe_dir=%{_sysconfdir}/modprobe.d %endif mkdir -p %{buildroot}/$modprobe_dir mkdir -p %{buildroot}/usr/lib/nvidia/ for flavor in %flavors_to_build; do echo "blacklist nouveau" > %{buildroot}$modprobe_dir/nvidia-$flavor.conf # make it with flavor name or rpmlint complains about not making it conflict cp %{SOURCE16} %{buildroot}/usr/lib/nvidia/alternate-install-present-${flavor} touch %{buildroot}/usr/lib/nvidia/alternate-install-present mkdir -p %{buildroot}/$dracut_dir/dracut.conf.d cat > %{buildroot}/$dracut_dir/dracut.conf.d/60-nvidia-$flavor.conf << EOF omit_drivers+=" nvidia nvidia-drm nvidia-modeset nvidia-uvm " EOF mkdir -p %{buildroot}/$modprobe_dir modfile=%{buildroot}/$modprobe_dir/50-nvidia-$flavor.conf %ifarch x86_64 modscript=$RPM_SOURCE_DIR/modprobe.nvidia.install %else modscript=$RPM_SOURCE_DIR/modprobe.nvidia.install.non_uvm %endif install -m 644 $RPM_SOURCE_DIR/modprobe.nvidia $modfile echo -n "install nvidia " >> $modfile tail -n +3 $modscript | awk '{ printf "%s ", $0 }' >> $modfile done %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor