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-04-2010, 04:58 AM
Sam Ravnborg
 
Default kbuild, deb-pkg: fix Architecture field when cross compiling

On Thu, Nov 04, 2010 at 03:44:04AM +0000, Asbjoern Sloth Toennesen wrote:
> Attempt to guess the correct value of the Architecture control
> field, based on the ARCH environment variable. Fallback to letting
> deb-gencontrol use the host platform's architecture.
>
> 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 amd64 machine.
>
> Signed-off-by: Asbjoern Sloth Toennesen <asbjorn@asbjorn.biz>
> ---
> scripts/package/builddeb | 17 ++++++++++++++++-
> 1 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 5f1e2fc..43b8826 100644
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -25,8 +25,23 @@ create_package() {
> chown -R root:root "$pdir"
> chmod -R go-w "$pdir"
>
> + # Attempt to find the correct Debian architecture
> + local forcearch="" debarch=""
> + case "$ARCH" in
> + i386|ia64)
> + debarch="$ARCH" ;;
> + x86_64)
> + debarch="amd64" ;;

On the commandline I can say ARCH=x86 - will it do the right thing then?

> + *)
> + grep -q CONFIG_ARM=y .config &&
> + debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el)
> + esac

sparc may be know as sparc32, sparc64 and sparc these days.
I recall that at least in the past debian supported sparc.

Sam


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20101104055800.GA11781@merkur.ravnborg.org">http://lists.debian.org/20101104055800.GA11781@merkur.ravnborg.org
 
Old 11-04-2010, 11:29 AM
Asbjørn Sloth Tønnesen
 
Default kbuild, deb-pkg: fix Architecture field when cross compiling

On 11/04/2010 05:58 AM, Sam Ravnborg wrote:
> On Thu, Nov 04, 2010 at 03:44:04AM +0000, Asbjoern Sloth Toennesen wrote:
>> [...]
>> + # Attempt to find the correct Debian architecture
>> + local forcearch="" debarch=""
>> + case "$ARCH" in
>> + i386|ia64)
>> + debarch="$ARCH" ;;
>> + x86_64)
>> + debarch="amd64" ;;
>
> On the commandline I can say ARCH=x86 - will it do the right thing then?

No, not if you are cross compiling since ARCH=x86 isn't specific to
either, we would have to look at the config. In that case it is better
to do something like:

x86|i386|x86_64)
debarch=$(grep -q CONFIG_64BIT=y .config &&
echo amd64 || echo i386) ;;

>> + *)
>> + grep -q CONFIG_ARM=y .config &&
>> + debarch=arm$(grep -q CONFIG_AEABI=y .config && echo el)
>> + esac
>
> sparc may be know as sparc32, sparc64 and sparc these days.
> I recall that at least in the past debian supported sparc.

I only included the major Debian architectures in my patch since, I
don't know enough about all the smaller architectures and there config
dependencies. I have however added mips as it seemed straight forward.

AFAICT there are some problems surrounding sparc, since sparc in debian
uses 64-bit kernels, 32-bit userland, and the new sparc64 port uses
64-kernels and 64-bit userland, so we have no way of knowing if the
64-bit sparc kernel should have the Architecture field set to sparc or
sparc64.

For now I will just set it to sparc, as that is a release candidate for
squeeze, where sparc64 isn't nearly that far along.

sparc*)
debarch=sparc ;;
mips)
debarch=mips$(grep -q CPU_LITTLE_ENDIAN && echo el) ;;


I will sum these up in a new revision of the patch, when I get an ack
from Michal or a Debian kernel team member.


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4CD2A725.7030809@asbjorn.biz">http://lists.debian.org/4CD2A725.7030809@asbjorn.biz
 
Old 11-04-2010, 11:36 AM
Michal Marek
 
Default kbuild, deb-pkg: fix Architecture field when cross compiling

On 4.11.2010 13:29, Asbjørn Sloth Tønnesen wrote:
> No, not if you are cross compiling since ARCH=x86 isn't specific to
> either, we would have to look at the config. In that case it is better
> to do something like:
>
> x86|i386|x86_64)
> debarch=$(grep -q CONFIG_64BIT=y .config &&

No, you should use $UTS_MACHINE (`uname -m` in the resulting kernel),
like make rpm-pkg does, and only translate x86_64 to amd64.

Michal


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4CD2A8BC.3010500@suse.cz">http://lists.debian.org/4CD2A8BC.3010500@suse.cz
 
Old 11-04-2010, 12:33 PM
Asbjørn Sloth Tønnesen
 
Default kbuild, deb-pkg: fix Architecture field when cross compiling

On 11/04/2010 12:36 PM, Michal Marek wrote:
> On 4.11.2010 13:29, Asbjørn Sloth Tønnesen wrote:
>> No, not if you are cross compiling since ARCH=x86 isn't specific to
>> either, we would have to look at the config. In that case it is better
>> to do something like:
>>
>> x86|i386|x86_64)
>> debarch=$(grep -q CONFIG_64BIT=y .config &&
>
> No, you should use $UTS_MACHINE (`uname -m` in the resulting kernel),
> like make rpm-pkg does, and only translate x86_64 to amd64.

Ok, sorry, hadn't caught that it was on the resulting kernel.

So that solves the x86 architectures, but according to a quick git grep,
.config analysis is still needed for arm(el) and mips(el).


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4CD2B646.3090100@asbjorn.biz">http://lists.debian.org/4CD2B646.3090100@asbjorn.biz
 

Thread Tools




All times are GMT. The time now is 01:26 PM.

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