[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Building amd64/k8 kernel from 32-bit userspace



Dave Ewart <davee@ceu.ox.ac.uk> writes:

> On Tuesday, 25.10.2005 at 10:56 +0100, Dave Ewart wrote:
>
>> On Tuesday, 25.10.2005 at 11:36 +0200, Goswin von Brederlow wrote:
>> 
>> > The recommended (and only user friendly) way to build a 64bit kernel
>> > is a 64bit userland.
>> > 
>> > For i386 users that means installing the existing 64bit kernel, create
>> > a 64bit chroot and compile the kernel in there.
>> > 
>> > That way it all just magically works.
>> 
>> That makes sense.  The slight difficulty here is that the "existing"
>> 64-bit kernel, Debian stock package, kicks off a hardware conflict on my
>> machine with my nVidia card.
>> 
>> Maybe I can just run it in non-graphical mode for long enough to build a
>> chroot and build a kernel in it.  I guess that for *subsequent* kernel
>> rebuilds, this will be easier, since I'll have a running 64-bit kernel
>> :-)
>
> This still doesn't seem to quite work.
>
> Build environment:
>
>     Host system:  running stock Debian kernel 2.6.8-11-amd64-k8
>                   32-bit userspace
>                   64-bit Sarge chroot
>     Sarge chroot: gcc 3.4
>                   building kernel 2.6.12 from Debian source package
>
> This build in the chroot works: I get kernel-image-2.6.12_+davee.1.0_amd64.deb created
>
> However, when I try to install this for the host system, this error
> occurs:
>
>     # dpkg -i kernel-image-2.6.12_+davee.1.0_amd64.deb 
>
>     dpkg: error processing kernel-image-2.6.12_+davee.1.0_amd64.deb (--install):
>      package architecture (amd64) does not match system (i386)
>     Errors were encountered while processing:
>      kernel-image-2.6.12_+davee.1.0_amd64.deb

That is correct. You compiled on amd64 and for amd64. Try mount --bind
/boot /chroot/boot and install the kernel inside the chroot.

Alternatively dpkg --force-architecture.

Or you can change the architecture of the deb with (from memory)

echo '#!/bin/sh' >/tmp/foo.sh
echo "sed -i 's/Architecture: amd64/Architecture: i386/' DEBIAN/control" >>/tmp/foo.sh
chmod a+x /tmp/foo.sh
fakeroot dpkg-reversion -k /tmp/foo.sh kernel-image-2.6.12_+davee.1.0_amd64.deb "change arch to i386"


MfG
        Goswin



Reply to: