On Friday 24 February 2006 06:56, Bo Andresen <[EMAIL PROTECTED]> wrote about 'Re: [gentoo-user] chroot: cannot run command `bin/bash': Exec format error [SOLVED]': > Actually I guess I could just download the the amd64 livecd, mount it, > copy its kernel to the harddrive (already did emerge coldplug) and boot > on it. I did, however, find this very interesting so I do wish to > compile a 64-bit kernel and see what it takes.
Well, when you are already running a 64-bit kernel and have a native gcc, you won't have to use the ARCH and CROSS_COMPILE magic. It just works. The whole process was also enlightening to me. I've never cross-compiled a kernel, but now I know how to have my dual-Opteron box compile the kernel for my Linksys router or my friend's hppa box. > > make ARCH=x86_64 CROSS_COMPILE=x86_64-pc-linux-gnu- > > (menuconfig, all, modules_install, etc.) > > At first when typing make ARCH=x86_64 CROSS_COMPILE=x86_64-pc-linux-gnu- > it told me it could not find these files: > > arch/x86_64/kernel/asm-offsets.c:12:21: asm/pda.h: No such file or > directory arch/x86_64/kernel/asm-offsets.c:16:22: asm/ia32.h: No such > file or directory [...] > make[1]: *** [arch/x86_64/kernel/asm-offsets.s] Error 1 > make: *** [prepare0] Error 2 > > # ls -ld include/asm > lrwxrwxrwx 1 root root 10 Feb 24 14:27 include/asm -> asm-386 > > I solved this by: > # ln -sfn include/asm-x86_64 include/asm I think this could also be solved with a 'make mrproper'. > make install didn't work either Weird. > This all did solve the problems. The resulting kernel does indeed boot > and it does make it possible to chroot into a 64 bit environment. :D > Thanks a lot. This has been very educating. Very good! I'm glad we solved your problem. -- Boyd Stephen Smith Jr. [EMAIL PROTECTED] ICQ: 514984 YM/AIM: DaTwinkDaddy -- gentoo-user@gentoo.org mailing list