[pkg-nvidia-devel] r543 - in /packages/nvidia-graphics-drivers/trunk: Makefile debian.binary/rules debian/rules patches/xen.patch
rdonald at users.alioth.debian.org
rdonald at users.alioth.debian.org
Sat Apr 11 19:42:01 UTC 2009
Author: rdonald
Date: Sat Apr 11 19:42:00 2009
New Revision: 543
URL: http://svn.debian.org/wsvn/pkg-nvidia/?sc=1&rev=543
Log:
debian 2.6.29 patch
Modified:
packages/nvidia-graphics-drivers/trunk/Makefile
packages/nvidia-graphics-drivers/trunk/debian.binary/rules
packages/nvidia-graphics-drivers/trunk/debian/rules
packages/nvidia-graphics-drivers/trunk/patches/xen.patch
Modified: packages/nvidia-graphics-drivers/trunk/Makefile
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/Makefile?rev=543&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/Makefile (original)
+++ packages/nvidia-graphics-drivers/trunk/Makefile Sat Apr 11 19:42:00 2009
@@ -1,33 +1,179 @@
-#!/usr/bin/make -f
-# Makefile for building prebuilt nvidia kernel modules
+# Makefile -- For the nvidia module
+#
+# By default, the build is done against the running linux kernel source.
+# To build against a different kernel source tree, set LINUXDIR:
+#
+# make LINUXDIR=/path/to/kernel/source
-KVERS = $(KERNELVERSION)
-KSRC = $(CURDIR)
-include $(M)/debian/conf.mk
+SHELL=/bin/sh
+.SUFFIXES:
+ifndef LINUXDIR
+RUNNING_REL := $(shell uname -r)
-all:
+LINUXDIR := $(shell if [ -e /lib/modules/$(RUNNING_REL)/source ]; then \
+ echo /lib/modules/$(RUNNING_REL)/source; \
+ else echo /lib/modules/$(RUNNING_REL)/build; fi)
+endif
+ifndef O
+O := $(shell if [ -e /lib/modules/$(RUNNING_REL)/build ]; then \
+ echo /lib/modules/$(RUNNING_REL)/build; \
+ else echo ""; fi)
+#O := $(LINUXDIR)
+endif
- touch $(M)/$(dirname)/gcc-check
- touch $(M)/$(dirname)/cc-sanity-check
+ifdef ARCH
+MACHINE := $(ARCH)
+else
+MACHINE := $(shell uname -m)
+endif
- ## Main Make ##
- IGNORE_CC_MISMATCH=1 CC="$(CC)" $(MAKE) -C $(M)/$(dirname) -f Makefile SYSSRC=$(KSRC) $(KPKG_EXTRAV_ARG) KBUILD_PARAMS=$(KBUILD_PARAMS) module;
+# Modules for all architectures
+MODULE_LIST := nvidia.o
- touch build-stamp
+CLEANFILES = *.o *.ko .depend .*.flags .*.d .*.cmd *.mod.c .tmp_versions
-modules_install: $(M)/$(dirname)/nvidia.ko
-
+# VERSION is not defined from the initial invocation. It is defined when
+# this Makefile is invoked from the kernel's root Makefile.
+ifndef VERSION
+ifdef RUNNING_REL
-clean:
- $(MAKE) clean SYSSRC=$(KSRC) -C $(M)/$(dirname) -f Makefile $(KPKG_EXTRAV_ARG)
-
- rm -f $(M)/$(dirname)/Makefile || true;
- -rm $(M)/$(dirname)/gcc-check
- -rm $(M)/$(dirname)/cc-sanity-check
-
+# SuSE has the version.h and autoconf.h headers for the current kernel
+# in /boot as /boot/vmlinuz.version.h and /boot/vmlinuz.autoconf.h.
+# Check these first to see if they match the running kernel.
+
+BOOTVERSION_PREFIX = /boot/vmlinuz.
+
+V := $(shell if [ -f $(BOOTVERSION_PREFIX)version.h ]; then \
+ grep UTS_RELEASE $(BOOTVERSION_PREFIX)version.h | \
+ cut -d' ' -f3; fi)
+
+ifeq ($(V),"$(RUNNING_REL)")
+HEADERFROMBOOT := 1
+GETCONFIG := MAKEFILES=$(shell /bin/pwd)/.config
+HAVECONFIG := y
+endif
+
+# On Red Hat we need to check if there is a .config file in the kernel
+# source directory. If there isn't, we need to check if there's a
+# matching file in the configs subdirectory.
+
+ifneq ($(HAVECONFIG),y)
+HAVECONFIG := $(shell if [ -e $(LINUXDIR)/.config ]; then echo y; fi)
+endif
+
+ifneq ($(HAVECONFIG),y)
+REL_BASE := $(shell echo $(RUNNING_REL) | sed 's/-.*//')
+REL_TYPE := $(shell echo $(RUNNING_REL) | sed 's/[0-9.-]//g')
+ifeq ($(REL_TYPE),)
+RHCONFIG := configs/kernel-$(REL_BASE)-$(MACHINE).config
+else
+RHCONFIG := configs/kernel-$(REL_BASE)-$(MACHINE)-$(REL_TYPE).config
+endif
+HAVECONFIG := $(shell if [ -e $(LINUXDIR)/$(RHCONFIG) ]; then echo y; fi)
+ifneq ($(HAVECONFIG),y)
+RHCONFIG :=
+endif
+endif
+
+ifneq ($(HAVECONFIG),y)
+ifneq ($(0),$(LINUXDIR))
+GETCONFIG += O=$(O)
+endif
+HAVECONFIG := $(shell if [ -e $(O)/.config ]; then echo y; fi)
+endif
+
+ifneq ($(HAVECONFIG),y)
+$(error Cannot find a kernel config file)
+endif
+
+endif
+
+CLEANCONFIG := $(shell if cmp -s $(LINUXDIR)/.config .config; then echo y; fi)
+ifeq ($(CLEANCONFIG),y)
+CLEANFILES += $(LINUXDIR)/.config .config $(LINUXDIR)/tmp_include_depends
+endif
+
+all: modules
+
+modules: includes
+ +make -C $(LINUXDIR) $(GETCONFIG) M=`/bin/pwd` modules
+
+ifeq ($(HEADERFROMBOOT),1)
+
+BOOTHEADERS = version.h autoconf.h
+BOOTCONFIG = .config
+
+CLEANFILES += $(BOOTHEADERS) $(BOOTCONFIG)
+
+includes:: $(BOOTHEADERS) $(BOOTCONFIG)
+
+version.h: $(BOOTVERSION_PREFIX)version.h
+ rm -f $@
+ ln -s $< $@
+
+autoconf.h: $(BOOTVERSION_PREFIX)autoconf.h
+ rm -f $@
+ ln -s $< $@
+
+.config: $(BOOTVERSION_PREFIX)config
+ rm -f $@
+ ln -s $< $@
+endif
+
+# This prepares an unused Red Hat kernel tree for the build.
+ifneq ($(RHCONFIG),)
+includes:: $(LINUXDIR)/.config $(LINUXDIR)/tmp_include_depends .config
+
+$(LINUXDIR)/.config: $(LINUXDIR)/$(RHCONFIG)
+ rm -f $@
+ ln -s $< $@
+
+.config: $(LINUXDIR)/$(RHCONFIG)
+ rm -f $@
+ ln -s $< $@
+
+$(LINUXDIR)/tmp_include_depends:
+ echo all: > $@
+endif
+
+clean cleandir:
+ rm -rf $(CLEANFILES)
+
+$(MODULE_LIST)::
+ make modules
+
+install:
+ make -C $(LINUXDIR) $(GETCONFIG) M=`/bin/pwd` modules_install
+
+else
+
+# Check for kernel versions that we don't support.
+
+BELOW26 := $(shell if [ $(VERSION) -lt 2 -o $(PATCHLEVEL) -lt 6 ]; then \
+ echo y; fi)
+
+ifeq ($(BELOW26),y)
+$(error Only 2.6.x and later kernels are supported \
+ ($(VERSION).$(PATCHLEVEL).$(SUBLEVEL)))
+endif
+
+# This needs to go before all other include paths.
+CC += -I$(M)
+
+ifeq ($(CONFIG_X86_64),y)
+NVARCH = .x86_64
+else
+NVARCH = .i386
+endif
+
+include $(M)/Makefile.kbuild
+
+endif
+
+.PHONY: includes
Modified: packages/nvidia-graphics-drivers/trunk/debian.binary/rules
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian.binary/rules?rev=543&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian.binary/rules (original)
+++ packages/nvidia-graphics-drivers/trunk/debian.binary/rules Sat Apr 11 19:42:00 2009
@@ -1,116 +1,59 @@
#!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# This is the debhelper compatability version to use.
-export DH_COMPAT=4
-
-ifeq ($(shell id -u),0)
- ROOT_CMD=
-endif
-
-include $(CURDIR)/debian/conf.mk
+CFLAGS = -Wall -g
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j$(NUMJOBS)
+endif
-.PHONY: build build-stamp
-build: configure-stamp build-stamp
-build-stamp:
-
- dh_testdir
- dh_testroot
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
- @echo "PATCHLEVEL = $(PATCHLEVEL) " ;
- @echo "Kernel compiler version : $(kernel_cc)" ;
- @echo "Detected compiler version : $(module_cc)" ;
-
+# Prefix of the target package name
+PACKAGE = nvidia-kernel
- @if [ "$(kernel_cc)" != "$(module_cc)" ]; then \
- echo " "; \
- echo "You appear to be compiling the NVIDIA kernel module with "; \
- echo "a compiler different from the one that was used to compile "; \
- echo "the running kernel. This may be perfectly alright and you "; \
- echo "may be building this module for another kernel in which case"; \
- echo "you may ignore this message."; \
- echo " " ; \
- echo "The compiler that will be used to compile this module has been"; \
- echo "determined from:" ; \
- echo " 1) the CC environment variable " ; \
- echo " 2) that specified in "; \
- echo " $(KSRC)/include/linux/compile.h" ; \
- echo " 3) gcc " ; \
- fi
- @echo "Using compiler $(CC) version $(module_cc)";
+-include /usr/share/modass/include/generic.make
+-include /usr/share/modass/include/common-rules.make
-
-
- touch $(CURDIR)/$(dirname)/gcc-check
- touch $(CURDIR)/$(dirname)/cc-sanity-check
-
- ## Main Make ##
- IGNORE_CC_MISMATCH=1 CC="$(CC)" $(MAKE) -C $(CURDIR)/$(dirname) -f Makefile SYSSRC=$(KSRC) $(KPKG_EXTRAV_ARG) KBUILD_PARAMS=$(KBUILD_PARAMS) module;
-
- touch build-stamp
-
-
-.PHONY: install
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
-
+configure:
sed 's/#KVERS#/$(KVERS)/g' debian/control.template > $(CURDIR)/debian/control
sed 's/#KVERS#/$(KVERS)/g' debian/dirs.template > $(CURDIR)/debian/dirs
sed 's/#KVERS#/$(KVERS)/g' debian/override.template > $(CURDIR)/debian/override
+binary-modules: configure
+ dh_testroot
+
+ dh_prep
+
+ # Build the modules
+ $(MAKE) -C . LINUXDIR=$(KSRC) KVERREL=$(KVERS)
+
+ # Install the modules
dh_installdirs
+ install -m 0644 $(CURDIR)/debian/override $(CURDIR)/debian/nvidia-kernel-$(KVERS)/usr/share/lintian/overrides/nvidia-kernel-$(KVERS)
+ install -m 0644 $(CURDIR)/nvidia.ko $(CURDIR)/debian/nvidia-kernel-$(KVERS)/lib/modules/$(KVERS)/nvidia/nvidia.ko ; \
-
- install -m 0644 $(CURDIR)/debian/override $(CURDIR)/debian/nvidia-kernel-$(KVERS)/usr/share/lintian/overrides/nvidia-kernel-$(KVERS)
- if [ "$(PATCHLEVEL)" = "6" ] ; then \
- install -m 0644 $(CURDIR)/$(dirname)/nvidia.ko $(CURDIR)/debian/nvidia-kernel-$(KVERS)/lib/modules/$(KVERS)/nvidia/nvidia.ko ; \
- else \
- install -m 0644 $(CURDIR)/$(dirname)/nvidia.o $(CURDIR)/debian/nvidia-kernel-$(KVERS)/lib/modules/$(KVERS)/nvidia/nvidia.o ;\
- fi
-
-
-
-
-
-.PHONY: binary_modules
-binary_modules: build install
- dh_testdir
- dh_testroot
-# dh_installdebconf
dh_installdocs
-# dh_installexamples
-# dh_installmanpages
-# dh_undocumented
dh_installmodules
-
- dh_installinit
-
- dh_installchangelogs
- dh_link
+ dh_installchangelogs
+ dh_installmodules
dh_strip
dh_compress
dh_fixperms
-# You may want to make some executables suid here.
-# dh_suidregister
-# dh_makeshlibs
dh_installdeb
-# dh_shlibdeps
- dh_gencontrol -- -v$(PKG_VERSION)
+ dh_gencontrol -- -v$(VERSION)
dh_md5sums
dh_builddeb --destdir=$(KPKG_DEST_DIR)
+ dh_prep
-
-.PHONY: clean
-clean: clean.Makefile unpatch
+clean: unpatch
if [ -f $(CURDIR)/debian/control.template ]; then \
cp $(CURDIR)/debian/control.template $(CURDIR)/debian/control; \
fi
@@ -121,7 +64,6 @@
$(MAKE) clean SYSSRC=$(KSRC) -C $(CURDIR)/$(dirname) -f Makefile $(KPKG_EXTRAV_ARG)
- rm -f $(CURDIR)/$(dirname)/Makefile || true;
-rm $(CURDIR)/$(dirname)/gcc-check
-rm $(CURDIR)/$(dirname)/cc-sanity-check
@@ -144,38 +86,14 @@
# The kdist_configure target is called by make-kpkg modules_config. It
# should configure the module so it is ready for compilation (mostly
# useful for calling configure)
-.PHONY: kdist_config
-kdist_config:
- $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules configure
-
-.PHONY: kdist_configure
-kdist_configure:
- $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules configure
-
-# the kdist_image target is called by make-kpkg modules_image. It is
-# responsible for compiling the module and creating the package. It
-# should also clean up after making the module. Please note we use a
-# seperate binary-modules target to make testing the package building
-# easier
-.PHONY: kdist_image
-kdist_image:
- echo "ROOT_CMD = $(ROOT_CMD)"
- $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary_modules
- $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean
-
-
+kdist_config kdist_configure:
+ $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules configure
# the kdist_clean target is called by make-kpkg modules_clean. It is
# responsible for cleaning up any changes that have been made by the
# other kdist_commands (except for the .deb files created).
-.PHONY: kdist_clean
kdist_clean:
- $(MAKE) $(MFLAGS) -f debian/rules clean
+ $(MAKE) -C . LINUXDIR=$(KSRC) KVERREL=$(KVERS) clean
+ dh_clean
-kdist:
- $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary_modules
- # Build a .changes file.
- dpkg-genchanges -b -e"$(KMAINT) <$(KEMAIL)>" -u"$(KPKG_DEST_DIR)" > $(CHFILE)
- debsign -e"$(KMAINT) <$(KEMAIL)>" $(CHFILE)
- $(MAKE) $(MFLAGS) -f debian/rules clean
-
+.PHONY: clean binary-modules
Modified: packages/nvidia-graphics-drivers/trunk/debian/rules
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/rules?rev=543&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/rules (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/rules Sat Apr 11 19:42:00 2009
@@ -92,8 +92,8 @@
# build kernel module source tarball
mkdir -p $(CURDIR)/debian/temp/modules/nvidia-kernel/debian
+ # Prepare debian files for module package
cp -a $(CURDIR)/debian.binary/* $(CURDIR)/debian/temp/modules/nvidia-kernel/debian
-
for f in `ls $(CURDIR)/debian.binary` ; do \
perl -p \
-e 's{#BASE_VERSION#}{$(base_version)}g;' \
@@ -104,11 +104,24 @@
< $(CURDIR)/debian.binary/$$f > $(CURDIR)/debian/temp/modules/nvidia-kernel/debian/$$f ; \
chmod 0644 $(CURDIR)/debian/temp/modules/nvidia-kernel/debian/$$f ; \
done
+
# chmod 775 $(CURDIR)/debian/temp/modules/nvidia-kernel/debian/patches
- cp $(CURDIR)/$(dirname)/usr/src/nv/* $(CURDIR)/debian/temp/modules/nvidia-kernel/ || true
-#not yet cp $(CURDIR)/Makefile $(CURDIR)/debian/temp/modules/nvidia-kernel/ || true
- cp $(CURDIR)/$(dirname_x86_64)/usr/src/nv/nv-kernel.o $(CURDIR)/debian/temp/modules/nvidia-kernel/nv-kernel.o.x86_64 || true
- cp $(CURDIR)/debian/temp/modules/nvidia-kernel/Makefile.kbuild $(CURDIR)/debian/temp/modules/nvidia-kernel/Makefile
+ cp $(CURDIR)/$(dirname)/usr/src/nv/* $(CURDIR)/debian/temp/modules/nvidia-kernel/
+
+ # We don't want these makefiles that don't work with kbuild
+ rm $(CURDIR)/debian/temp/modules/nvidia-kernel/makefile
+
+ # We want both 32 and 64 bit versions of nv-kernel.o
+ cp $(CURDIR)/$(dirname_x86_64)/usr/src/nv/nv-kernel.o $(CURDIR)/debian/temp/modules/nvidia-kernel/nv-kernel.o.x86_64
+ mv $(CURDIR)/debian/temp/modules/nvidia-kernel/nv-kernel.o $(CURDIR)/debian/temp/modules/nvidia-kernel/nv-kernel.o.i386
+
+ # and then make Makefile.kbuild actually use our names
+ sed -i -e 's/nv-kernel.o$$/nv-kernel.o$$(NVARCH)/' $(CURDIR)/debian/temp/modules/nvidia-kernel/Makefile.kbuild
+
+ # We have new conftest files that work purely with kbuild and doesn't require root
+ cp $(CURDIR)/Makefile $(CURDIR)/conftest.* $(CURDIR)/debian/temp/modules/nvidia-kernel/
+
+ # Fix permissions
chmod 755 $(CURDIR)/debian/temp/modules/nvidia-kernel/debian/rules
chown -R root:src $(CURDIR)/debian/temp/modules
Modified: packages/nvidia-graphics-drivers/trunk/patches/xen.patch
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/patches/xen.patch?rev=543&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/patches/xen.patch (original)
+++ packages/nvidia-graphics-drivers/trunk/patches/xen.patch Sat Apr 11 19:42:00 2009
@@ -1,90 +1,3 @@
-diff -ruN usr/src/nv/conftest.sh usr/src/nv/conftest.sh
---- usr/src/nv/conftest.sh 2008-05-30 10:06:36.000000000 -0400
-+++ usr/src/nv/conftest.sh 2008-05-30 10:32:30.000000000 -0400
-@@ -20,38 +20,7 @@
- SOURCES=$3
- HEADERS=$SOURCES/include
- OUTPUT=$4
--XEN_PRESENT=1
--
--test_xen() {
-- FILE="linux/autoconf.h"
--
-- if [ -f $HEADERS/$FILE -o -f $OUTPUT/include/$FILE ]; then
-- #
-- # We are looking at a configured source tree; verify
-- # that it's not a Xen kernel.
-- #
-- echo "#include <linux/autoconf.h>
-- #ifdef CONFIG_XEN
-- #error CONFIG_XEN defined!
-- #endif
-- " > conftest$$.c
--
-- $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
-- rm -f conftest$$.c
--
-- if [ -f conftest$$.o ]; then
-- rm -f conftest$$.o
-- XEN_PRESENT=0
-- fi
-- else
-- CONFIG=$HEADERS/../.config
-- if [ -f $CONFIG ]; then
-- if [ -z "$(grep "^CONFIG_XEN=y" $CONFIG)" ]; then
-- XEN_PRESENT="0"
-- fi
-- fi
-- fi
--}
-+XEN_PRESENT=0
-
- build_cflags() {
- BASE_CFLAGS="-D__KERNEL__ \
-@@ -64,8 +33,6 @@
-
- CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS"
-
-- test_xen
--
- if [ "$OUTPUT" != "$SOURCES" ]; then
- ARCH=`uname -m | sed -e 's/i.86/i386/'`
- MACH_CFLAGS="-I$HEADERS/asm-$ARCH/mach-default"
-@@ -1244,33 +1211,7 @@
- ;;
-
- xen_sanity_check)
-- #
-- # Check if the target kernel is a Xen kernel. If so, then exit, since
-- # the driver doesn't currently work with Xen.
-- #
-- VERBOSE=$6
--
-- if [ -n "$IGNORE_XEN_PRESENCE" ]; then
-- exit 0
-- fi
--
-- if [ "$XEN_PRESENT" != "0" ]; then
-- echo "The kernel you are installing for is a Xen kernel!";
-- echo "";
-- echo "The NVIDIA driver does not currently work on Xen kernels. If ";
-- echo "you are using a stock distribution kernel, please install ";
-- echo "a variant of this kernel without Xen support; if this is a ";
-- echo "custom kernel, please install a standard Linux kernel. Then ";
-- echo "try installing the NVIDIA kernel module again.";
-- echo "";
-- if [ "$VERBOSE" = "full_output" ]; then
-- echo "*** Failed Xen sanity check. Bailing out! ***";
-- echo "";
-- fi
-- exit 1
-- else
-- exit 0
-- fi
-+ exit 0
- ;;
-
- compile_tests)
diff -ruN usr/src/nv/nv.c usr/src/nv/nv.c
--- usr/src/nv/nv.c 2008-05-30 10:06:36.000000000 -0400
+++ usr/src/nv/nv.c 2008-05-30 10:28:33.000000000 -0400
More information about the Pkg-nvidia-devel
mailing list