It occurred to me that building a kernel for an older Pentium 4 machine would be much faster on a three-core AMD Phenom than on the original P4 as long as I can get it to cross compile. I found that with the following command line:
make-kpkg --revision 1 --us --uc --rootcmd fakeroot --cross-compile - --arch=i386 --initrd --append-to-version=-scenic --config gconfig kernel_image
make-kpkg appears to run 'make config' with defaults for the target i386 architecture and when it moves on to the build step is invoving gcc with options telling it to generate i386 code.
The fly in the ointment is that at the end it then wraps the kernel up into a package whose architecture as declared in the filename and in the control file as AMD64. When looking inside the package though all the modules are ELF32 as I would expect for i386.
I have checked the man enty for make-kpkg but didn't find any other clue as to how I get make-kpkg to feed through whatever options are required to get the final package the correct type for the architecture it was actually build for. Any ideas?
TiA, Steve.
On Tue, Dec 01, 2009 at 11:16:30AM +0000, Steve Fosdick wrote:
It occurred to me that building a kernel for an older Pentium 4 machine would be much faster on a three-core AMD Phenom than on the original P4 as long as I can get it to cross compile. I found that with the following command line:
make-kpkg --revision 1 --us --uc --rootcmd fakeroot --cross-compile - --arch=i386 --initrd --append-to-version=-scenic --config gconfig kernel_image
make-kpkg appears to run 'make config' with defaults for the target i386 architecture and when it moves on to the build step is invoving gcc with options telling it to generate i386 code.
The fly in the ointment is that at the end it then wraps the kernel up into a package whose architecture as declared in the filename and in the control file as AMD64. When looking inside the package though all the modules are ELF32 as I would expect for i386.
I have checked the man enty for make-kpkg but didn't find any other clue as to how I get make-kpkg to feed through whatever options are required to get the final package the correct type for the architecture it was actually build for. Any ideas?
DEB_HOST_ARCH=i386 make-kpkg --revision 1 --us --uc --rootcmd fakeroot --cross-compile - --arch=i386 --initrd --append-to-version=-scenic --config gconfig kernel_image
should do the trick, IIRC.
J.
On Tue, 2009-12-01 at 11:24 +0000, Jonathan McDowell wrote:
DEB_HOST_ARCH=i386 make-kpkg --revision 1 --us --uc --rootcmd fakeroot --cross-compile - --arch=i386 --initrd --append-to-version=-scenic --config gconfig kernel_image
should do the trick, IIRC.
Thanks, Jonathan - that does work.
[ For anyone who didn't get the original the task is to compile a Debian i386 kernel package for a P4 machine using GCC on a 64 bit machine running Debian. ]
Steve.