http://mark.ossdl.de/2009/09/cross-compiling-for-the-sheevaplug-kernel-distcc/cross-compiling for the SheevaPlug (kernel, distcc)
Compiling on the SheevaPlug can take long but is not neccessary if you have already your desktop pc running (which will be referred to as “workstation”). Unfortunately it will most probably not being run by an ARM processor, therefore you have cross-compile for the plug. In this post I describe how to install a recent GCC version for cross-compiling, how to compile the latest kernel for the plug and how to enable distributed cross-compiling. By the latter you invoke compiling commands on the SheevaPlug and they will be executed by another machine transparently. My workstation runs Gentoo Linux and listens on 192.168.1.6; the SheevaPlug runs Gentoo, too. By command emerge packages are installed, therefore if you used Debian you have to replace that call by apt-get and find out appropriate package names. Install crossdev and setup a cross-compiling suite
for the 1. emerge portage-utils crossdev dev-embedded/u-boot-tools 2. crossdev armv5tel-softfloat-linux-gnueabi This will take long as the latest GCC, binutils and the such will be compiled from scratch for the SheevaPlug.
The kernel should be compiled by now. Therefore log into your SheevaPlug and copy kernel and modules to it: 1. scp 192.168.1.6://usr/src/linux-2.6.31-gentoo/arch/arm/boot/uImage
/boot/uImage-2.6.31-gentoo-mark 2. rsync -azuv -e ssh 192.168.1.6://usr/src/lib/modules
/lib/ 3. cat /boot/uImage-2.6.31-gentoo-mark
& gt ;
/dev/mtdblock1 The latter command will write the new kernel into the plug’s flash. You could leave that command out and have the kernel loaded from SD card or external USB drive, but it supports more USB devices (such as hubs) than your plug’s booting system. Consequently loading it from flash means less trouble in future. Reboot your plug, smile. Cross-compiling has not been that hard. For your convenience, here’s my compiled kernel and modules for download. It includes iptables and samba support. Setting up distributed cross-compiling is even easier. Do this on your workstation: 1. emerge distcc 2. nano /etc/conf.d/distccd 3. # add allow=192.168.1.0/24 4. nano /etc/distcc/hosts 5. # add localhost, don't add the sheevaplug! no work
shall be distributed to it 6. /etc/init.d/distccd start 7. rc-update add distccd default That’s all for the workstation. We will make sure armv5tel-softfloat-linux-gnueabi-gcc and the such will be selected automatically.
Voila! Compiling will happen at your workstation, even if
you invoked emerge on the plug. 4 Comments so far |
- [linuxkernelnewbies] Mark’s Blog » cross-compilin g for the She... Peter Teoh
That’s how you can do distributed cross-compiling for any other architectures.
Just crossdev something other replace
armv5tel-softfloat-linux-gnueabi
appropriately on the target.The workstation can run many cross-compiling suites.
[...] Setup a cross-compiling suite for the SheevaPlug. You can compile the Linux kernel parallel to installing GNU/Gentoo. [...]
please add a note to apply this patch to the kernel:
http://computingplugs.com/index.php/Fixing_SDHC_access_in_the_Orion/Mainline_kernel
because there is a bug in the sdhc handling that make it brutally crash!
Thanks for the pointer! I have already had incorporated that patch in my kernel trees, amongst others for SDHC cards.