mycroes

There's always time to play

Sunday, January 4, 2009

Configuring a linux kernel for another architecture than host

On my 64 bit gentoo installation I wanted to compile a kernel for 32 bit machines (specifically my eee pc 701), but somehow menuconfig was as smart to notice I was running a 64 bit machine and so showed me stuff to build a 64 bit kernel. After a quick search I found the solution:
make ARCH=i386 (oldconfig|menuconfig|)

4 comments:

Anonymous said...

Nice tip!

To compile only the modules in a subdirectory run something like this:
$ make SUBDIRS=drivers/net/ modules

Michael Croes said...

That's nice too, thank you!

bukaka said...

$ sudo linux32 chroot ........

Michael Croes said...

@Dmitry
Yes and no... You don't always want to have a 32bit chroot or 32 bit compatibility (although most desktop users probably do).

Besides being able to do a 32 bit chroot, it might be possible you want to compile a kernel for a (very) different architecture, in which case a 32 bit chroot won't help much.

Last but not least there's no reason to run your kernel compilation/configuring process in a 32 bit userland.