Kernel hacking - linux-2.6
From OpenEZX
The OpenEZX kernel tree bases on a vanilla 2.6 kernel. At the moment we use 2.6.21.
We use quilt to handle our -ezx kernel tree. You can find the latest patchset here.
Please notice that the development is still in an early state. You should know what you are doing, if you test this.
[edit]
Building OpenEZX kernel
- Download a vanilla, 2.6.21 kernel from www.kernel.org, untar it.
- Download the Official OpenEZX patchset from here and put all patches inside patches/ on the kernel source folder. The daring or development-bound guys may use a devel patchset located here against the corresponding kernel version instead.
- apply the quilt patchset, by running ´quilt push -a´
- run ´make -f patches/Makefile.OpenEZX CROSS_COMPILE=<path to your toolchain>´ where path means toolchain directory _plus_ architecture-specific prefix of toolchain binaries.
- This will build zImages and modules to all currently supported phones.
Note: You can download a binary toolchain here (for a fast quick start) Or build your own with OE. See the next section. You can also use OE toolchain to build the Official OpenEZX patchset, just pass, the following variable: CROSS_COMPILE=/path_to_OE/build/tmp/cross/bin/arm-angstrom-linux-gnueabi- zImage At least in case of the binary Codesourcery toolchain, you might need to disable CONFIG_BINFMT_AOUT and CONFIG_BINFMT_MISC, since otherwise you might get a SEGMENT_SIZE kernel build error (it seems those two are not really supported on ARM and it's not problematic anyway).
[edit]
Building OpenEZX kernel with openembedded
- Please note that OE uses a different .config, and a patchset which does not necessarily ressemble the Official OpenEZX patchset, Kernels built by OE are supported by OE people, at #oe on freenode or openembedded-devel@lists.openembedded.org. Please, dont ask OpenEZX developers (particularly WyrM) anything if you built your kernel with OE.
- Setup OE according to http://www.openembedded.org/wiki/GettingStarted
* Note: BitBake 1.6.8 or higher is required. FC6 RPM of BitBake is currently version 1.6.6, so it will not work. Recommended way is running it without install. * Use MACHINE=a780 and DISTRO=angstrom-2007.1 in local.conf
- Run $ bitbake virtual/kernel
[edit]
Notes
- The last command will fail if you have "." in your PATH
- 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.
- The STUART console is disabled by default to speed up the booting process. If you want to re-enable it, you have to apply ezx-enable-stuart.patch, and add console=ttyS2,115200n8 to your CONFIG_CMDLINE.
You can use the zImage together with boot_usb to boot the phone with this kernel.

