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

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



On Wednesday, 26.10.2005 at 11:32 +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"

OK, will try those methods.  As a result of your second post here, I
will dispute your remark above which says "That way it all just
magically works." :-)

Thanks again, Goswin, much appreciated.

Dave.
-- 
Dave Ewart
davee@ceu.ox.ac.uk
Computing Manager, Cancer Epidemiology Unit
Cancer Research UK / Oxford University
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016

Attachment: signature.asc
Description: Digital signature


Reply to: