Howto compile Openmoko kernel for Neo Freerunner

From Openmoko

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 +
{{Languages|Howto compile Openmoko kernel for Neo Freerunner}}
 
<strong>Note: This is a translation of a [http://www.jollen.org/blog/2009/02/compile_neo_freerunner_kernel.html blog post] in Chinese. It might contain errors introduced in the translation.
 
<strong>Note: This is a translation of a [http://www.jollen.org/blog/2009/02/compile_neo_freerunner_kernel.html blog post] in Chinese. It might contain errors introduced in the translation.
 
</strong>
 
</strong>

Revision as of 09:25, 23 February 2009

Note: This is a translation of a blog post in Chinese. It might contain errors introduced in the translation.

See also : Building Openmoko Kernel from git repo using Toolchain

How does one compile Openmoko's kernel for the Neo Freerunner? Just follow the steps outlined below.

Contents

Get the Neo Freerunner's kernel source code

All source code of the Openmoko project is kept at git.openmoko.org. Under the kernel source code directory you can find both the complete kernel and the branch under development. First issue the following command, which will retreive all the kernel source code.

$ git clone git://git.openmoko.org/git/kernel.git linux-2.6

The source code is all put in the linux-2.6/ directory.

Get Andy's branch

Andy is Openmoko's kernel developer. We want to use the development version, so we need to get Andy's branch. Openmoko's kernel developer can at any time add new code to the development version. Openmoko's kernel can also merge with the mainline kernel. [Translator note: I'm note sure if he means that Openmoko will follow changes in mainline, or that mainline will incorporate Openmoko's patches. (Openmoko 的 kernel 也會與 mainline 的 kernel 做合併(patch merge)的動作)] Get Andy's branch with the following commands:

$ cd linux-2.6
$ git checkout origin/andy-tracking

Get the GTA02 kernel configuration file

Openmoko provides kernel configuration files for GTA01/GTA02/GTA03. Simply using the GTA02 (Neo Freerunner) configuration file will do. You don't need to configure the kernel options yourself.

$ cp arch/arm/configs/gta02_moredrivers_defconfig .config

Get the Openmoko toolchain

To compile the kernel you'll need the 'cross toolchain'. Openmoko provides a ARM9 toolchain that's set up in advance. Pleaes download it from [1]. Download the 20080916 version, for example openmoko-i686-20080916-arm-linux-gnueabi-toolchain.tar.bz2 .

To install the toolchain, go to the root directory and uncompress the package.

$ cd /
$ sudo tar jxf /openmoko-i686-20080916-arm-linux-gnueabi-toolchain.tar.bz2

After unpacking, you will find the toolchain in /usr/local/openmoko .

Download build-kernel.sh/build-image.sh/mkimage

From [2] download the two scripts as well as mkimage tool. Place them in the kernel source directory. Don't forget to make them executable.

$ chmod a+x build-*.sh

Additionally, after setting the executable bit on mkimage, move it to the system's standard location.

$ chmod a+x mkimage
$ sudo mv mkimage /usr/sbin

Neo Freerunner uses the U-boot boot loader, so we have to use mkimage to pack the kernel image in the U-boot format. The source code of this tool can be found in the U-boot sources.

Start compiling the kernel

First isue build-kernel.sh to compile the kernel:

$ ./build-kernel.sh

After the compile finishes, run build-image.sh to produce the final image:

$ ./build-image.sh

When it finishes you can find the file 'uImage-GTA02.bin' in the kernel source directory. This is a kernel image that supports the Neo Freerunner. All that's left to do is flash it to your Neo using dfu-util.

If you have any questions about the above instructions you can pose your questions at the Traditional Chinese Openmoko Site.

Personal tools

Note: This is a translation of a blog post in Chinese. It might contain errors introduced in the translation.

See also : Building Openmoko Kernel from git repo using Toolchain

How does one compile Openmoko's kernel for the Neo Freerunner? Just follow the steps outlined below.

Get the Neo Freerunner's kernel source code

All source code of the Openmoko project is kept at git.openmoko.org. Under the kernel source code directory you can find both the complete kernel and the branch under development. First issue the following command, which will retreive all the kernel source code.

$ git clone git://git.openmoko.org/git/kernel.git linux-2.6

The source code is all put in the linux-2.6/ directory.

Get Andy's branch

Andy is Openmoko's kernel developer. We want to use the development version, so we need to get Andy's branch. Openmoko's kernel developer can at any time add new code to the development version. Openmoko's kernel can also merge with the mainline kernel. [Translator note: I'm note sure if he means that Openmoko will follow changes in mainline, or that mainline will incorporate Openmoko's patches. (Openmoko 的 kernel 也會與 mainline 的 kernel 做合併(patch merge)的動作)] Get Andy's branch with the following commands:

$ cd linux-2.6
$ git checkout origin/andy-tracking

Get the GTA02 kernel configuration file

Openmoko provides kernel configuration files for GTA01/GTA02/GTA03. Simply using the GTA02 (Neo Freerunner) configuration file will do. You don't need to configure the kernel options yourself.

$ cp arch/arm/configs/gta02_moredrivers_defconfig .config

Get the Openmoko toolchain

To compile the kernel you'll need the 'cross toolchain'. Openmoko provides a ARM9 toolchain that's set up in advance. Pleaes download it from [1]. Download the 20080916 version, for example openmoko-i686-20080916-arm-linux-gnueabi-toolchain.tar.bz2 .

To install the toolchain, go to the root directory and uncompress the package.

$ cd /
$ sudo tar jxf /openmoko-i686-20080916-arm-linux-gnueabi-toolchain.tar.bz2

After unpacking, you will find the toolchain in /usr/local/openmoko .

Download build-kernel.sh/build-image.sh/mkimage

From [2] download the two scripts as well as mkimage tool. Place them in the kernel source directory. Don't forget to make them executable.

$ chmod a+x build-*.sh

Additionally, after setting the executable bit on mkimage, move it to the system's standard location.

$ chmod a+x mkimage
$ sudo mv mkimage /usr/sbin

Neo Freerunner uses the U-boot boot loader, so we have to use mkimage to pack the kernel image in the U-boot format. The source code of this tool can be found in the U-boot sources.

Start compiling the kernel

First isue build-kernel.sh to compile the kernel:

$ ./build-kernel.sh

After the compile finishes, run build-image.sh to produce the final image:

$ ./build-image.sh

When it finishes you can find the file 'uImage-GTA02.bin' in the kernel source directory. This is a kernel image that supports the Neo Freerunner. All that's left to do is flash it to your Neo using dfu-util.

If you have any questions about the above instructions you can pose your questions at the Traditional Chinese Openmoko Site.