All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
@ 2011-04-15 18:23 Robert Gordon
  2011-04-17 22:29 ` maximilian attems
  0 siblings, 1 reply; 16+ messages in thread
From: Robert Gordon @ 2011-04-15 18:23 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Robert Nelson, maximilian attems, Robert Gordon

This patch was prepared using git format-patch and git send-email.  Details follow.
Regards,
Robert Gordon

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.  The issue originally arose in the 2.6.38 series.

 Signed-off-by: Robert Gordon <robert@greenroomsoftware.com>

---
 scripts/package/builddeb |   73 +++++++++++++++++++++++----------------------
 1 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index f6cbc3d..975e39a 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -25,38 +25,7 @@ create_package() {
 	chown -R root:root "$pdir"
 	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 +35,39 @@ create_package() {
 	dpkg --build "$pdir" ..
 }
 
+# Attempt to find the correct Debian architecture
+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)
@@ -246,15 +248,14 @@ mkdir -p "$destdir"
 (cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -)
 (cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)
 rm -f /tmp/files$$ /tmp/objfiles$$
-arch=$(dpkg --print-architecture)
 
 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.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-15 18:23 [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol Robert Gordon
@ 2011-04-17 22:29 ` maximilian attems
  2011-04-17 22:34   ` Robert Nelson
  2011-04-18 16:06   ` maximilian attems
  0 siblings, 2 replies; 16+ messages in thread
From: maximilian attems @ 2011-04-17 22:29 UTC (permalink / raw)
  To: Robert Gordon; +Cc: linux-kbuild, Robert Nelson

On Fri, 15 Apr 2011, Robert Gordon wrote:

> This patch was prepared using git format-patch and git send-email.  Details follow.
> Regards,
> Robert Gordon

