RSS

How to Cross Compile Linux Kernel

19 Dec

First of all install the n-curses library which is prerequisite for displaying menuconfig.

$ sudo apt-get install libncurses5-dev

Download linux kernel “linux-3.7.1” the latest stable release up to date.

Extract the file.

Go into the folder.

$ cd /home/egenc/Workspace/linux-3.7.1

Configure it for versatile board.

$ make ARCH=arm CROSS_COMPILE=arm-linux- versatile_defconfig

Since I’m using ELDK 4.2 cross toolchain my cross compiler is arm-linux-gcc. If you are using a different toolchain such as that CodeSourcery you will make use of arm-none-linux-gcc cross compiler. Don’t forget to set your PATH variable. You can see a more detailed definition from this link.

Let’s make some changes in our configuration.

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

Highlight “Enable loadable module support —>” and disable it by pressing “N”

Then

Kernel Features —> Graphics support —> Bootup Logo. Enable it by pressing “Y”

Now whenever we boot this kernel on QEMU we can see our little friend TUX.

Tux

Tux

Now exit the menu by pressing “ESC” twice and save the new configuration.

I recommend you to take a backup of the new configuration. You may want to load this configuration later again.

$ cp .config .config_backup

Start compiling the kernel source.

$ make ARCH=arm CROSS_COMPILE=arm-linux- 

When the process is completed you can find the compiled kernel file in “arch/arm/boot/zImage”

 
Leave a comment

Posted by on December 19, 2012 in Linux

 

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

 
%d bloggers like this: