How to compile a new kernel for pico-SAM9G45
- Obtain and install a toolchain for ARM. A simple toolchain can be installed following instruction on this page.
Other toolchains like Codesourcery can be used.
- Obtain the kernel sources for pico-SAM9G45 by using:
and checkout the branch that you with to use with:
git checkout remotes/origin/<branchname> -b localbranchname
- Replace <branchname> with (a list of branches can be obtained by running git branch -a ):
- minibox-picopc-3.1 - kernel version 3.1 no Android patches
- minibox-picopc-2.6.32 - kernel version 2.6.32 no Android patches
- minibox-picopc-android-3.1 - kernel version 3.1 with Android patches
- minibox-picopc-2.6.32-gingerbread - kernel version 2.6.32 with Android patches
- You will need a basic configuration for pico-SAM9G45 kernel. For this copy the picosam9g45_defconfig from arch/arm/configs to .config in the root of kernel source (same location with the compile.sh script). For 2.6.x kernels copy picopc_defconfig.
- (Optional) Edit the compile.sh script from the source tree and modify CROSS_COMPILE= variable to point to the location where you have your custom toolchain installed. If you are using our toolchain, there is no need to change compile.sh since it points to correct location.
- Now you can run ./compile.sh menuconfig from the source directory to get the configure menu or ./compile.sh uImage to get a kernel image usable for pico-SAM9G45. The image will be generated in arch/arm/boot/uImage and it will be booted by the bootstrap (BOOT.BIN)
If you are using the 2.6.x kernel branch make sure you checkout the picopc-bootstrap-2.6 branch from picopc-bootstrap
Commands to produce a kernel image for Android:
mkdir ~/picosam9 cd ~/picosam9 git clone git://gitorious.org/picopc-kernel/toolchain.git git clone git://gitorious.org/picopc-kernel/kernel.git cd kernel cp arch/arm/configs/picosam9g45-android_defconfig .config ./compile.sh oldconfig && ./compile.sh uImage ls -l arch/arm/boot/uImage
NOTE If you aren't using our toolchain, make sure you have mkimage from u-boot sources installed in your path. Although pico-SAM9G45 bootstrap doesn't use u-boot it expects a kernel in the uImage format. mkimage tool can be compiled from u-boot sources from the tools directory