thanks so the patch was now applyable and so testable. (:
 
> 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.  The issue originally arose in the 2.6.38 series.

hmm don't be shy to use line-breaks in the desc for next times..
 
>  Signed-off-by: Robert Gordon <robert@greenroomsoftware.com>

rudimentary testing showed, that `make deb-pkg` works,
but `make ARCH=i386 deb-pkg` on an amd64 Debian box seems borked:
+ dpkg-gencontrol -isp -DArchitecture=i386 -plinux-headers-2.6.39-rc3+
-P/media/data/mattems/src/linux-2.6/debian/hdrtmp
dpkg-gencontrol: error: current host architecture 'amd64' does not appear in package's architecture list (i386)

had no time to investigate yet, hope you will do.

greetings

-- 
maks

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-17 22:29 ` maximilian attems
@ 2011-04-17 22:34   ` Robert Nelson
  2011-04-18 11:13     ` Michal Marek
  2011-04-18 16:06   ` maximilian attems
  1 sibling, 1 reply; 16+ messages in thread
From: Robert Nelson @ 2011-04-17 22:34 UTC (permalink / raw)
  To: maximilian attems; +Cc: Robert Gordon, linux-kbuild

On Sun, Apr 17, 2011 at 5:29 PM, maximilian attems <max@stro.at> wrote:
> On Fri, 15 Apr 2011, Robert Gordon wrote:
>
>> This patch was prepared using git format-patch and git send-email.  Details follow.
>> Regards,
>> Robert Gordon
>
> thanks so the patch was now applyable and so testable. (:
>
>> 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.  The issue originally arose in the 2.6.38 series.
>
> hmm don't be shy to use line-breaks in the desc for next times..
>
>>  Signed-off-by: Robert Gordon <robert@greenroomsoftware.com>
>
> rudimentary testing showed, that `make deb-pkg` works,
> but `make ARCH=i386 deb-pkg` on an amd64 Debian box seems borked:
> + dpkg-gencontrol -isp -DArchitecture=i386 -plinux-headers-2.6.39-rc3+
> -P/media/data/mattems/src/linux-2.6/debian/hdrtmp
> dpkg-gencontrol: error: current host architecture 'amd64' does not appear in package's architecture list (i386)

Weird, as without the patch we get the same error just with (i386)
swapped for (armel)..

make ARCH=armel deb-pkg (on amd64)

Note, with cross building we always have CROSS_COMPILE=something too..

Regards,

-- 
Robert Nelson
http://www.rcn-ee.com/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-17 22:34   ` Robert Nelson
@ 2011-04-18 11:13     ` Michal Marek
  0 siblings, 0 replies; 16+ messages in thread
From: Michal Marek @ 2011-04-18 11:13 UTC (permalink / raw)
  To: Robert Nelson; +Cc: maximilian attems, Robert Gordon, linux-kbuild

On 18.4.2011 00:34, Robert Nelson wrote:
> On Sun, Apr 17, 2011 at 5:29 PM, maximilian attems<max@stro.at>  wrote:
>> On Fri, 15 Apr 2011, Robert Gordon wrote:
>>
>>> This patch was prepared using git format-patch and git send-email.  Details follow.
>>> Regards,
>>> Robert Gordon
>>
>> thanks so the patch was now applyable and so testable. (:
>>
>>> 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.  The issue originally arose in the 2.6.38 series.
>>
>> hmm don't be shy to use line-breaks in the desc for next times..
>>
>>>   Signed-off-by: Robert Gordon<robert@greenroomsoftware.com>
>>
>> rudimentary testing showed, that `make deb-pkg` works,
>> but `make ARCH=i386 deb-pkg` on an amd64 Debian box seems borked:
>> + dpkg-gencontrol -isp -DArchitecture=i386 -plinux-headers-2.6.39-rc3+
>> -P/media/data/mattems/src/linux-2.6/debian/hdrtmp
>> dpkg-gencontrol: error: current host architecture 'amd64' does not appear in package's architecture list (i386)
>
> Weird, as without the patch we get the same error just with (i386)
> swapped for (armel)..
>
> make ARCH=armel deb-pkg (on amd64)
>
> Note, with cross building we always have CROSS_COMPILE=something too..

x86_64 and i386 are just two flavors of x86 in the kernel build and two 
switches in gcc, so unlike genuine cross builds, you don't need 
CROSS_COMPILE=something to build for one if you are running another. I 
didn't follow the thread closely (relying on Maximilian to review 
anything deb-pkg related), I just wanted to point out a potential 
difference that might confuse you when comparing builds for arm and for 
i386.

Michal

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-17 22:29 ` maximilian attems
  2011-04-17 22:34   ` Robert Nelson
@ 2011-04-18 16:06   ` maximilian attems
  2011-04-18 19:28     ` robert
  1 sibling, 1 reply; 16+ messages in thread
From: maximilian attems @ 2011-04-18 16:06 UTC (permalink / raw)
  To: Robert Gordon; +Cc: linux-kbuild, Robert Nelson

On Mon, Apr 18, 2011 at 12:29:45AM +0200, maximilian attems wrote:
> On Fri, 15 Apr 2011, Robert Gordon wrote:
> 
> > This patch was prepared using git format-patch and git send-email.  Details follow.
> > Regards,
> > Robert Gordon
> 
> thanks so the patch was now applyable and so testable. (:
>  
> > 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.  The issue originally arose in the 2.6.38 series.
> 
> hmm don't be shy to use line-breaks in the desc for next times..
>  
> >  Signed-off-by: Robert Gordon <robert@greenroomsoftware.com>
> 
> rudimentary testing showed, that `make deb-pkg` works,
> but `make ARCH=i386 deb-pkg` on an amd64 Debian box seems borked:
> + dpkg-gencontrol -isp -DArchitecture=i386 -plinux-headers-2.6.39-rc3+
> -P/media/data/mattems/src/linux-2.6/debian/hdrtmp
> dpkg-gencontrol: error: current host architecture 'amd64' does not appear in package's architecture list (i386)

at a second look your patch is just wrong the arch overriding is
currently correctly done in create_package(), with the debian/control
file having the host arch written to it.

so please post what exactly you were trying to build in the first place?

-- 
maks

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-18 16:06   ` maximilian attems
@ 2011-04-18 19:28     ` robert
  2011-04-19 14:33       ` maximilian attems
  0 siblings, 1 reply; 16+ messages in thread
From: robert @ 2011-04-18 19:28 UTC (permalink / raw)
  To: maximilian attems; +Cc: linux-kbuild, Robert Nelson

 On Mon, 18 Apr 2011 16:06:26 +0000, maximilian attems <max@stro.at> 
 wrote:
> On Mon, Apr 18, 2011 at 12:29:45AM +0200, maximilian attems wrote:
>> On Fri, 15 Apr 2011, Robert Gordon wrote:
>>
>> > This patch was prepared using git format-patch and git send-email. 
>> Details follow.
>> > Regards,
>> > Robert Gordon
>>
>> thanks so the patch was now applyable and so testable. (:
>>
>> > 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.  The issue originally arose in the 2.6.38 series.
>>
>> hmm don't be shy to use line-breaks in the desc for next times..
>>
>> >  Signed-off-by: Robert Gordon <robert@greenroomsoftware.com>
>>
>> rudimentary testing showed, that `make deb-pkg` works,
>> but `make ARCH=i386 deb-pkg` on an amd64 Debian box seems borked:
>> + dpkg-gencontrol -isp -DArchitecture=i386 
>> -plinux-headers-2.6.39-rc3+
>> -P/media/data/mattems/src/linux-2.6/debian/hdrtmp
>> dpkg-gencontrol: error: current host architecture 'amd64' does not 
>> appear in package's architecture list (i386)
>
> at a second look your patch is just wrong the arch overriding is
> currently correctly done in create_package(), with the debian/control
> file having the host arch written to it.
>
> so please post what exactly you were trying to build in the first 
> place?


 When cross compiling for an arm on an i386 machine, dpkg-gencontrol 
 fails.  I am currently on the road and my internet connection is not 
 allowing me to pull Linus's kernel onto my laptop.  If you will permit, 
 I'll use the latest kernel from Ubunutu for the (ARM) Beagleboard 
 (2.6.38), since I have it with me already.  I worked with the latest 
 kernel at home this past weekend and the /scripts/packages/buildeb file 
 was the same in both versions (i.e. I can apply the patch to the 2.6.38 
 or 2.6.39 versions).

 Here is the original 'make' command:
 make ARCH=arm LOCALVERSION=-x1 CROSS_COMPILE=arm-linux-gnueabi- 
 KDEB_PKGVERSION=1.0cross deb-pkg

 Here is how it fails:
 dpkg-gencontrol: error: current host architecture 'armel' does not 
 appear in package's architecture list (i386)
 make[1]: *** [deb-pkg] Error 255
 make: *** [deb-pkg] Error 2

 Immediately after the failure, the debian/control file contains the 
 following section:
 Package: linux-headers-2.6.38.2-x1
 Provides: linux-headers, linux-headers-2.6
 Architecture: i386
 Description: Linux kernel headers for 2.6.38.2-x1 on i386
  This package provides kernel header files for 2.6.38.2-x1 on i386

 Since I am cross-compiling for an ARM machine, I don't think I want 
 kernel headers for i386.  After my patch is applied, the relevant fields 
 say 'armel' and the deb-pkg process executes to successful completion.

 I will pull Linus's kernel at my first opportunity, but I hope this 
 answer helps.

 Regards,
 Robert Gordon

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-18 19:28     ` robert
@ 2011-04-19 14:33       ` maximilian attems
  2011-04-20 17:35         ` Robert Gordon
  0 siblings, 1 reply; 16+ messages in thread
From: maximilian attems @ 2011-04-19 14:33 UTC (permalink / raw)
  To: robert; +Cc: linux-kbuild, Robert Nelson

On Mon, Apr 18, 2011 at 03:28:28PM -0400, robert@greenroomsoftware.com wrote:
> Here is the original 'make' command:
> make ARCH=arm LOCALVERSION=-x1 CROSS_COMPILE=arm-linux-gnueabi-
> KDEB_PKGVERSION=1.0cross deb-pkg
> 
> Here is how it fails:
> dpkg-gencontrol: error: current host architecture 'armel' does not
> appear in package's architecture list (i386)
> make[1]: *** [deb-pkg] Error 255
> make: *** [deb-pkg] Error 2
> 

did you check how it dpkg-gencontrol is called?
just put an set -x on the top of builddeb.

-- 
maks

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-19 14:33       ` maximilian attems
@ 2011-04-20 17:35         ` Robert Gordon
  2011-04-22 20:24           ` Robert Gordon
  0 siblings, 1 reply; 16+ messages in thread
From: Robert Gordon @ 2011-04-20 17:35 UTC (permalink / raw)
  To: maximilian attems; +Cc: linux-kbuild, Robert Nelson

On 04/19/2011 07:33 AM, maximilian attems wrote:
> On Mon, Apr 18, 2011 at 03:28:28PM -0400, robert@greenroomsoftware.com wrote:
>> Here is the original 'make' command:
>> make ARCH=arm LOCALVERSION=-x1 CROSS_COMPILE=arm-linux-gnueabi-
>> KDEB_PKGVERSION=1.0cross deb-pkg
>>
>> Here is how it fails:
>> dpkg-gencontrol: error: current host architecture 'armel' does not
>> appear in package's architecture list (i386)
>> make[1]: *** [deb-pkg] Error 255
>> make: *** [deb-pkg] Error 2
>>
> did you check how it dpkg-gencontrol is called?
> just put an set -x on the top of builddeb.
>
Here is the output:
dpkg-gencontrol -isp -DArchitecture=armel -plinux-headers-2.6.38.2-x1
-P/opt/kernel_new/2.6-stable/KERNEL/debian/hdrtmp
dpkg-gencontrol: error: current host architecture 'armel' does not
appear in package's architecture list (i386)
make[1]: *** [deb-pkg] Error 255
make: *** [deb-pkg] Error 2
[2]+  Done                    gedit KERNEL/scripts/package/builddeb


The information in the debian/control file remains the same, i.e. it
seems to contain instructions to build headers for an i386.

Regards,
Robert

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-20 17:35         ` Robert Gordon
@ 2011-04-22 20:24           ` Robert Gordon
  0 siblings, 0 replies; 16+ messages in thread
From: Robert Gordon @ 2011-04-22 20:24 UTC (permalink / raw)
  To: maximilian attems; +Cc: linux-kbuild, Robert Nelson

On 04/20/2011 10:35 AM, Robert Gordon wrote:
> On 04/19/2011 07:33 AM, maximilian attems wrote:
>> On Mon, Apr 18, 2011 at 03:28:28PM -0400, robert@greenroomsoftware.com wrote:
>>> Here is the original 'make' command:
>>> make ARCH=arm LOCALVERSION=-x1 CROSS_COMPILE=arm-linux-gnueabi-
>>> KDEB_PKGVERSION=1.0cross deb-pkg
>>>
>>> Here is how it fails:
>>> dpkg-gencontrol: error: current host architecture 'armel' does not
>>> appear in package's architecture list (i386)
>>> make[1]: *** [deb-pkg] Error 255
>>> make: *** [deb-pkg] Error 2
>>>
>> did you check how it dpkg-gencontrol is called?
>> just put an set -x on the top of builddeb.
>>
> Here is the output:
> dpkg-gencontrol -isp -DArchitecture=armel -plinux-headers-2.6.38.2-x1
> -P/opt/kernel_new/2.6-stable/KERNEL/debian/hdrtmp
> dpkg-gencontrol: error: current host architecture 'armel' does not
> appear in package's architecture list (i386)
> make[1]: *** [deb-pkg] Error 255
> make: *** [deb-pkg] Error 2
> [2]+  Done                    gedit KERNEL/scripts/package/builddeb
>
>
> The information in the debian/control file remains the same, i.e. it
> seems to contain instructions to build headers for an i386.
>
> Regards,
> Robert


I have used the 2.6.39-rc4+ kernel to sort out the difficulties with
building .deb packages for a non-x86 architecture.  I repeated the same
steps four times:
fakeroot make ARCH=[x86_64,arm] [CROSS_COMPILE=] deb-pkg
cat debian/control

The four steps proceeded in this order:
1) ARCH=x86_64, the patch I submitted was not applied - succeeded
2) ARCH=x86_64, the patch I submitted was applied - failed
3) ARCH=arm, the patched I submitted was applied - succeeded
4) ARH=arm, the patched I submitted was removed - failed

The problem appears to be in lines 43 & 44 of the latest patch I sent:
x86_64)
    debarch=amd64 ;;

The debian arch for x86_64 is being set to amd64, which is getting
written into the debian/control file prior to invocation of
dpkg-gencontrol.  If my patch is not applied, i386 gets written into the
debian/control file instead, and the x86_64 cross compile succeeds. 
However, when my patch is not applied i386 is written into the
debian/control file when cross compiling for arm, which leads to the
script failing.  When my patch is applied, arm is written into the
debian/control file, when cross compiling for arm, and this succeeds.

I will attempt to modify the debarch for x86_64 to remain x86_64 and see
if that works.  If so, I'll submit a new patch.  The notes from what I
have described so far are included below.

Regards,
Robert Gordon



**********Using original /scripts/package/builddeb - succeeded ************
fakeroot make ARCH=x86_64 deb-pkg

+ dpkg-gencontrol -isp -DArchitecture=amd64 -plinux-headers-2.6.39-rc4+
-P/opt/kernel-linus/linux-2.6/debian/hdrtmp
+ dpkg-gencontrol -isp -DArchitecture=amd64 -plinux-firmware-image
-P/opt/kernel-linus/linux-2.6/debian/fwtmp
+ dpkg-gencontrol -isp -DArchitecture=amd64 -plinux-libc-dev
-P/opt/kernel-linus/linux-2.6/debian/headertmp
+ dpkg-gencontrol -isp -DArchitecture=amd64 -plinux-image-2.6.39-rc4+
-P/opt/kernel-linus/linux-2.6/debian/tmp

cat debian/control
Source: linux-upstream
Section: kernel
Priority: optional
Maintainer: Anonymous <root@robert-VGN-Z690Y>
Standards-Version: 3.8.4
Homepage: http://www.kernel.org/

Package: linux-image-2.6.39-rc4+
Provides: linux-image, linux-image-2.6, linux-modules-2.6.39-rc4+
Suggests: linux-firmware-image
Architecture: any
Description: Linux kernel, version 2.6.39-rc4+
 This package contains the Linux kernel, modules and corresponding other
 files, version: 2.6.39-rc4+.

Package: linux-headers-2.6.39-rc4+
Provides: linux-headers, linux-headers-2.6
Architecture: i386
Description: Linux kernel headers for 2.6.39-rc4+ on i386
 This package provides kernel header files for 2.6.39-rc4+ on i386
 .
 This is useful for people who need to build external modules

Package: linux-firmware-image
Architecture: all
Description: Linux kernel firmware, version 2.6.39-rc4+
 This package contains firmware from the Linux kernel, version 2.6.39-rc4+.

Package: linux-libc-dev
Section: devel
Provides: linux-kernel-headers
Architecture: any
Description: Linux support headers for userspace development
 This package provides userspaces headers from the Linux kernel.  These
headers
 are used by the installed headers for GNU glibc and other system libraries.



**********Using patched /scripts/package/builddeb - failed ************
patch -p1 < builddeb.patch
fakeroot make ARCH=x86_64 deb-pkg

+ dpkg-gencontrol -isp -DArchitecture=amd64 -plinux-headers-2.6.39-rc4+
-P/opt/kernel-linus/linux-2.6/debian/hdrtmp
dpkg-gencontrol: error: current host architecture 'i386' does not appear
in package's architecture list (amd64)
make[1]: *** [deb-pkg] Error 255
make: *** [deb-pkg] Error 2

cat debian/control
Source: linux-upstream
Section: kernel
Priority: optional
Maintainer: Anonymous <root@robert-VGN-Z690Y>
Standards-Version: 3.8.4
Homepage: http://www.kernel.org/

Package: linux-image-2.6.39-rc4+
Provides: linux-image, linux-image-2.6, linux-modules-2.6.39-rc4+
Suggests: linux-firmware-image
Architecture: any
Description: Linux kernel, version 2.6.39-rc4+
 This package contains the Linux kernel, modules and corresponding other
 files, version: 2.6.39-rc4+.

Package: linux-headers-2.6.39-rc4+
Provides: linux-headers, linux-headers-2.6
Architecture: amd64
Description: Linux kernel headers for 2.6.39-rc4+ on amd64
 This package provides kernel header files for 2.6.39-rc4+ on amd64
 .
 This is useful for people who need to build external modules



**********Using patched /scripts/package/builddeb - succeeded ************
fakeroot make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- deb-pkg

+ dpkg-gencontrol -isp -DArchitecture=armel -plinux-headers-2.6.39-rc4+
-P/opt/kernel-linus/linux-2.6/debian/hdrtmp
+ dpkg-gencontrol -isp -DArchitecture=armel -plinux-firmware-image
-P/opt/kernel-linus/linux-2.6/debian/fwtmp
+ dpkg-gencontrol -isp -DArchitecture=armel -plinux-libc-dev
-P/opt/kernel-linus/linux-2.6/debian/headertmp
+ dpkg-gencontrol -isp -DArchitecture=armel -plinux-image-2.6.39-rc4+
-P/opt/kernel-linus/linux-2.6/debian/tmp

cat debian/control
Source: linux-upstream
Section: kernel
Priority: optional
Maintainer: Anonymous <root@robert-VGN-Z690Y>
Standards-Version: 3.8.4
Homepage: http://www.kernel.org/

Package: linux-image-2.6.39-rc4+
Provides: linux-image, linux-image-2.6, linux-modules-2.6.39-rc4+
Suggests: linux-firmware-image
Architecture: any
Description: Linux kernel, version 2.6.39-rc4+
 This package contains the Linux kernel, modules and corresponding other
 files, version: 2.6.39-rc4+.

Package: linux-headers-2.6.39-rc4+
Provides: linux-headers, linux-headers-2.6
Architecture: armel
Description: Linux kernel headers for 2.6.39-rc4+ on armel
 This package provides kernel header files for 2.6.39-rc4+ on armel
 .
 This is useful for people who need to build external modules

Package: linux-firmware-image
Architecture: all
Description: Linux kernel firmware, version 2.6.39-rc4+
 This package contains firmware from the Linux kernel, version 2.6.39-rc4+.

Package: linux-libc-dev
Section: devel
Provides: linux-kernel-headers
Architecture: any
Description: Linux support headers for userspace development
 This package provides userspaces headers from the Linux kernel.  These
headers
 are used by the installed headers for GNU glibc and other system libraries.


**********Using original /scripts/package/builddeb - failed ************
fakeroot make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- deb-pkg

+ dpkg-gencontrol -isp -DArchitecture=armel -plinux-headers-2.6.39-rc4+
-P/opt/kernel-linus/linux-2.6/debian/hdrtmp
dpkg-gencontrol: error: current host architecture 'armel' does not
appear in package's architecture list (i386)
make[1]: *** [deb-pkg] Error 255
make: *** [deb-pkg] Error 2

cat debian/control
Source: linux-upstream
Section: kernel
Priority: optional
Maintainer: Anonymous <root@robert-VGN-Z690Y>
Standards-Version: 3.8.4
Homepage: http://www.kernel.org/

Package: linux-image-2.6.39-rc4+
Provides: linux-image, linux-image-2.6, linux-modules-2.6.39-rc4+
Suggests: linux-firmware-image
Architecture: any
Description: Linux kernel, version 2.6.39-rc4+
 This package contains the Linux kernel, modules and corresponding other
 files, version: 2.6.39-rc4+.

Package: linux-headers-2.6.39-rc4+
Provides: linux-headers, linux-headers-2.6
Architecture: i386
Description: Linux kernel headers for 2.6.39-rc4+ on i386
 This package provides kernel header files for 2.6.39-rc4+ on i386
 .
 This is useful for people who need to build external modules






^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-14 14:38     ` maximilian attems
@ 2011-04-14 14:40       ` maximilian attems
  0 siblings, 0 replies; 16+ messages in thread
From: maximilian attems @ 2011-04-14 14:40 UTC (permalink / raw)
  To: robert; +Cc: linux-kbuild, robertcnelson

On Thu, Apr 14, 2011 at 04:38:58PM +0200, maximilian attems wrote:
> On Thu, 14 Apr 2011, robert@greenroomsoftware.com wrote:
> 
> >      This is my first patch submission, and I am trying to get it
> > right.  I fixed white space issues and removed the following
> > unneeded line:
> > arch=$(dpkg --print-architecture)
> > 
> > Regards,
> > Robert Gordon
>  
> the patch itselfs looks good now, but I was unable to apply it,
> copied over to some temporary mailbox /tmp/n, but getting this:
> 
> maks@dual:~/src/linux-2.6 (debarch $)$ git am -i -s /tmp/n
> Patch is empty.  Was it split wrong?
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
> maks@dual:~/src/linux-2.6 (debarch $|AM)$ git am --abort
> 
> 
> it looks like your mail client borked the patch while sending it,
> adding everywhere an additional " " prefix.

scratch that comment, try to use for getting a proper patch
git format-patch HEAD^..

for sending off, git send-email is very practical.
 
