Compiling uClinux with kernel linux-2.6.21

Hello everybody!

Today I’ll show you what I did to compile the kernel.. First of all I’m assuming that you
have already installed build-essentials and mtd-tools packages.
Now let’s begin the hard work! =D

1) Download all these packages:
– uClinux-dist-20070130.tar.gz
– ea-uClinux-081020.diff.gz
– ea-v3_1_incr1.diff.gz
– linux-2.6.21.tar.gz
– arm-linux-tools-20061213.tar.gz
– mkimage (used to generate uLinux.bin)

2) untar toolchain 1. (It will untar in the same directory where you download it. I add this path to the $PATH)

Note: You can either move this directory to a directory in the PATH or add the path into the $PATH in your /home/user/.bashrc. In this way you don’t have to export everytime you open a new console.

install toolchain 2.

I had a problem when installing this toolchain. If you get an error too, edit this file and try changing:


Copy mkimage to /usr/local/bin and set it as executable

3) untar uClinux and then remove old kernel

4) untar linux-2.6.21 and move it to uClinux-dist

5) apply both patchs

6) Configure & Compile.
a)Choose vendor Embedded Artists and board LPC2468
b)Disable i2c in device drivers > I2C support > <> I2C support

After make, you will get an error. You must include <linux/limits.h>  in the file ./linux-2.6.x/scripts/mod/sumversion.c. Make again and go take a coffe.
The images will be in the folder ./images

It’s weird that we need 2 toolchain… I don’t know why, but arm-linux- is used to compile the kernel (actually the kernel complains that the toolchain arm-elf is too old). It has been forced to, even if you set CROSS_COMPILE=arm-elf-. The rest is compiled with arm-elf-, so, be sure that both toolchain is in the path.

Until today, jffs2 file system can’t be generated following these instructions. I’ll check later! =D

Next post we’ll update u-boot and boot the kernel! Wait and you’ll see! =D
That’s all

Marcelo Jo

Marcelo Jo

Marcelo Jo is an electronics engineer with 10+ years of experience in embedded system, postgraduate in computer networks and masters student in computer vision at Université Laval in Canada. He shares his knowledge in this blog when he is not enjoying his wonderful family – wife and 3 kids. Live couldn’t be better.


One Response to 'Compiling uClinux with kernel linux-2.6.21'

  1. DJ Tulan says:

    I guess the used Toolchains from EA are very old. Newer ucLinux Distributions can be compiled an easier way.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.