Some days ago I wanted to test the performance of a partition with XFS as its filesystem. But I wasn’t able to mount it. After a look into the kernelconfig of gorgone’s heavykernel I noticed that he obviously didn’t build it with XFS-support.
I do want to make the test and take a look at kernelbuilding things anyway. Well, I don’t want to keep it back, so I decided to verbalize the steps I took. In this guide you will learn how to set up the crosscompile toolchain to let a more powerful CPU do the job. If you prefer doing the whole thing on the dockstar it will take you several hours. Further more we will go through the build process until we have a deb-file with the built kernel.
1. The CodeSourcery’s Toolchain
There already is a great HowTo how to set this up here: http://general.nas-central.org I stripped it a bit as follows. If you have debian running on the machine you want to use for the build process download and run this script to install the toolchain:
wget http://dev.shyd.de/dockstar/setup_codesourcery.sh chmod +x setup_codesourcery.sh ./setup_codesourcery.sh
Just to know, you don’t have to type this now: When you want to enter the toolchain, type
To get back to the normal environment just exit:
2. The Kernel
2.1 Get the Sources
First of all you have to decide which kernel you want to compile, take a look at http://kernel.org and download the sources. For example 2.6.37:
cd /usr/src wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.37.tar.bz2 tar xjvf linux-2.6.37.tar.bz2 cd linux-2.6.37
2.2 Edit the Configuration
If you already have a proper
.config just copy it into the current folder. Then run
# Accept default options for any new kernel configs yes "" | make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- oldconfig
Then make your changes in the new
.config. It is that long that I prefer doing this with WinSCP or any other remote editor than using vim. In newer kernel there is no need to add a special patch for the dockstar LED. Once you are done run:
# Add new config make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- oldconfig # enter the toolchain codesourcery-arm-2009q3.sh # run the final build process # you may want to edit --append-to-version and --revision # try out the effects :) make-kpkg --rootcmd fakeroot --arch armel --cross-compile arm-none-linux-gnueabi- --append-to-version=-dockstar --revision=1.1 --initrd kernel_image
Lean back, this is going to take some time.
2.3 Install the new Kernel
If everything works fine, you should have a deb-file in
/usr/src. Copy this to your dockstar and install it.
I don’t have to say that you should backup your data first. 😴 Change the names to your compiled kernel:
dpkg -i linux-image-2.6.37-dockstar_1.1_armel.deb cd /boot # Create the images for uBoot /usr/bin/mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-2.6.37 -d /boot/vmlinuz-2.6.37-dockstar /boot/uImage /usr/bin/mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs -d /boot/initrd.img-2.6.37-dockstar /boot/uInitrd
To tell the kernel your device is a dockstar, change its machine ID in case you haven’t done before:
# view current ID fw_printenv arcNumber # set to dockstar's ID fw_setenv arcNumber 2998
But remember to change it back to 2097 (sheevaplug’s ID) if you downgrade to a kernel that doesn’t support the dockstar.
If you didn’t edit the files for LED support, do it:
echo default-on > /sys/class/leds/dockstar\:green\:health/trigger echo none > /sys/class/leds/dockstar\:orange\:misc/trigger
log_action_msg "Will now halt" halt -d -f $netdown $poweroff $hddown
echo none > /sys/class/leds/dockstar\:green\:health/trigger
to set it off, when the system halts.
Now reboot and prey that everything works flawlessly.