> Try to send the patch to yourself and to apply it, before resending
> here, also you might want to read in linux-2.6 git
> Documentation/email-clients.txt
> 
> I hope this helps?
> 
> kind regards
>  
> > 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>
> > ---
> >  .../2.6-stable/KERNEL/scripts/package/builddeb     |   73
> > ++++++++++----------
> >  1 files changed, 37 insertions(+), 36 deletions(-)
> > 
> > diff --git
> > a/kernel-unpatched/2.6-stable/KERNEL/scripts/package/builddeb
> > b/kernel/2.6-stable/KERNEL/scripts/package/builddeb
> > index f6cbc3d..975e39a 100644
> > --- a/scripts/package/builddeb
> > +++ b/scripts/package/builddeb
> > @@ -25,38 +25,7 @@ create_package() {
> >  	chown -R root:root "$pdir"
> >  	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 +35,39 @@ create_package() {
> >  	dpkg --build "$pdir" ..
> >  }
> > 
> > +# Attempt to find the correct Debian architecture
> > +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)
> > @@ -246,15 +248,14 @@ mkdir -p "$destdir"
> >  (cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -)
> >  (cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar
> > -xf -)
> >  rm -f /tmp/files$$ /tmp/objfiles$$
> > -arch=$(dpkg --print-architecture)
> > 
> >  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
> > ---
> -- 
> maks

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-14 13:11   ` robert
  2011-04-14 13:37     ` Robert Nelson
  2011-04-14 14:24     ` robert
@ 2011-04-14 14:38     ` maximilian attems
  2011-04-14 14:40       ` maximilian attems
  2 siblings, 1 reply; 16+ messages in thread
From: maximilian attems @ 2011-04-14 14:38 UTC (permalink / raw)
  To: robert; +Cc: linux-kbuild, robertcnelson

On Thu, 14 Apr 2011, robert@greenroomsoftware.com wrote:

>      This is my first patch submission, and I am trying to get it
> right.  I fixed white space issues and removed the following
> unneeded line:
> arch=$(dpkg --print-architecture)
> 
> Regards,
> Robert Gordon
 
the patch itselfs looks good now, but I was unable to apply it,
copied over to some temporary mailbox /tmp/n, but getting this:

maks@dual:~/src/linux-2.6 (debarch $)$ git am -i -s /tmp/n
Patch is empty.  Was it split wrong?
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
maks@dual:~/src/linux-2.6 (debarch $|AM)$ git am --abort


it looks like your mail client borked the patch while sending it,
adding everywhere an additional " " prefix.

Try to send the patch to yourself and to apply it, before resending
here, also you might want to read in linux-2.6 git
Documentation/email-clients.txt

I hope this helps?

kind regards
 
> 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>
> ---
>  .../2.6-stable/KERNEL/scripts/package/builddeb     |   73
> ++++++++++----------
>  1 files changed, 37 insertions(+), 36 deletions(-)
> 
> diff --git
> a/kernel-unpatched/2.6-stable/KERNEL/scripts/package/builddeb
> b/kernel/2.6-stable/KERNEL/scripts/package/builddeb
> index f6cbc3d..975e39a 100644
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -25,38 +25,7 @@ create_package() {
>  	chown -R root:root "$pdir"
>  	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 +35,39 @@ create_package() {
>  	dpkg --build "$pdir" ..
>  }
> 
> +# Attempt to find the correct Debian architecture
> +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)
> @@ -246,15 +248,14 @@ mkdir -p "$destdir"
>  (cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -)
>  (cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar
> -xf -)
>  rm -f /tmp/files$$ /tmp/objfiles$$
> -arch=$(dpkg --print-architecture)
> 
>  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
> ---
-- 
maks

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-14 13:11   ` robert
  2011-04-14 13:37     ` Robert Nelson
@ 2011-04-14 14:24     ` robert
  2011-04-14 14:38     ` maximilian attems
  2 siblings, 0 replies; 16+ messages in thread
From: robert @ 2011-04-14 14:24 UTC (permalink / raw)
  To: robert; +Cc: linux-kbuild, robertcnelson, maximilian attems

 This patch is now diffed against Linus's tree.  The issue first arose 
 in the 2.6.38 release.

 Regards,
 Robert Gordon


 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>
 ---
  .../scripts/package/builddeb    |   73 ++++++++++----------
  1 files changed, 37 insertions(+), 36 deletions(-)

 diff --git a/scripts/package/builddeb b/scripts/package/builddeb
 index f6cbc3d..975e39a 100644
 --- a/scripts/package/builddeb
 +++ b/scripts/package/builddeb
 @@ -25,38 +25,7 @@ create_package() {
  	chown -R root:root "$pdir"
  	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 +35,39 @@ create_package() {
  	dpkg --build "$pdir" ..
  }
 
 +# Attempt to find the correct Debian architecture
 +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)
 @@ -246,15 +248,14 @@ mkdir -p "$destdir"
  (cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -)
  (cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf 
 -)
  rm -f /tmp/files$$ /tmp/objfiles$$
 -arch=$(dpkg --print-architecture)
 
  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
 ---


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-14 13:11   ` robert
@ 2011-04-14 13:37     ` Robert Nelson
  2011-04-14 14:24     ` robert
  2011-04-14 14:38     ` maximilian attems
  2 siblings, 0 replies; 16+ messages in thread
From: Robert Nelson @ 2011-04-14 13:37 UTC (permalink / raw)
  To: robert; +Cc: linux-kbuild

On Thu, Apr 14, 2011 at 8:11 AM,  <robert@greenroomsoftware.com> wrote:
>     This is my first patch submission, and I am trying to get it right.  I
> fixed white space issues and removed the following unneeded line:
> arch=$(dpkg --print-architecture)
>
> Regards,
> Robert Gordon
>
>
> 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>
> ---
>  .../2.6-stable/KERNEL/scripts/package/builddeb     |   73
> ++++++++++----------
>  1 files changed, 37 insertions(+), 36 deletions(-)
>
> diff --git a/kernel-unpatched/2.6-stable/KERNEL/scripts/package/builddeb
> b/kernel/2.6-stable/KERNEL/scripts/package/builddeb

Sorry Robert, my build/patch script ^^^ can really make a mess of this..

In system.sh uncomment out GIT_MODE, then you can use the git tree
under the  "/KERNEL" directory

But it would be better to just clone linus's tree and base the patch off that..

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

> index f6cbc3d..975e39a 100644
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -25,38 +25,7 @@ create_package() {
>        chown -R root:root "$pdir"
>        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 +35,39 @@ create_package() {
>        dpkg --build "$pdir" ..
>  }
>
> +# Attempt to find the correct Debian architecture
> +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)
> @@ -246,15 +248,14 @@ mkdir -p "$destdir"
>  (cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -)
>  (cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)
>  rm -f /tmp/files$$ /tmp/objfiles$$
> -arch=$(dpkg --print-architecture)
>
>  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
> ---
>



-- 
Robert Nelson
http://www.rcn-ee.com/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-13 22:47 ` maximilian attems
@ 2011-04-14 13:11   ` robert
  2011-04-14 13:37     ` Robert Nelson
                       ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: robert @ 2011-04-14 13:11 UTC (permalink / raw)
  To: linux-kbuild; +Cc: robertcnelson, maximilian attems

      This is my first patch submission, and I am trying to get it 
 right.  I fixed white space issues and removed the following unneeded 
 line:
 arch=$(dpkg --print-architecture)

 Regards,
 Robert Gordon


 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>
 ---
  .../2.6-stable/KERNEL/scripts/package/builddeb     |   73 
 ++++++++++----------
  1 files changed, 37 insertions(+), 36 deletions(-)

 diff --git 
 a/kernel-unpatched/2.6-stable/KERNEL/scripts/package/builddeb 
 b/kernel/2.6-stable/KERNEL/scripts/package/builddeb
 index f6cbc3d..975e39a 100644
 --- a/scripts/package/builddeb
 +++ b/scripts/package/builddeb
 @@ -25,38 +25,7 @@ create_package() {
  	chown -R root:root "$pdir"
  	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 +35,39 @@ create_package() {
  	dpkg --build "$pdir" ..
  }
 
 +# Attempt to find the correct Debian architecture
 +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)
 @@ -246,15 +248,14 @@ mkdir -p "$destdir"
  (cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -)
  (cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf 
 -)
  rm -f /tmp/files$$ /tmp/objfiles$$
 -arch=$(dpkg --print-architecture)
 
  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
 ---

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
  2011-04-13 21:20 Robert
