Nvidia 2D/3D on 2.6.x (was Re: getting Nvidia 2D/3D to work (M.Hockings))

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2003-11-09 at 09:21, David Utidjian wrote:
my comments for 2.6.x kernels:

> # cd /path/to/where/you/put/it
> # sh NVIDIA-Linux-x86-1.0-4496-pkg2.run
instead of this, run:

# sh NVIDIA-Linux-x86-1.0-4496-pkg2.run --extract-only
# cd NVIDIA-Linux-x86-1.0-4496-pkg2/usr/src/nv


now download the 2.6.x kernel patches for NVIDIA from www.minion.de:


# wget http://www.minion.de/files/NVIDIA_kernel-1.0-4496-2.6.diff
# patch -p1 < NVIDIA_kernel-1.0-4496-2.6.diff
# ln -s Makefile.kbuild Makefile
# make SYSINCLUDE=/path/to/2.6/include CC=gcc32 module
# cp nvidia.ko /lib/modules/<kernelversion>/kernel/drivers/video


since NVIDIA's installer doesn't work for 2.6.x kernels, you need to do
things a bit differently for XFree86 GLX and driver. You can still use
the NVIDIA-shipped Makefile to install the files in the old way:


# cd ../../..
# make install


the rest of the stuff is pretty much the same as in the previous post.

i've attached a spec file i use to build an nvidia-kernel RPM package
for 2.6/2.4 kernels, it gets rid of a lot of makework for the kernel
portion of things, do this and you could skip the commands above and
just build & install the RPM:

example:

# env KVER=2.6.0-test9 rpmbuild --with kernel26 -ba nvidia-kernel.spec
# env KVER=2.4.22-1.2115.nptl rpmbuild -ba nvidia-kernel.spec

would build nvidia-kernel RPM packages named
nvidia-kernel-2.4.22-1.2115.nptl and nvidia-kernel-2.6.0-test9,
respectively.

you'll have to place the .run and .diff file in /usr/src/redhat/SOURCES
before this will work though.

the spec file is pure evil, but it works for me :) 

leon
# 
# Options to rpmbuild
#		--with kernel26
#			Build kernel requires 2.6.x kernel support
#		--without gcc32
#			Use default GCC to build kernel module instead of GCC 3.2
# 

%define k_ver    %(echo ${KVER:-`uname -r`})
%define k_src    %(echo ${KSRC:-/lib/modules/%{k_ver}/build})
%define k_cc     %{?_without_gcc32:gcc}%{!?_without_gcc32:gcc32}
%define k_mod    %{?_with_kernel26:nvidia.ko}%{!?_with_kernel26:nvidia.o}

%define nv_ver   1.0
%define nv_rel   4496
%define nv_url0  http://download.nvidia.com/XFree86/Linux-x86/%{nv_ver}-%{nv_rel}
%define nv_base  NVIDIA-Linux-x86-%{nv_ver}-%{nv_rel}-pkg2
%define nv_src0  %{nv_base}.run
%define nv_url1  http://www.minion.de/files/
%define nv_src1  NVIDIA_kernel-%{nv_ver}-%{nv_rel}-2.6.diff

Name:      nvidia-kernel-%{k_ver}
Version:   %{nv_ver}.%{nv_rel}
Release:   ljb.0
Summary:   NVIDIA Linux Display Driver

Group:     System Environment/Kernel
License:   Proprietary
URL:       http://www.nvidia.com/linux
Source0:   %{nv_url}/%{nv_src0}
Source1:   %{nv_url1}/%{nv_src1}

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: i386

BuildRequires: patch, make, %{!?_without_gcc32:gcc32}%{?_without_gcc32:gcc}

%description
NVIDIA's Linux Display Driver. This package contains the kernel module component 
for kernel %{k_ver}.

%prep
rm -rf %{nv_base}
sh %{_sourcedir}/%{nv_src0} --extract-only
%if %{?_with_kernel26:1}%{!?_with_kernel26:0}
cd %{nv_base}/usr/src/nv
%{__patch} -p1 < %{_sourcedir}/%{nv_src1}
%{__ln_s} Makefile.kbuild Makefile
%endif

%build
if [ ! -f %{k_src}/Makefile -a ! -f %{k_src}/include/linux/uts.h ]; then
	echo Missing %{k_src}/Makefile and/or other files,  bailing out.
	exit 1
fi
cd %{nv_base}/usr/src/nv
%if %{?_with_kernel26:1}%{!?_with_kernel26:0}
%{__make} KERNDIR=%{k_src} CC=%{k_cc} HOSTCC=%{k_cc} module
%else
%{__make} SYSINCLUDE=%{k_src}/include CC=%{k_cc} nvidia.o
%endif

%install
mkdir -p %{buildroot}/usr/share/doc/%{name} \
         %{buildroot}/lib/modules/%{k_ver}/kernel/drivers/video
cd %{_builddir}/%{nv_base}
cp -f LICENSE %{buildroot}/usr/share/doc/%{name}
cp -f usr/src/nv/%{k_mod} %{buildroot}/lib/modules/%{k_ver}/kernel/drivers/video/%{k_mod}

%clean
rm -rf %{buildroot}
rm -rf %{_builddir}/%{nv_base}

%files
%defattr(0644,root,root,0755)
%doc /usr/share/doc/%{name}/LICENSE
%attr(0744,root,root) /lib/modules/%{k_ver}/kernel/drivers/video/*

%changelog
* Mon Nov 10 2003 Leon Breedt <ljb at rpm.bitserf.org> - %{nv_ver}.%{nv_rel}-%{release}
- Initial version

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux