Debian Bug report logs - #443221
kernel-package: Creates packages for wrong arch when cross-compiling for i386 on amd64

version graph

Package: kernel-package; Maintainer for kernel-package is Manoj Srivastava <srivasta@debian.org>; Source for kernel-package is src:kernel-package.

Reported by: Frans Pop <elendil@planet.nl>

Date: Wed, 19 Sep 2007 18:36:04 UTC

Severity: wishlist

Found in versions kernel-package/11.001, kernel-package/12.013, kernel-package/12.025

Fixed in version kernel-package/12.001

Done: Manoj Srivastava <srivasta@acm.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Manoj Srivastava <srivasta@debian.org>:
Bug#443221; Package kernel-package. Full text and rfc822 format available.

Acknowledgement sent to Frans Pop <elendil@planet.nl>:
New Bug report received and forwarded. Copy sent to Manoj Srivastava <srivasta@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Frans Pop <elendil@planet.nl>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: kernel-package: Creates packages for wrong arch when cross-compiling for i386 on amd64
Date: Wed, 19 Sep 2007 20:33:41 +0200
Package: kernel-package
Version: 11.001
Severity: minor

I've tried cross-compiling an upstream kernel (on amd64) using:
fakeroot make-kpkg --initrd kernel-image --revision=fjp1 --arch=i386 --cross-compile=-

I would have expected an i386 package to be created, but ended up with:
linux-image-2.6.23-rc6_fjp1_amd64.deb
The contents were fine. I "installed" the package on my i386 laptop using
'dpkg -x' and the kernel booted fine.

So it looks like it is just the package creation step that fails to
honor the --arch option. Or am I missing something?
I have dpkg-cross installed.

Cheers,
FJP

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.23-rc6 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages kernel-package depends on:
ii  dpkg                          1.14.6     package maintenance system for Deb
ii  dpkg-dev                      1.14.6     package building tools for Debian
ii  file                          4.21-3     Determines file type using "magic"
ii  gcc [c-compiler]              4:4.2.1-6  The GNU C compiler
ii  gcc-4.1 [c-compiler]          4.1.2-16   The GNU C compiler
ii  gcc-4.2 [c-compiler]          4.2.1-4    The GNU C compiler
ii  gettext                       0.16.1-2   GNU Internationalization utilities
ii  make                          3.81-3     The GNU version of the "make" util
ii  perl                          5.8.8-7    Larry Wall's Practical Extraction 
ii  po-debconf                    1.0.9      manage translated Debconf template

Versions of packages kernel-package recommends:
ii  bzip2                         1.0.3-7    high-quality block-sorting file co
ii  libc6-dev [libc-dev]          2.6.1-1    GNU C Library: Development Librari

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Manoj Srivastava <srivasta@debian.org>:
Bug#443221; Package kernel-package. Full text and rfc822 format available.

Acknowledgement sent to Frans Pop <elendil@planet.nl>:
Extra info received and forwarded to list. Copy sent to Manoj Srivastava <srivasta@debian.org>. Full text and rfc822 format available.

Message #10 received at 443221@bugs.debian.org (full text, mbox):

From: Frans Pop <elendil@planet.nl>
To: 443221@bugs.debian.org
Subject: Bug#443221: kernel-package: Creates packages for wrong arch when cross-compiling for i386 on amd64
Date: Mon, 12 Nov 2007 13:07:39 +0100
[Message part 1 (text/plain, inline)]
severity 443221 wishlist
thanks

I later realized that building a 64-bit (amd64) kernel for i386 is a 
perfectly valid option, so this issue is more an additional option than a 
bug in the current implementation.

I've worked around it by building the packages in a i386 chroot on my amd64 
system, which works perfectly.

I still think it could be a nice option to support though, especially now 
that crossbuilding support is getting better integrated into dpkg.

Cheers,
FJP
[signature.asc (application/pgp-signature, inline)]

Severity set to `wishlist' from `minor' Request was from Frans Pop <elendil@planet.nl> to control@bugs.debian.org. (Mon, 12 Nov 2007 12:09:04 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Manoj Srivastava <srivasta@debian.org>:
Bug#443221; Package kernel-package. (Mon, 13 Oct 2008 06:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Manoj Srivastava <srivasta@acm.org>:
Extra info received and forwarded to list. Copy sent to Manoj Srivastava <srivasta@debian.org>. (Mon, 13 Oct 2008 06:57:02 GMT) Full text and rfc822 format available.

Message #17 received at 443221@bugs.debian.org (full text, mbox):

From: Manoj Srivastava <srivasta@acm.org>
To: Frans Pop <elendil@planet.nl>
Cc: 443221@bugs.debian.org
Subject: Re: Bug#443221: kernel-package: Creates packages for wrong arch when cross-compiling for i386 on amd64
Date: Mon, 13 Oct 2008 01:46:33 -0500
Hi,
On Wed, Sep 19 2007, Frans Pop wrote:


> I've tried cross-compiling an upstream kernel (on amd64) using:
> fakeroot make-kpkg --initrd kernel-image --revision=fjp1 --arch=i386 --cross-compile=-
>
> I would have expected an i386 package to be created, but ended up with:
> linux-image-2.6.23-rc6_fjp1_amd64.deb
> The contents were fine. I "installed" the package on my i386 laptop using
> 'dpkg -x' and the kernel booted fine.
>
> So it looks like it is just the package creation step that fails to
> honor the --arch option. Or am I missing something?
> I have dpkg-cross installed.

        well, how is this supposed to work? At this point, make-kpkg
 just calls dpkg --build; and dpkg selects the name of the .deb
 (including adding the host architecture the package is being built
 upon.

        manoj

-- 
There are those that are born to be on top and those that are born to be
on bottom.  Like officers and soldiers.  -- Sergeant Traub
Manoj Srivastava <srivasta@acm.org> <http://www.golden-gryphon.com/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C




Information forwarded to debian-bugs-dist@lists.debian.org, Manoj Srivastava <srivasta@debian.org>:
Bug#443221; Package kernel-package. (Mon, 13 Oct 2008 07:51:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Frans Pop <elendil@planet.nl>:
Extra info received and forwarded to list. Copy sent to Manoj Srivastava <srivasta@debian.org>. (Mon, 13 Oct 2008 07:51:03 GMT) Full text and rfc822 format available.

Message #22 received at 443221@bugs.debian.org (full text, mbox):

From: Frans Pop <elendil@planet.nl>
To: 443221@bugs.debian.org
Subject: Re: Bug#443221: kernel-package: Creates packages for wrong arch when cross-compiling for i386 on amd64
Date: Mon, 13 Oct 2008 09:49:12 +0200
On Monday 13 October 2008, you wrote:
>         well, how is this supposed to work? At this point, make-kpkg
>  just calls dpkg --build; and dpkg selects the name of the .deb
>  (including adding the host architecture the package is being built
>  upon.

I'm not sure, but it would be nice if the documentation would at least 
document the restriction. Currently the cross-compilation option implies 
that it should be possible to build a kernel image for e.g. sparc on 
i386, but if it ends up with the wrong arch for the package then that 
option is IMO pointless.

I do know that it is possible to create packages for another arch as we 
e.g. build kernel udebs for any arch on any arch.
The invocation kernel-wedge uses for that is 'buildpackage -b -a$arch', 
with 'buildpackage' defined as:
        dpkg-buildpackage -d -us -uc -rfakeroot -tc \
                -ICVS -I.svn -I'{arch}' -I.arch-ids $@
(see /usr/share/kernel-wedge/commands/build-arch)

Cheers,
FJP

P.S.
I personally don't really care about this BR anymore as with all the 
problems I had I've stopped using kernel-package completely. Instead I 
use the 'make deb-pkg' option supplied by the upstream kernel itself 
which _does_ allow me to cross-build kernel image packages. I use it 
without any problems to build kernel image packages for arm on amd64.

It also saves me huge amounts of build time as it does not clean the 
entire tree for each build, which is often unnecessary.




Reply sent to Manoj Srivastava <srivasta@acm.org>:
You have taken responsibility. (Tue, 14 Apr 2009 04:36:03 GMT) Full text and rfc822 format available.

Notification sent to Frans Pop <elendil@planet.nl>:
Bug acknowledged by developer. (Tue, 14 Apr 2009 04:36:03 GMT) Full text and rfc822 format available.

Message #27 received at 443221-done@bugs.debian.org (full text, mbox):

From: Manoj Srivastava <srivasta@acm.org>
To: Frans Pop <elendil@planet.nl>
Cc: 443221-done@bugs.debian.org
Subject: Re: Bug#443221: kernel-package: Creates packages for wrong arch when cross-compiling for i386 on amd64
Date: Mon, 13 Apr 2009 23:22:16 -0500
Package: kernel-package
Version: 12.001

Hi,

        Firstly, the amd64 and i386 kernel architectures are now merged
 into x86, and secondly, the changes to cross compilation made in
 12.001 should have fixed this even if the architectures had not
 been merged.

        manoj
-- 
Often statistics are used as a drunken man uses lampposts -- for support
rather than illumination.
Manoj Srivastava <srivasta@acm.org> <http://www.golden-gryphon.com/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C




Information forwarded to debian-bugs-dist@lists.debian.org, Manoj Srivastava <srivasta@debian.org>:
Bug#443221; Package kernel-package. (Sun, 10 May 2009 11:03:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arthur Marsh <arthur.marsh@internode.on.net>:
Extra info received and forwarded to list. Copy sent to Manoj Srivastava <srivasta@debian.org>. (Sun, 10 May 2009 11:03:06 GMT) Full text and rfc822 format available.

Message #32 received at 443221@bugs.debian.org (full text, mbox):

From: Arthur Marsh <arthur.marsh@internode.on.net>
To: Debian Bug Tracking System <443221@bugs.debian.org>
Subject: kernel-package: still problems compiling for PentiumII (686) on amd64
Date: Sun, 10 May 2009 20:29:52 +0930
Package: kernel-package
Version: 12.013
Severity: normal


Hi, I may have set flags wrong, but I am trying to *quickly* build a
kernel for an old PII-266 using a nearby amd64 machine.

I had copied the .config from the PII-266 machine to the 
/usr/src/linux-2.6-2.6.30~rc5 directory and run:

CONCURRENCY_LEVEL=3;export CONCURRENCY_LEVEL; \
make-kpkg --arch i386 --cross-compile - --arch-in-name --config menuconfig \
 --initrd linux-image 

I ended up with a .deb ending in amd64.deb that refused to install on the
PII-266 due to the .deb being for amd64 rather than i386  architecture.
                  
The output from the final stages of the build process was:

  DEPMOD  2.6.30-rc5
make[2]: Leaving directory `/usr/src/linux-2.6-2.6.30~rc5'
mv System.precious System.map
test ! -f Documentation/lguest/lguest ||                             \
            install -p    -o root -g root  -m  644 Documentation/lguest/lguest /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/lib/modules/2.6.30-rc5/lguest
test ! -f /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/lib/modules/2.6.30-rc5/lguest ||             \
            chmod 755 /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/lib/modules/2.6.30-rc5/lguest
test ! -e /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/lib/modules/2.6.30-rc5/source ||                    \
           mv /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/lib/modules/2.6.30-rc5/source ./debian/source-link
test ! -e /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/lib/modules/2.6.30-rc5/build ||                     \
           mv /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/lib/modules/2.6.30-rc5/build ./debian/build-link
test ! -e ./debian/source-link ||                                              \
           mv ./debian/source-link /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/lib/modules/2.6.30-rc5/source
test ! -e  ./debian/build-link ||                                              \
           mv  ./debian/build-link /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/lib/modules/2.6.30-rc5/build
/sbin/depmod -q -FSystem.map -b /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5 2.6.30-rc5;
test ! -f System.map ||  cp System.map                         \
                        /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5//boot/System.map-2.6.30-rc5;
test ! -f System.map ||  chmod 644                             \
                        /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5//boot/System.map-2.6.30-rc5;
cp arch/x86/boot/bzImage /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5//boot/vmlinuz-2.6.30-rc5
chmod 644 /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5//boot/vmlinuz-2.6.30-rc5;
if test -d /usr/src/linux-2.6-2.6.30~rc5/debian/image.d ; then                   \
             TMPTOP=/usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5 version=2.6.30-rc5 IMAGE_TOP=/usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5        \
                   run-parts --verbose /usr/src/linux-2.6-2.6.30~rc5/debian/image.d ;     \
         fi
if [ -x debian/post-install ]; then                               \
                TMPTOP=/usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5 STEM=linux version=2.6.30-rc5        \
                IMAGE_TOP=/usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5 debian/post-install;                \
        fi
test ! -f Kerntypes ||  cp Kerntypes                                   \
                        /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5//boot/Kerntypes-2.6.30-rc5
test ! -f Kerntypes ||  chmod 644                                      \
                        /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5//boot/Kerntypes-2.6.30-rc5
====== making target debian/stamp/binary/pre-linux-image-2.6.30-rc5 [new prereqs: linux-image-2.6.30-rc5]======

This is kernel package version 12.013.
/usr/bin/make -f ./debian/rules debian/stamp/binary/linux-image-2.6.30-rc5
make[2]: Entering directory `/usr/src/linux-2.6-2.6.30~rc5'
====== making target debian/stamp/binary/linux-image-2.6.30-rc5 [new prereqs: ]======

This is kernel package version 12.013.
install -p -d -o root -g root  -m  755 /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN
sed -e 's/=V/2.6.30-rc5/g'    -e 's/=IB//g' \
            -e 's/=ST/linux/g'  -e 's/=R//g' \
            -e 's/=K/bzImage/g'              \
            -e 's/=I/YES/g'     -e 's,=D,/boot,g'            \
            -e 's@=A@amd64@g'   \
            -e 's@=B@i386@g'     \
          ./debian/pkg/image/postinst > /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN/postinst
chmod 755 /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN/postinst
sed -e 's/=V/2.6.30-rc5/g'         -e 's/=IB//g' \
            -e 's/=ST/linux/g'  -e 's/=R//g' \
            -e 's/=K/bzImage/g'              \
            -e 's/=I/YES/g'     -e 's,=D,/boot,g'            \
            -e 's@=A@amd64@g'   \
            -e 's@=B@i386@g'    \
         ./debian/pkg/image/config > /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN/config
chmod 755 /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN/config
sed -e 's/=V/2.6.30-rc5/g'         -e 's/=IB//g' \
            -e 's/=ST/linux/g'  -e 's/=R//g' \
            -e 's/=K/bzImage/g'              \
            -e 's/=I/YES/g'     -e 's,=D,/boot,g'            \
            -e 's/=MD//g'                                    \
            -e 's@=MK@@g' -e 's@=A@amd64@g'   \
            -e 's@=M@@g'    -e 's/=OF//g'    \
            -e 's/=S//g' -e 's@=B@i386@g'     \
         ./debian/pkg/image/postrm > /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN/postrm
chmod 755 /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN/postrm
sed -e 's/=V/2.6.30-rc5/g'         -e 's/=IB//g'           \
            -e 's/=ST/linux/g'  -e 's/=R//g' \
            -e 's/=K/bzImage/g'              \
            -e 's/=I/YES/g'     -e 's,=D,/boot,g'            \
            -e 's/=MD//g'                                    \
            -e 's@=MK@@g' -e 's@=A@amd64@g'   \
            -e 's@=M@@g'    -e 's/=OF//g'    \
            -e 's/=S//g' -e 's@=B@i386@g'     \
         ./debian/pkg/image/preinst > /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN/preinst
chmod 755 /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN/preinst
sed -e 's/=V/2.6.30-rc5/g'    -e 's/=IB//g'    \
            -e 's/=ST/linux/g'  -e 's/=R//g' \
            -e 's/=K/bzImage/g'              \
            -e 's/=I/YES/g'     -e 's,=D,/boot,g'            \
            -e 's/=MD//g'                                    \
            -e 's@=MK@@g' -e 's@=A@amd64@g'   \
            -e 's@=M@@g'    -e 's/=OF//g'    \
            -e 's/=S//g' -e 's@=B@i386@g'     \
         ./debian/pkg/image/prerm > /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN/prerm
chmod 755 /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN/prerm
po2debconf debian/templates.in > debian/templates.l10n
sed -e 's/=V/2.6.30-rc5/g'    -e 's/=IB//g'    \
            -e 's/=ST/linux/g'  -e 's/=R//g' \
            -e 's/=K/bzImage/g'           \
            -e 's@=MK@@g' -e 's@=A@amd64@g'   \
            -e 's/=I/YES/g'     -e 's,=D,/boot,g'        \
            -e 's/=MD//g'                                \
            -e 's@=M@@g'    -e 's/=OF//g'    \
            -e 's/=S//g' -e 's@=B@i386@g'     \
         ./debian/templates.l10n   > ./debian/templates.master
install -p    -o root -g root  -m  644 ./debian/templates.master /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/DEBIAN/templates
dpkg-gencontrol -DArchitecture=amd64 -isp            \
                        -plinux-image-2.6.30-rc5 -P/usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5/
create_md5sums_fn () { cd $1 ; find . -type f ! -regex '.*/DEBIAN/.*' ! -regex './etc/.*'      ! -regex '.*lib/modules/[^/]*/modules\..*' -printf '%P\0' | xargs -r0 md5sum > DEBIAN/md5sums ; if [ -z "DEBIAN/md5sums" ] ; then rm -f "DEBIAN/md5sums" ; fi ; } ; create_md5sums_fn           /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5
chmod -R og=rX                 /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5
chown -R root:root             /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5
dpkg --build                   /usr/src/linux-2.6-2.6.30~rc5/debian/linux-image-2.6.30-rc5 ..
dpkg-deb: building package `linux-image-2.6.30-rc5' in `../linux-image-2.6.30-rc5_2.6.30-rc5-10.00.Custom_amd64.deb'.
make[2]: Leaving directory `/usr/src/linux-2.6-2.6.30~rc5'
make[1]: Leaving directory `/usr/src/linux-2.6-2.6.30~rc5'

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-rc5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages kernel-package depends on:
ii  binutils                      2.19.1-1   The GNU assembler, linker and bina
ii  build-essential               11.4       Informational list of build-essent
ii  debianutils                   3.1.3      Miscellaneous utilities specific t
ii  file                          5.03-1     Determines file type using "magic"
ii  gettext                       0.17-6     GNU Internationalization utilities
ii  make                          3.81-5     The GNU version of the "make" util
ii  module-init-tools             3.7-pre9-1 tools for managing Linux kernel mo
ii  po-debconf                    1.0.16     tool for managing templates file t
ii  util-linux                    2.13.1.1-1 Miscellaneous system utilities

kernel-package recommends no packages.

Versions of packages kernel-package suggests:
ii      1.0.5-1                              high-quality block-sorting file co
pn      <none>                               (no description available)
ii      1.41.5-1                             ext2/ext3/ext4 file system utiliti
ii      0.93.2                               tools for generating an initramfs
pn      <none>                               (no description available)
ii      5.7+20090502-1                       developer's libraries and docs for
ii      2.6.30~rc5-1~experimental.1~snapshot Linux kernel source for version 2.
pn      <none>                               (no description available)

-- debconf-show failed




Message #33 received at 443221-done@bugs.debian.org (full text, mbox):

From: Manoj Srivastava <srivasta@acm.org>
To: Arthur Marsh <arthur.marsh@internode.on.net>
Cc: 443221-done@bugs.debian.org
Subject: Re: Bug#443221: kernel-package: still problems compiling for PentiumII (686) on amd64
Date: Wed, 13 May 2009 11:43:08 -0500
Hi,

        Do not cross compile for i386 an amd64 or  vice versa on new
 kernel versions, since i386 and mad64 have been  merged into a common
 x86 architecture. Since this is not a cross compile at all, things get
 a little confused.

        manoj
-- 
I put contact lenses in my dog's eyes.  They had little pictures of cats
on them.  Then I took one out and he ran around in circles. -- Steven
Wright
Manoj Srivastava <srivasta@acm.org> <http://www.golden-gryphon.com/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C




Information forwarded to debian-bugs-dist@lists.debian.org, Manoj Srivastava <srivasta@debian.org>:
Bug#443221; Package kernel-package. (Sun, 24 May 2009 01:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Ynard <linkfanel@yahoo.fr>:
Extra info received and forwarded to list. Copy sent to Manoj Srivastava <srivasta@debian.org>. (Sun, 24 May 2009 01:03:02 GMT) Full text and rfc822 format available.

Message #38 received at 443221@bugs.debian.org (full text, mbox):

From: Pierre Ynard <linkfanel@yahoo.fr>
To: 443221@bugs.debian.org
Subject: Re: Bug#443221: kernel-package: still problems compiling for PentiumII (686) on amd64
Date: Sun, 24 May 2009 02:58:32 +0200
Hello,

> Do not cross compile for i386 an amd64 or vice versa on new kernel
> versions, since i386 and mad64 have been merged into a common x86
> architecture. Since this is not a cross compile at all, things get a
> little confused.

I am trying to build i386 packages of i386 kernels on my (very faster)
amd64 machine. The ARCH variable passed to `make' still needs to be set
to "i386". What is the right thing to do then?

According to the man page, and the available options, --arch seems to be
the right thing to use. So I use as a command line:

CONCURRENCY_LEVEL=4 make-kpkg --rootcmd fakeroot --revision foo.12 \
--arch i386 --cross-compile - kernel-image

Using kernel-package 12.014 (it is a debian sid system), it still ends
up building an amd64 package.

I can fix the problem for myself by manually setting DEB_HOST_ARCH to
i386 in /usr/share/kernel-package/ruleset/common/archvars.mk  Ugly hack,
much. I tried playing with the snippet of code:

ifdef KPKG_ARCH
  ifeq ($(strip $(MAKING_VIRTUAL_IMAGE)),)
    ifneq ($(CROSS_COMPILE),-)
      ha:=-a$(KPKG_ARCH)
    endif
  endif
endif

If it wasn't for the "ifneq ($(CROSS_COMPILE),-)" test, the right value
would be set for DEB_HOST_ARCH; however I assume that this test exists
for a reason, and if I by-pass it, wrong values are apparently set for
the other variables, and I get a bunch of errors like:

dpkg-architecture: warning: Specified GNU system type i486-linux-gnu
does not match gcc system type x86_64-linux-gnu.

So, is there an extra bit of logic missing there? Or am I simply doing it
wrong?

Regards,

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."




Information forwarded to debian-bugs-dist@lists.debian.org, Manoj Srivastava <srivasta@debian.org>:
Bug#443221; Package kernel-package. (Tue, 02 Jun 2009 19:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Manoj Srivastava <srivasta@acm.org>:
Extra info received and forwarded to list. Copy sent to Manoj Srivastava <srivasta@debian.org>. (Tue, 02 Jun 2009 19:06:02 GMT) Full text and rfc822 format available.

Message #43 received at 443221@bugs.debian.org (full text, mbox):

From: Manoj Srivastava <srivasta@acm.org>
To: Pierre Ynard <linkfanel@yahoo.fr>
Cc: 443221@bugs.debian.org
Subject: Re: Bug#443221: kernel-package: still problems compiling for PentiumII (686) on amd64
Date: Tue, 02 Jun 2009 13:52:47 -0500
On Sat, May 23 2009, Pierre Ynard wrote:

> Hello,
>
>> Do not cross compile for i386 an amd64 or vice versa on new kernel
>> versions, since i386 and mad64 have been merged into a common x86
>> architecture. Since this is not a cross compile at all, things get a
>> little confused.
>
> I am trying to build i386 packages of i386 kernels on my (very faster)
> amd64 machine. The ARCH variable passed to `make' still needs to be set
> to "i386". What is the right thing to do then?

        Since the kernel no longer distinguishes between  i386 and
 amd64,  the arch variable is really x86, I think.  What happens if you
 install the resulting package anyway, using --force-architecture?

> According to the man page, and the available options, --arch seems to be
> the right thing to use. So I use as a command line:
>
> CONCURRENCY_LEVEL=4 make-kpkg --rootcmd fakeroot --revision foo.12 \
> --arch i386 --cross-compile - kernel-image
>
> Using kernel-package 12.014 (it is a debian sid system), it still ends
> up building an amd64 package.
>
> I can fix the problem for myself by manually setting DEB_HOST_ARCH to
> i386 in /usr/share/kernel-package/ruleset/common/archvars.mk  Ugly hack,
> much. I tried playing with the snippet of code:
>
> ifdef KPKG_ARCH
>   ifeq ($(strip $(MAKING_VIRTUAL_IMAGE)),)
>     ifneq ($(CROSS_COMPILE),-)
>       ha:=-a$(KPKG_ARCH)
>     endif
>   endif
> endif
>
> If it wasn't for the "ifneq ($(CROSS_COMPILE),-)" test, the right value
> would be set for DEB_HOST_ARCH; however I assume that this test exists
> for a reason, and if I by-pass it, wrong values are apparently set for
> the other variables, and I get a bunch of errors like:
>
> dpkg-architecture: warning: Specified GNU system type i486-linux-gnu
> does not match gcc system type x86_64-linux-gnu.
>
> So, is there an extra bit of logic missing there? Or am I simply doing it
> wrong?

        I don't think the logic was designed to handle this situation,
 really, where you are not really cross compiling (you do not have an
 alternate cross compiling tool chain), not do you have a sub arch
 (since _i396.deb and _amd64.deb seem different to dpkg). At this point,
 I would just force the architecture yes, dpkg, we do know better) and
 leave it at that.

        manoj
-- 
Never get into fights with ugly people because they have nothing to
lose.
Manoj Srivastava <srivasta@acm.org> <http://www.golden-gryphon.com/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C




Information forwarded to debian-bugs-dist@lists.debian.org, Manoj Srivastava <srivasta@debian.org>:
Bug#443221; Package kernel-package. (Wed, 11 Nov 2009 14:51:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arthur Marsh <arthur.marsh@internode.on.net>:
Extra info received and forwarded to list. Copy sent to Manoj Srivastava <srivasta@debian.org>. (Wed, 11 Nov 2009 14:51:06 GMT) Full text and rfc822 format available.

Message #48 received at 443221@bugs.debian.org (full text, mbox):

From: Arthur Marsh <arthur.marsh@internode.on.net>
To: Debian Bug Tracking System <443221@bugs.debian.org>
Subject: Re: Creates packages for wrong arch when cross-compiling for i386 on amd64
Date: Thu, 12 Nov 2009 01:11:30 +1030
Package: kernel-package
Version: 12.025
Severity: normal


I forgot my previous way of compiling on AMD64 for i386 but the following
appears to work:

CONCURRENCY_LEVEL=32 DEB_HOST_ARCH=i386 MAKEFLAGS="CC=gcc-4.4" \ 
make-kpkg --initrd --config menuconfig --arch i386 \
 --cross-compile - linux-image

all of "DEB_HOST_ARCH=i386", "--arch i386" and "--cross-compile -" 
appear to be necessary.

If this isn't the "proper" way to use make-kpkg to create an i386 
kernel image on an amd64, please let me know what is the proper way.

Arthur.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages kernel-package depends on:
ii  binutils                      2.20-3     The GNU assembler, linker and bina
ii  build-essential               11.4       Informational list of build-essent
ii  debianutils                   3.2.1      Miscellaneous utilities specific t
ii  file                          5.03-3     Determines file type using "magic"
ii  gettext                       0.17-8     GNU Internationalization utilities
ii  make                          3.81-7     An utility for Directing compilati
ii  module-init-tools             3.11-1     tools for managing Linux kernel mo
ii  po-debconf                    1.0.16     tool for managing templates file t
ii  util-linux                    2.16.1-4   Miscellaneous system utilities

Versions of packages kernel-package recommends:
ii  cpio                          2.10-1     GNU cpio -- a program to manage ar

Versions of packages kernel-package suggests:
ii  bzip2                     1.0.5-3        high-quality block-sorting file co
pn  docbook-utils             <none>         (no description available)
ii  e2fsprogs                 1.41.9-1       ext2/ext3/ext4 file system utiliti
ii  initramfs-tools [linux-in 0.93.4         tools for generating an initramfs
pn  libdb3-dev                <none>         (no description available)
ii  libncurses5-dev [libncurs 5.7+20090803-2 developer's libraries and docs for
ii  linux-source-2.6.31 [linu 2.6.31-1       Linux kernel source for version 2.
pn  xmlto                     <none>         (no description available)

-- debconf-show failed




Message #49 received at 443221-done@bugs.debian.org (full text, mbox):

From: Manoj Srivastava <srivasta@acm.org>
To: Arthur Marsh <arthur.marsh@internode.on.net>
Cc: 443221-done@bugs.debian.org
Subject: Re: Bug#443221: Creates packages for wrong arch when cross-compiling for i386 on amd64
Date: Thu, 12 Nov 2009 00:02:58 -0600
On Wed, Nov 11 2009, Arthur Marsh wrote:

> CONCURRENCY_LEVEL=32 DEB_HOST_ARCH=i386 MAKEFLAGS="CC=gcc-4.4" \ 
> make-kpkg --initrd --config menuconfig --arch i386 \
>  --cross-compile - linux-image
>
> all of "DEB_HOST_ARCH=i386", "--arch i386" and "--cross-compile -" 
> appear to be necessary.
>
> If this isn't the "proper" way to use make-kpkg to create an i386 
> kernel image on an amd64, please let me know what is the proper way.

        Yes, that seems about right. BTW, I do not see a bug in the
 package; you could just have asked me or on  debian-user.

        manoj
-- 
Do YOU have redeeming social value?
Manoj Srivastava <srivasta@acm.org> <http://www.golden-gryphon.com/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C




Message #50 received at 443221-done@bugs.debian.org (full text, mbox):

From: Arthur Marsh <arthur.marsh@internode.on.net>
To: Manoj Srivastava <srivasta@acm.org>
Cc: 443221-done@bugs.debian.org
Subject: Re: Bug#443221: Creates packages for wrong arch when cross-compiling for i386 on amd64
Date: Thu, 12 Nov 2009 21:28:29 +1030

Manoj Srivastava wrote, on 12/11/09 16:32:
> On Wed, Nov 11 2009, Arthur Marsh wrote:
> 
>> CONCURRENCY_LEVEL=32 DEB_HOST_ARCH=i386 MAKEFLAGS="CC=gcc-4.4" \ 
>> make-kpkg --initrd --config menuconfig --arch i386 \
>>  --cross-compile - linux-image
>>
>> all of "DEB_HOST_ARCH=i386", "--arch i386" and "--cross-compile -" 
>> appear to be necessary.
>>
>> If this isn't the "proper" way to use make-kpkg to create an i386 
>> kernel image on an amd64, please let me know what is the proper way.
> 
>         Yes, that seems about right. BTW, I do not see a bug in the
>  package; you could just have asked me or on  debian-user.
> 
>         manoj

Thanks, yes, it is not a bug in the package itself.

It would however be good to document explicitly how to build for i386 on 
amd64 with make-kpkg. It took me a while to figure it out.

Regards,

Arthur.




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 16 Dec 2009 07:29:06 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 13:40:24 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.