blob: 6b8a631cb7ddf69f81105dafc6a6e19dbd2c2aa8 (
plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
From 4177460e5231895018005ac972ee11ef8c7a561f Mon Sep 17 00:00:00 2001
From: Robert Gordon <robert@greenroomsoftware.com>
Date: Wed, 13 Apr 2011 11:32:29 -0500
Subject: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
scripts/package/builddeb script was setting the host machine
$arch in the KERNEL/debian/control prior to an invocation of
dpkg-gencontrol. The patch modifies the script to guarantee the correct
debian arch for the target is written to the control file instead.
Signed-off-by: Robert Gordon <robert@greenroomsoftware.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
---
scripts/package/builddeb | 70 +++++++++++++++++++++++----------------------
1 files changed, 36 insertions(+), 34 deletions(-)
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 3c6c0b1..2f86d7b 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -26,37 +26,7 @@ create_package() {
chmod -R go-w "$pdir"
# Attempt to find the correct Debian architecture
- local forcearch="" debarch=""
- case "$UTS_MACHINE" in
- i386|ia64|alpha)
- debarch="$UTS_MACHINE" ;;
- x86_64)
- debarch=amd64 ;;
- sparc*)
- debarch=sparc ;;
- s390*)
- debarch=s390 ;;
- ppc*)
- debarch=powerpc ;;
- parisc*)
- debarch=hppa ;;
- mips*)
- debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;;
- arm*)
- debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;;
- *)
- echo "" >&2
- echo "** ** ** WARNING ** ** **" >&2
- echo "" >&2
- echo "Your architecture doesn't have it's equivalent" >&2
- echo "Debian userspace architecture defined!" >&2
- echo "Falling back to using your current userspace instead!" >&2
- echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
- echo "" >&2
- esac
- if [ -n "$KBUILD_DEBARCH" ] ; then
- debarch="$KBUILD_DEBARCH"
- fi
+ local forcearch=""
if [ -n "$debarch" ] ; then
forcearch="-DArchitecture=$debarch"
fi
@@ -66,6 +36,38 @@ create_package() {
dpkg --build "$pdir" ..
}
+#Set the correct debian arch
+case "$UTS_MACHINE" in
+i386|ia64|alpha)
+ debarch="$UTS_MACHINE" ;;
+x86_64)
+ debarch=amd64 ;;
+sparc*)
+ debarch=sparc ;;
+s390*)
+ debarch=s390 ;;
+ppc*)
+ debarch=powerpc ;;
+parisc*)
+ debarch=hppa ;;
+mips*)
+ debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y .config && echo el) ;;
+arm*)
+ debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el) ;;
+*)
+ echo "" >&2
+ echo "** ** ** WARNING ** ** **" >&2
+ echo "" >&2
+ echo "Your architecture doesn't have it's equivalent" >&2
+ echo "Debian userspace architecture defined!" >&2
+ echo "Falling back to using your current userspace instead!" >&2
+ echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
+ echo "" >&2
+esac
+if [ -n "$KBUILD_DEBARCH" ] ; then
+ debarch="$KBUILD_DEBARCH"
+fi
+
# Some variables and settings used throughout the script
version=$KERNELRELEASE
revision=$(cat .version)
@@ -252,9 +254,9 @@ cat <<EOF >> debian/control
Package: $kernel_headers_packagename
Provides: linux-headers, linux-headers-2.6
-Architecture: $arch
-Description: Linux kernel headers for $KERNELRELEASE on $arch
- This package provides kernel header files for $KERNELRELEASE on $arch
+Architecture: $debarch
+Description: Linux kernel headers for $KERNELRELEASE on $debarch
+ This package provides kernel header files for $KERNELRELEASE on $debarch
.
This is useful for people who need to build external modules
EOF
--
1.7.7.4
|