Kernel Building

From Low cost, low power, android ARM system board by Mini-Box.com - pico WiKi
(Difference between revisions)
Jump to: navigation, search
(How to compile a new kernel for pico-SAM9G45)
Line 1: Line 1:
 
==How to compile a new kernel for [http://www.mini-box.com/pico-SAM9G45-X pico-SAM9G45]==
 
==How to compile a new kernel for [http://www.mini-box.com/pico-SAM9G45-X pico-SAM9G45]==
  
* Obtain and install a toolchain for ARM. A simple toolchain can be obtained from [http://gitorious.org/picopc-kernel/toolchain/trees/master toolchain repository] or directly with: ''git clone git://gitorious.org/picopc-kernel/toolchain.git''.<br>
+
* Obtain and install a toolchain for ARM. A simple toolchain can be installed following instruction on this [http://arm.mini-box.com/index.php?title=Installing_Toolchain page]. <br>
Other toolchains like Codesourcery and Android toolchain can be used.
+
Other toolchains like [https://sourcery.mentor.com/sgpp/lite/arm/portal/release858 Codesourcery] can be used.
  
 
* Obtain the kernel sources for pico-SAM9G45 by using:  
 
* Obtain the kernel sources for pico-SAM9G45 by using:  
 
     git clone git://gitorious.org/picopc-kernel/kernel.git
 
     git clone git://gitorious.org/picopc-kernel/kernel.git
  
and checkout the  branch that you with to use:
+
and checkout the  branch that you with to use with:
 +
    git checkout ''<branchname>''
  
    git checkout minibox-picopc-3.1
+
Replace ''<branchname>'' with:
    or
+
* minibox-picopc-3.1 - kernel version 3.1 no Android patches
    git checkout minibox-picopc-2.6.32
+
* 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
If you want to build a kernel for Android use:
+
* minibox-picopc-2.6.32-gingerbread - kernel version 2.6.32 with Android patches
 
+
    git checkout minibox-picopc-android-3.1
+
    or
+
    git checkout minibox-picopc-2.6.32-gingerbread
+
 
      
 
      
  
'''Note'''
+
'''Important:'''
 
     If you are using the 2.6.x kernel branch make sure you checkout the picopc-bootstrap-2.6 branch from [http://arm.mini-box.com/index.php?title=Bootstrap picopc-bootstrap]
 
     If you are using the 2.6.x kernel branch make sure you checkout the picopc-bootstrap-2.6 branch from [http://arm.mini-box.com/index.php?title=Bootstrap picopc-bootstrap]
  
* You will need a basic configuration for pico-SAM9G45 kernel. For this copy the ''picopc_defconfig'' or ''picosam9g45_defconfig'' from arch/arm/configs to ''.config'' in the root of kernel source (same location with the compile.sh script)
+
* 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.
  
* Edit the ''compile.sh'' script from the source tree and modify ''CROSS_COMPILE= ''variable to point to the location where you installed the toolchain from the first step.
+
* 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)'''
  
* Now you can run ''./compile.sh menuconfig '' from the source directory to get the configure menu or ''./compile.sh uImage'' to get a  
+
== Commands to produce a kernel image for Android: ==
kernel image usable for pico-SAM9G45.<br>
+
'''The image will be generated in ''arch/arm/boot/uImage''.'''<br>
+
'''This image when copied as ''linux.bin'' will be booted by the bootstrap (BOOT.BIN)'''
+
  
== Enough bla-bla just tell me what to type: ==
+
mkdir ~/picosam9
<pre style="font-size:medium">
+
cd ~/picosam9
mkdir ~/picokernel
+
cd ~/picokernel
+
 
git clone git://gitorious.org/picopc-kernel/toolchain.git
 
git clone git://gitorious.org/picopc-kernel/toolchain.git
 
git clone git://gitorious.org/picopc-kernel/kernel.git
 
git clone git://gitorious.org/picopc-kernel/kernel.git

Revision as of 09:06, 23 February 2012

How to compile a new kernel for pico-SAM9G45

Other toolchains like Codesourcery can be used.

   git clone git://gitorious.org/picopc-kernel/kernel.git

and checkout the branch that you with to use with:

   git checkout <branchname>

Replace <branchname> with:


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 git checkout minibox-picopc-2.6.32-gingerbread cp arch/arm/configs/picopc_defconfig .config echo "make ARCH=arm CROSS_COMPILE=~/picokernel/toolchain/bin/arm-eabi- $1" > compile.sh ./compile.sh menuconfig && ./compile.sh uImage ls -l arch/arm/boot/uImage </pre>

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]

Personal tools
Namespaces
Variants
Actions
Toolbox