summary refs log tree commit diff
path: root/pkgs/os-specific/linux/nvidia-x11/patchlevel.patch
blob: 256922ca966da2e8587a597f117c9d3dbcd32b7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff -pur 96.43.20-t1/conftest.sh 96.43.20-t2/conftest.sh
--- 96.43.20-t1/conftest.sh	2012-06-16 17:14:47.206589267 +0400
+++ 96.43.20-t2/conftest.sh	2012-06-16 15:35:45.049203248 +0400
@@ -1303,10 +1303,14 @@ case "$5" in
         MAKEFILE=$HEADERS/../Makefile
 
         if [ -f $MAKEFILE ]; then
+            VERSION=$(grep "^VERSION =" $MAKEFILE | cut -d " " -f 3)
             PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
 
-            if [ -z "$PATCHLEVEL" ]; then
+            if [ -z "$PATCHLEVEL" -o -z "$VERSION" ]; then
                 exit 1
+            elif [ "$VERSION" = '3' ]; then
+                echo 6
+                exit 0                
             else
                 echo $PATCHLEVEL
                 exit 0
@@ -1426,10 +1430,11 @@ case "$5" in
                 # kernel older than 2.6.6, that's all we require to
                 # build the module.
                 #
+                VERSION=$(grep "^VERSION =" $MAKEFILE | cut -d " " -f 3)
                 PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
                 SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3)
 
-                if [ -n "$PATCHLEVEL" -a $PATCHLEVEL -ge 6 \
+                if [ "$VERSION" = '2' -a -n "$PATCHLEVEL" -a $PATCHLEVEL -ge 6 \
                         -a -n "$SUBLEVEL" -a $SUBLEVEL -le 5 ]; then
                     SELECTED_MAKEFILE=Makefile.kbuild
                     RET=0
@@ -1525,11 +1530,12 @@ case "$5" in
                 # This source tree is not configured, but includes
                 # the top-level Makefile.
                 #
+                VERSION=$(grep "^VERSION =" $MAKEFILE | cut -d " " -f 3)
                 PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
                 SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3)
 
-                if [ -n "$PATCHLEVEL" -a -n "$SUBLEVEL" ]; then
-                    echo 2.$PATCHLEVEL.$SUBLEVEL
+                if [ -n "$VERSION" -a -n "$PATCHLEVEL" -a -n "$SUBLEVEL" ]; then
+                    echo $VERSION.$PATCHLEVEL.$SUBLEVEL
                     RET=0
                 fi
             fi
diff -pur 96.43.20-t1/Makefile.kbuild 96.43.20-t2/Makefile.kbuild
--- 96.43.20-t1/Makefile.kbuild	2011-07-18 10:51:11.000000000 +0400
+++ 96.43.20-t2/Makefile.kbuild	2012-06-16 17:08:11.694605133 +0400
@@ -132,7 +132,7 @@ MODULE_ROOT := /lib/modules/$(KERNEL_UNA
 #
 
 TOPDIR ?= $(KERNEL_SOURCES)
-PATCHLEVEL ?= $(shell $(CONFTEST) kernel_patch_level)
+PATCHLEVEL := $(shell $(CONFTEST) kernel_patch_level)
 
 #
 # Linux 2.4 uses the .o module extension. Linux 2.6, however, uses the .ko