FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 11-05-2010, 12:30 PM
Asbjoern Sloth Toennesen
 
Default kbuild, deb-pkg: select userland architecture based on UTS_MACHINE

Instead of creating the debian package for the compiling userland,
create it for a userland matching the kernel thats being compiled.

This patch supports all Lenny release architectures,
and Linux-based architecture candidates for Squeeze.

If it can't find a proper Debian userspace it displays a warning,
and fallback to let deb-gencontrol use the host's userspace arch.

Eg. with this patch the following make command:

make ARCH=i386 deb-pkg

will output an i386 Debian package instead of an amd64 one,
when run on an amd64 machine.

Signed-off-by: Asbjoern Sloth Toennesen <asbjorn@asbjorn.biz>
---
scripts/package/builddeb | 35 ++++++++++++++++++++++++++++++++++-
1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 5f1e2fc..0043ccd 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -25,8 +25,41 @@ 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 "$debarch" ] ; then
+ forcearch="-DArchitecture=$debarch"
+ fi
+
# Create the package
- dpkg-gencontrol -isp -p$pname -P"$pdir"
+ dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir"
dpkg --build "$pdir" ..
}

--
1.7.2.3


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1288963808-7057-1-git-send-email-asbjorn@asbjorn.biz">http://lists.debian.org/1288963808-7057-1-git-send-email-asbjorn@asbjorn.biz
 
Old 11-05-2010, 12:42 PM
Sven-Haegar Koch
 
Default kbuild, deb-pkg: select userland architecture based on UTS_MACHINE

On Fri, 5 Nov 2010, Asbjoern Sloth Toennesen wrote:

> Instead of creating the debian package for the compiling userland,
> create it for a userland matching the kernel thats being compiled.

> Eg. with this patch the following make command:
>
> make ARCH=i386 deb-pkg
>
> will output an i386 Debian package instead of an amd64 one,
> when run on an amd64 machine.

How do I either select a differnet package-arch or reverse to the
current way?

I am right now using 'make ARCH=x86_64 deb-pkg' on a 32bit userspace
environment running with a 64bit kernel, wanting to create packages to
be installed in this i386 arch.

(As I want 64bit support where possible (mostly for AES-NI support in
dm-crypt), but don't have the time available to do a complete userspace
reinstall and reconfiguration)

c'ya
sven-haegar

--
Three may keep a secret, if two of them are dead.
- Ben F.


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: alpine.DEB.2.02.1011051437500.13287@aurora.sdinet. de">http://lists.debian.org/alpine.DEB.2.02.1011051437500.13287@aurora.sdinet. de
 
Old 11-06-2010, 06:04 PM
Asbjørn Sloth Tønnesen
 
Default kbuild, deb-pkg: select userland architecture based on UTS_MACHINE

On 11/05/2010 01:42 PM, Sven-Haegar Koch wrote:
> On Fri, 5 Nov 2010, Asbjoern Sloth Toennesen wrote:
>
>> Instead of creating the debian package for the compiling userland,
>> create it for a userland matching the kernel thats being compiled.
>
>> Eg. with this patch the following make command:
>>
>> make ARCH=i386 deb-pkg
>>
>> will output an i386 Debian package instead of an amd64 one,
>> when run on an amd64 machine.
>
> How do I either select a differnet package-arch or reverse to the
> current way?
>
> I am right now using 'make ARCH=x86_64 deb-pkg' on a 32bit userspace
> environment running with a 64bit kernel, wanting to create packages to
> be installed in this i386 arch.
>
> (As I want 64bit support where possible (mostly for AES-NI support in
> dm-crypt), but don't have the time available to do a complete userspace
> reinstall and reconfiguration)

Sounds like an one off thing, so in your case forcing the installation
should work:

dpkg --force-architecture linux-image-*.deb

The problem with that approach is that it doesn't work with APT, but I
doubt that there are any private APT repositories with this environment.

The issue with one kernel and 2 userspaces will also arise in sparc,
when the sparc64 userland gets going. So it will need to be dealt with
at some point, so I create a 3 lines additional patch for it.


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4CD5A6C8.8030603@asbjorn.biz">http://lists.debian.org/4CD5A6C8.8030603@asbjorn.biz
 
Old 11-25-2010, 01:35 PM
Michal Marek
 
Default kbuild, deb-pkg: select userland architecture based on UTS_MACHINE

On Fri, Nov 05, 2010 at 01:30:08PM +0000, Asbjoern Sloth Toennesen wrote:
> Instead of creating the debian package for the compiling userland,
> create it for a userland matching the kernel thats being compiled.
>
> This patch supports all Lenny release architectures,
> and Linux-based architecture candidates for Squeeze.
>
> If it can't find a proper Debian userspace it displays a warning,
> and fallback to let deb-gencontrol use the host's userspace arch.
>
> Eg. with this patch the following make command:
>
> make ARCH=i386 deb-pkg
>
> will output an i386 Debian package instead of an amd64 one,
> when run on an amd64 machine.
>
> Signed-off-by: Asbjoern Sloth Toennesen <asbjorn@asbjorn.biz>
> ---
> scripts/package/builddeb | 35 ++++++++++++++++++++++++++++++++++-
> 1 files changed, 34 insertions(+), 1 deletions(-)

Applied to kbuild-2.6.git#packaging, thanks.

Michal


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20101125143553.GB8192@sepie.suse.cz">http://lists.debian.org/20101125143553.GB8192@sepie.suse.cz
 

Thread Tools




All times are GMT. The time now is 10:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org