Kernel Building

From Low cost, low power, android ARM system board by Mini-Box.com - pico WiKi
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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:
   git clone git://gitorious.org/picopc-kernel/kernel.git

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)

Important:

   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 [1]