Linaro kernel compilation

Hi everyone,

The linaro team is doing an incredible job at grouping linux kernel fixes and board support package. It enables developers to create/use/modify linux based distributions and target several boards at once. The main drawback I can see is that the documentation provided on the wikis are not kept up to date, and I feel like the compilation processes change all the time.

I started embedded systems with android images, and once I moved to ubuntu nano images, I felt like I didn’t have to do much more than what I already knew. This was last year, and I now wnat to use the newer linaro releases (12.10 for instance). I tried to use the few lines I had with the pandaboard and I ended up with kernel panics and a unbootable system.

I dug a little deeper and realised that the cross compilation tools changed from arm-gnueabi to arm-gnueabihf, so using this tool I tried again with no luck. Then I tried to switch the kernel version. I was using the linux*linaro-tracking git repository available at;a=summary

Again no luck. The 3.6.1+ kernel did not want to live along side the 12.10 linaro release. So I tried with the kernel version that was shipped with the packed image ( Its kernel version was 3.4.1+ if i remember correctly. So I checked out the git branch named linux-linaro-tracking-3.4-2012.10 and tried once more to build the image, dumped it to the sd card and it just worked… nice!

Before doing this, I just copied the config file located at /boot/ on the file system to get a known working config, and then used menuconfig to update it to match the kernel changes if any.

Here are the few lines I use

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules

cp arch/arm/boot/uImage /media/boot
sudo cp .config /media/rootfs/boot/config-3.4.14+
sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=/media/rootfs 
sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- firmware_install INSTALL_FW_PATH=/media/rootfs/lib/firmware
sudo sync
umount /media/rootfs
umount /media/boot

Then boot the board and do

rm /boot/*<older_kernel_version>*

rm -r /boot/dt-<older_kernel_version>-linaro-omap/
rm -r /lib/modules/<older_kernel_version>-linaro-omap/
depmod -a
update-initramfs -c -k `uname -r`
mount /dev/mmcblk0p1 /mnt
cp /mnt/uInitrd /mnt/uInitrd-bak
mkimage -A arm -T ramdisk -C none -n "RAMDISK" -d /boot/initrd.img-`uname -r` /mnt/uInitrd

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s