Kernel hacking - linux-2.6
Please notice that the development is still in an early state. You should know what you are doing, if you test this.
We are using topgit to manage our patches in a git tree. Please make sure you have it installed before starting development.
The preferred toolchain for building the kernel is the openembedded toolchain (see Crosscompile). However, it is still recommended that the kernel be built by hand (see instructions below) rather than using bitbake.
Building OpenEZX kernel
- Get the kernel sources:
git clone git://git.openezx.org/openezx.git
- Make the repo topgit aware
cd openezx tg remote --populate origin
- Checkout our development branch:
git checkout ezx/current
- Use the ezx_defconfig for the first build:
cp arch/arm/configs/ezx_defconfig .config make ARCH=arm oldconfig
- Build the kernel:
make ARCH=arm CROSS_COMPILE=/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi- zImage
- Update your tree later:
git checkout master && git pull && tg remote --populate origin && git checkout ezx/current && tg update
- Build the modules (optional):
make ARCH=arm CROSS_COMPILE=/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi- modules
- So we can install them:
...or like here, we will only make an archive from their folder, for installing them on any root filesystem later :
mkdir /tmp/modules-of-the-day make ARCH=arm CROSS_COMPILE=/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi- INSTALL_MOD_PATH=/tmp/modules-of-the-day modules_install tar -C /tmp/modules-of-the-day -c . | bzip2 > modules-of-the-day.tar.bz2 # (you need to be root or sudoing on some commands, or for installing them later, as you will need to untar them on the root folder on the target rootfs)
Building OpenEZX kernel with openembedded
- one of git snapshot of openezx kernel is used in OE.
- Setup OE according to http://wiki.openembedded.net/index.php/Getting_Started
- Use MACHINE=a780 and DISTRO=angstrom-2008.1 in local.conf
- Run $ bitbake virtual/kernel
- The last command will fail if you have "." in your PATH
- if you don't have python 2.6 (as debian actually ships 2.5.x), you need to download bitbake 1.8.18 instead of the newer development versions.
This is how i retrieved 1.8.18 from git, as the releases are tagged:
git clone git://git.openembedded.org/bitbake.git cd bitbake git-checkout 1.8.18
Recommended way is running bitbake without installing it.
- the kernel expects the rootfs on the second partition of external flash (root=/dev/mmcblk0p2), with this setup you can use the first partition to store some data and access it when booting the original software (recently also kernels built by OE started to follow this convention).
- by default this second partition must be ext2 fs.
You can use the zImage together with boot_usb to boot the phone with this kernel.