@ 2011-04-13 22:47 ` maximilian attems
  2011-04-14 13:11   ` robert
  0 siblings, 1 reply; 16+ messages in thread
From: maximilian attems @ 2011-04-13 22:47 UTC (permalink / raw)
  To: Robert; +Cc: linux-kbuild, robertcnelson

On Wed, Apr 13, 2011 at 05:20:35PM -0400, Robert wrote:
> This is my first patch, so hopefully I've done it correctly.  Details follow.

looks mostly good at a quick check,
please just fix 2 small critics and resubmit.
 
 
> 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>
> ---
>  scripts/package/builddeb |   70 +++++++++++++++++++++++----------------------
>  1 files changed, 36 insertions(+), 34 deletions(-)
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index f6cbc3d..2a15fda 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
> +

aboves is now all "whispace damaged", please use a tab for indentation.
every project has it's indendation rules and linux-2.6 enforces tab not
4 spaces like python.

>  # 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
> -- 

Haven't applied the patch yet, but I remember a stupid dpkg arch call.
From a quick look aboves codeflow should make it unnecessary, speaking of:

arch=$(dpkg --print-architecture)

so please also remove it.

thank you.

-- 
maks

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol
@ 2011-04-13 21:20 Robert
  2011-04-13 22:47 ` maximilian attems
  0 siblings, 1 reply; 16+ messages in thread
From: Robert @ 2011-04-13 21:20 UTC (permalink / raw)
  To: linux-kbuild

This is my first patch, so hopefully I've done it correctly.  Details follow.

Regards,
Robert Gordon


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>
---
 scripts/package/builddeb |   70 +++++++++++++++++++++++----------------------
 1 files changed, 36 insertions(+), 34 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index f6cbc3d..2a15fda 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
-- 


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-04-22 20:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-15 18:23 [PATCH] kbuild, deb-pkg: set host machine after dpkg-gencontrol Robert Gordon
2011-04-17 22:29 ` maximilian attems
2011-04-17 22:34   ` Robert Nelson
2011-04-18 11:13     ` Michal Marek
2011-04-18 16:06   ` maximilian attems
2011-04-18 19:28     ` robert
2011-04-19 14:33       ` maximilian attems
2011-04-20 17:35         ` Robert Gordon
2011-04-22 20:24           ` Robert Gordon
  -- strict thread matches above, loose matches on Subject: below --
2011-04-13 21:20 Robert
2011-04-13 22:47 ` maximilian attems
2011-04-14 13:11   ` robert
2011-04-14 13:37     ` Robert Nelson
2011-04-14 14:24     ` robert
2011-04-14 14:38     ` maximilian attems
2011-04-14 14:40       ` maximilian attems

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.