diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2003-09-07 01:49:43 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2003-09-07 01:49:43 +0000 |
commit | d019e6057951cb15bcecb68eeaee1dabfd39aba2 (patch) | |
tree | 00a7e4469388dced1a9d57ebded75843cbe67c6d /media-video/nvidia-kernel | |
parent | Add a patch to support kdev_t changes in 2.6.0-test4-bk8 and later. (diff) | |
download | gentoo-2-d019e6057951cb15bcecb68eeaee1dabfd39aba2.tar.gz gentoo-2-d019e6057951cb15bcecb68eeaee1dabfd39aba2.tar.bz2 gentoo-2-d019e6057951cb15bcecb68eeaee1dabfd39aba2.zip |
Add a patch to support kdev_t changes in 2.6.0-test4-bk8 and later.
Diffstat (limited to 'media-video/nvidia-kernel')
5 files changed, 261 insertions, 5 deletions
diff --git a/media-video/nvidia-kernel/ChangeLog b/media-video/nvidia-kernel/ChangeLog index c74e6d392091..b80afad4dee0 100644 --- a/media-video/nvidia-kernel/ChangeLog +++ b/media-video/nvidia-kernel/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for media-video/nvidia-kernel # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/ChangeLog,v 1.44 2003/08/21 18:28:36 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/ChangeLog,v 1.45 2003/09/07 01:49:32 azarah Exp $ + +*nvidia-kernel-1.0.4496-r2 (07 Sep 2003) + + 07 Sep 2003; Martin Schlemmer <azarah@gentoo.org> + nvidia-kernel-1.0.4496-r2.ebuild, + files/1.0.4496/NVIDIA_kernel-1.0-4496-2.6-bk8.diff: + Add a patch to support kdev_t changes in 2.6.0-test4-bk8 and later. *nvidia-kernel-1.0.4496-r1 (21 Aug 2003) diff --git a/media-video/nvidia-kernel/Manifest b/media-video/nvidia-kernel/Manifest index 581fa11da1da..2cd6c5e9260a 100644 --- a/media-video/nvidia-kernel/Manifest +++ b/media-video/nvidia-kernel/Manifest @@ -2,13 +2,12 @@ MD5 c702c825e82c54f3dbc79bf8b52f9fa8 nvidia-kernel-1.0.4496.ebuild 4364 MD5 71f31698e2badcb05ff439f746d0532a nvidia-kernel-1.0.4496-r1.ebuild 4254 MD5 c6c5f9488fddf3a6b223d08f45750b19 nvidia-kernel-1.0.3123-r2.ebuild 3072 MD5 4a798d53143642b8b5d2c24af6082fe1 nvidia-kernel-1.0.4349-r2.ebuild 3495 -MD5 98236c8b70fef8fc126f49701e42f508 ChangeLog 9646 -MD5 94f22ce93ac7ff80abe28194cb21038d nvidia-kernel-1.0.4496-r2.ebuild 4393 +MD5 6ca709ce0f5b9e7528caad1488116ec7 ChangeLog 9901 +MD5 59df0d78367131cd4559527e4be8e2e8 nvidia-kernel-1.0.4496-r2.ebuild 4393 MD5 7743c74091c9c2a5aff6fd9491ec5bd1 nvidia-kernel-1.0.2960-r1.ebuild 1941 MD5 e0aded1a33c8312ef5a2d5646bed942c nvidia-kernel-1.0.4180.ebuild 3666 MD5 6d2f9df2417c53b336b4dd13cdb0dd28 nvidia-kernel-1.0.4363-r3.ebuild 3998 MD5 5c16c38d2ef5fc4895959c219023b43c nvidia-kernel-1.0.4191-r2.ebuild 3667 -MD5 99667c29440528ba2af6ffab1636f084 .nvidia-kernel-1.0.4496-r2.ebuild.swp 20480 MD5 8c3363db02cd58505aacb38930d37fb3 nvidia-kernel-1.0.4363-r2.ebuild 3972 MD5 56284499e6371ee2379be3135c336649 nvidia-kernel-1.0.2880-r1.ebuild 1920 MD5 56ebaa3ba92e9db848baea746a6aef1a files/digest-nvidia-kernel-1.0.4363-r3 74 @@ -41,5 +40,5 @@ MD5 bfab7c503df743f63b14c6de5c973578 files/1.0.4496/NVIDIA_kernel-1.0-4496-tail. MD5 972f2a34cddf901c4cc914c308a93f82 files/1.0.4496/NVIDIA_kernel-1.0-4496-Makefile.diff 7035 MD5 a56c1de0a54a1213dcc7318a861cc479 files/1.0.4496/NVIDIA_kernel-1.0-4496-2.5-20030728.diff 79291 MD5 9be6d1ba5ad67a08e0cfa2d5cf0169d9 files/1.0.4496/NVIDIA_kernel-1.0-4496-2.6-20030818.diff 874 -MD5 946cc4a6409490baae759cb84df47e91 files/1.0.4496/NVIDIA_kernel-1.0-4496-2.6-bk8.diff 3286 +MD5 7bc455fa6da506eb2a55549666d0b75e files/1.0.4496/NVIDIA_kernel-1.0-4496-2.6-bk8.diff 2735 MD5 47a817ba3331401205bf3e2b884540e4 files/1.0.4496/NVIDIA_kernel-1.0-4496-2.5-20030818.diff 78587 diff --git a/media-video/nvidia-kernel/files/1.0.4496/NVIDIA_kernel-1.0-4496-2.6-bk8.diff b/media-video/nvidia-kernel/files/1.0.4496/NVIDIA_kernel-1.0-4496-2.6-bk8.diff new file mode 100644 index 000000000000..731826d6ddc8 --- /dev/null +++ b/media-video/nvidia-kernel/files/1.0.4496/NVIDIA_kernel-1.0-4496-2.6-bk8.diff @@ -0,0 +1,87 @@ +diff -urpN nv/Makefile.kbuild nv.kdev_val/Makefile.kbuild +--- nv/Makefile.kbuild 2003-09-07 01:38:37.683707640 +0200 ++++ nv.kdev_val/Makefile.kbuild 2003-09-07 02:30:08.068897680 +0200 +@@ -134,6 +134,15 @@ ifeq ($(shell sh $(src)/conftest.sh rema + endif + + # ++# Linux 2.6.0-test4-bk8 and later do not have the kdev_val(kdev_t) function ++# anymore. ++# ++ ++ifeq ($(shell sh $(src)/conftest.sh have_kdev_val $(KERNEL_HEADERS)), 1) ++ EXTRA_CFLAGS += -DHAVE_KDEV_VAL ++endif ++ ++# + # NVIDIA binary object file includes .common section. + # + +diff -urpN nv/Makefile.nvidia nv.kdev_val/Makefile.nvidia +--- nv/Makefile.nvidia 2003-09-07 01:38:37.685707336 +0200 ++++ nv.kdev_val/Makefile.nvidia 2003-09-07 02:35:47.404310856 +0200 +@@ -64,6 +64,14 @@ ifeq ($(shell sh conftest.sh remap_page_ + DEFINES += -DREMAP_PAGE_RANGE_4 + endif + ++# ++# Linux 2.6.0-test4-bk8 and later do not have the kdev_val(kdev_t) function ++# anymore. ++# ++ifeq ($(shell sh conftest.sh have_kdev_val $(INCLUDES)), 1) ++ DEFINES += -DHAVE_KDEV_VAL ++endif ++ + DEFINES+=$(EXTRA_DEFINES) + + # allow build parameters to be passed in through the environment +diff -urpN nv/conftest.sh nv.kdev_val/conftest.sh +--- nv/conftest.sh 2003-09-07 01:38:37.687707032 +0200 ++++ nv.kdev_val/conftest.sh 2003-09-07 02:46:38.104389408 +0200 +@@ -38,6 +38,27 @@ case "$1" in + fi + ;; + ++ have_kdev_val) ++ shift ++ # ++ # Determine if we have the kdev_val() function. ++ # ++ echo "#include <linux/kdev_t.h> ++ int do_test_have_kdev_val(kdev_t dev) { ++ int retval = kdev_val(dev); ++ }" > conftest.c ++ ++ gcc -c conftest.c -o conftest.o $* -D__KERNEL__ > /dev/null 2>&1 ++ ++ if test -f conftest.o; then ++ echo "1" ++ rm -f conftest.{c,o} ++ else ++ echo "0" ++ rm -f conftest.{c,o} ++ fi ++ ;; ++ + cc_sanity_check) + shift + # +diff -urpN nv/nv-linux.h nv.kdev_val/nv-linux.h +--- nv/nv-linux.h 2003-09-07 01:38:38.019656568 +0200 ++++ nv.kdev_val/nv-linux.h 2003-09-07 02:18:47.367380040 +0200 +@@ -358,8 +358,13 @@ extern struct mem_track_t *fp_list; + #define NV_VMA_PRIVATE(vma) ((vma)->vm_private_data) + + #ifdef KERNEL_2_5 +-# define NV_DEVICE_NUMBER(_minor) ((kdev_val(_minor)) & 0x0f) +-# define NV_IS_CONTROL_DEVICE(_minor) (((kdev_val(_minor)) & 0xff) == 0xff) ++# ifdef HAVE_KDEV_VAL ++# define NV_DEVICE_NUMBER(_minor) ((kdev_val(_minor)) & 0x0f) ++# define NV_IS_CONTROL_DEVICE(_minor) (((kdev_val(_minor)) & 0xff) == 0xff) ++# else ++# define NV_DEVICE_NUMBER(_minor) ((_minor) & 0x0f) ++# define NV_IS_CONTROL_DEVICE(_minor) (((_minor) & 0xff) == 0xff) ++# endif + # define NV_IS_SUSER() capable(CAP_SYS_ADMIN) + # ifdef CONFIG_PCI_NAMES + # define NV_PCI_DEVICE_NAME(x) ((x)->pretty_name) diff --git a/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4496-r2 b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4496-r2 new file mode 100644 index 000000000000..5fe85ccc3da6 --- /dev/null +++ b/media-video/nvidia-kernel/files/digest-nvidia-kernel-1.0.4496-r2 @@ -0,0 +1 @@ +MD5 cc8cc9b0fda676b074869e50844c969a NVIDIA-Linux-x86-1.0-4496-pkg0.run 5125585 diff --git a/media-video/nvidia-kernel/nvidia-kernel-1.0.4496-r2.ebuild b/media-video/nvidia-kernel/nvidia-kernel-1.0.4496-r2.ebuild new file mode 100644 index 000000000000..30bb8b5e775e --- /dev/null +++ b/media-video/nvidia-kernel/nvidia-kernel-1.0.4496-r2.ebuild @@ -0,0 +1,162 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.4496-r2.ebuild,v 1.1 2003/09/07 01:49:33 azarah Exp $ + +NV_V="${PV/1.0./1.0-}" +NV_PACKAGE="NVIDIA-Linux-x86-${NV_V}" +S="${WORKDIR}/${NV_PACKAGE}-pkg0/usr/src/nv" +DESCRIPTION="Linux kernel module for the NVIDIA's X driver" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="ftp://download.nvidia.com/XFree86/Linux-x86/${NV_V}/${NV_PACKAGE}-pkg0.run" + +# The slow needs to be set to $KV to prevent unmerges of modules for other kernels. +LICENSE="NVIDIA" +SLOT="${KV}" +KEYWORDS="-* ~x86" +RESTRICT="nostrip" + +DEPEND="virtual/linux-sources" + +pkg_setup() { + if [ ! -f /proc/mtrr ] + then + eerror "This version needs MTRR support for most chipsets!" + eerror "Please enable MTRR support in your kernel config, found at:" + eerror + eerror " Processor type and features -> [*] MTRR (Memory Type Range Register) support" + eerror + eerror "and recompile your kernel ..." + die "MTRR support not detected!" + fi + + check_version_h +} + +check_version_h() { + if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ] + then + eerror "Please verify that your /usr/src/linux symlink is pointing" + eerror "to your current kernel sources, and that you did run:" + eerror + eerror " # make dep" + die "/usr/src/linux symlink not setup!" + fi +} + +get_KV_info() { + check_version_h + + # Get the kernel version of sources in /usr/src/linux ... + export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \ + "${ROOT}/usr/src/linux/include/linux/version.h")" + export KV_major="$(echo "${KV_full}" | cut -d. -f1)" + export KV_minor="$(echo "${KV_full}" | cut -d. -f2)" + export KV_micro="$(echo "${KV_full}" | cut -d. -f3 | sed -e 's:[^0-9].*::')" +} + +is_2_5_kernel() { + get_KV_info + + if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 5 ] + then + return 0 + else + return 1 + fi +} + +is_2_6_kernel() { + get_KV_info + + if [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 6 ] + then + return 0 + else + return 1 + fi +} + +src_unpack() { + cd ${WORKDIR} + bash ${DISTDIR}/${NV_PACKAGE}-pkg0.run --extract-only + + # Next section applies patches for linux-2.5 kernel, and/or + # bugfixes for linux-2.4. All these are from: + # + # http://www.minion.de/nvidia/ + # + # Many thanks to Christian Zander <zander@minion.de> for bringing + # these to us, and being so helpful to select which to use. + + get_KV_info + + cd ${S} + einfo "Linux kernel ${KV_major}.${KV_minor}.${KV_micro}" + + if is_2_5_kernel || is_2_6_kernel + then + EPATCH_SINGLE_MSG="Applying tasklet patch for kernel 2.[56]..." \ + epatch ${FILESDIR}/${PV}/NVIDIA_kernel-${NV_V}-2.5-20030818.diff + + if is_2_6_kernel + then + EPATCH_SINGLE_MSG="Applying patch for pci device name change..." \ + epatch ${FILESDIR}/${PV}/NVIDIA_kernel-${NV_V}-2.6-20030818.diff + + EPATCH_SINGLE_MSG="Applying kdev_t patch for kernel 2.6.0-test4-bk8..." \ + epatch ${FILESDIR}/${PV}/NVIDIA_kernel-${NV_V}-2.6-bk8.diff + fi + + # Kbuild have issues currently (sandbox related). + ln -snf Makefile.nvidia Makefile + fi +} + +src_compile() { + # Portage should determine the version of the kernel sources + check_KV + + # IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been + # updated but the running kernel is still compiled with an older gcc. This is + # needed for chrooted building, where the sanity check detects the gcc of the + # kernel outside the chroot rather than within. + make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \ + clean nvidia.o || die +} + +src_install() { + # The driver goes into the standard modules location + insinto /lib/modules/${KV}/video + doins nvidia.o + + # Add the aliases + insinto /etc/modules.d + newins ${FILESDIR}/nvidia-1.1 nvidia + + # Docs + dodoc ${S}/README + + # The device creation script + into / + newsbin ${S}/makedevices.sh NVmakedevices.sh +} + +pkg_postinst() { + if [ "${ROOT}" = "/" ] + then + # Update module dependency + [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules + if [ ! -e /dev/.devfsd ] && [ -x /sbin/NVmakedevices.sh ] + then + /sbin/NVmakedevices.sh >/dev/null 2>&1 + fi + fi + + echo + einfo "If you are not using devfs, loading the module automatically at" + einfo "boot up, you need to add \"nvidia\" to your /etc/modules.autoload." + echo + ewarn "Please note that the driver name changed from \"NVdriver\"" + ewarn "to \"nvidia.o\"." + echo +} |