Compiling the Linux Kernel 2.6.32.2

This article illustrates how to compile the Linux Kernel 2.6.32.2 actually delivered by default on the bootable microSD card for the FOX Board G20.

Originally written by Lee McLoughlin

Requirements

  • a PC with Linux installed. On this article we used an Ubuntu 9.10 “Karmic Koala”
  • a micrSD card. We used a 2G card.
  • a FOX Board G20
  • a Debug Port Interface

Install the ARM cross compiler

Download the source tree

On your Linux PC move to your home directory and download the standard kernel source tree from Internet typing:

$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.2.tar.bz2
$ tar -xvjf linux-2.6.32.2.tar.bz2

Applying the patches for the FOX Board G20

Although a recent unpatched kernel will work on your Netus it will not be able to access all the hardware. Nor is it simple to cross compile and generate the correct bootable kernel image. To overcome these issues download extract these patches to your new linux source directory and apply them: linux-2.6.32.2-foxg20-patches-v5.txt

$ cd linux-2.6.32.2
$ patch -p1 < linux-2.6.32.2-foxg20-patches-v5.txt

When newer kernels become available these may or may not work with these patches. Unless you need features of these kernels continue to use this kernel.

Configuring your Kernel

If you are building a kernel with just the minimal features (perhaps for a specialist hardward project) I recommend you start with netus.config-2.6.32.2-SIMPLE and add to it as required as this will avoid the time required to build unused modules:

$ cp foxg20.config-2.6.32.2-SIMPLE.txt .config

If you are building a full featured system (like a desktop system) and you want access to a wide range of kernel modules start with foxg20.config-2.6.32.2-COMPLEX-v3.

$ cp foxg20.config-2.6.32.2-COMPLEX-v3 .config

These two files become available appling the patch linux-2.6.32.2-foxg20-patches-v5.txt as described before.

Whichever config you choose you must now configure it:

$ make menuconfig

Building Your Kernel

Once you are happy with your kernel configuration you can build a new kernel with:

$ make

When finished you will find a new uImage file containing the kernel image and the file foxg20-script.bin containing the boot parameters in binary format. This two files have to be copied on the first FAT16 partition of your microSD card as described next. If you need to create your own foxg20-script.bin file read this article: Create foxg20-script.bin u-Boot environment file.

If you require to compile the Kernel modules type also:

$ make modules
$ make modules_install

Note that modules are not installed but rather all copied to the ./FoxModules sub-directory. If you don't want old modules you've build before then instead of that last line do:

$ rm -rf ./FoxModules
$ make modules_install

Copy the new Kernel image on the bootable microSD

You can install your new Kernel image in two ways:

Method 1

With this method you can update the Kernel image directly to a FOX Board G20 while is running Read how to...

Method 2

With this method you will copy the files on a microSD using a microSD USB adapter on your PC:

  • Insert the FOX microSD card on your Linux PC
  • once /media/kernel folder appear rename the uImage file in uimage (all in lower case) and copy it on this folder
  • copy the foxg20-script.bin on the same folder (/media/kernel)
  • copy your module tree from FoxModules/lib to /media/rootfs/lib
  • unmount /media/kernel and /media/rootfs
  • transfer the microSD card back to your FOX Board G20
  • start your FOX Board G20 to see your new kernel in action!
  • don't forget to type the command depmod on the FOXG20 command line to build the modules dependencies files.
 
tutorial/compiling_the_linux_kernel.txt · Last modified: 2010/04/22 13:27 by tanzox
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki