Kernel: Difference between revisions

From OLPC
Jump to navigation Jump to search
(→‎Building an OLPC kernel: mentioned build prerequisites)
Line 9: Line 9:
* git://dev.laptop.org/olpc-2.6
* git://dev.laptop.org/olpc-2.6
* http://dev.laptop.org/git/olpc-2.6
* http://dev.laptop.org/git/olpc-2.6
* git://dev.laptop.org/olpc-3.0
* http://dev.laptop.org/git/olpc-3.0


Current maintainers: Chris Ball, Daniel Drake, Paul Fox
Current maintainers: Chris Ball, Daniel Drake, Paul Fox
Line 17: Line 19:
! operating system release
! operating system release
! git branches
! git branches
|-
| [[11.3.0]] ARM
| [http://dev.laptop.org/git/olpc-3.0/log/?h=arm-3.0 arm-3.0]
|-
|-
| [[11.1.0]] ARM
| [[11.1.0]] ARM

Revision as of 00:06, 3 August 2011


The OLPC kernel

OLPC OS Releases use our OLPC-modified version of the Linux kernel.

The OLPC kernel is maintained in git:

Current maintainers: Chris Ball, Daniel Drake, Paul Fox

We work on specific git branches for each operating system release.

operating system release git branches
11.3.0 ARM arm-3.0
11.1.0 ARM linux-2.6.39
11.2.0 i386 olpc-2.6.35
10.1.3 i386 olpc-2.6.31

Or looking at git history may identify which branches we are actively working on, and looking at the version of each branch compared to the kernel shipped in each release will help you identify which branch corresponds to which release(s).

OLPC-specific configurations can be found at arch/x86/configs/, these are what we use for automated builds and official releases. This configuration is also installed in /boot in our software releases.

Questions and contributions should be sent to the devel mailing list.

Installing kernel RPMs

Due to OLPC's versioned filesystem layout, installing a new kernel RPM is not enough for it to become active on reboot. This is explained in detail in /boot/README. To summarise, after installing a kernel you must copy it to a special place:

If running a software release that uses partitions:

rsync --delete-before -av /boot/ /bootpart/boot/

If running a software release that does not use partitions:

cp -a /boot/* /versions/boot/current/boot/

Building an OLPC kernel

  1. Install build prerequisites: unifdef, lzop, dracut-modules-olpc (be careful with this last one.)
  2. Check out the kernel from git
  3. Switch to the appropriate branch
  4. Make your changes (updating the configs under arch/x86/configs/ if changes are needed)
  5. Commit all your changes
  6. Run make clean distclean
  7. Run make xo_1-kernel-rpm for XO-1, or make xo_1_5-kernel-rpm for XO-1.5.

RPM files will be output which you can install on an XO (with the above versioned filesystem layout issues in mind).

Automatic RPM generation

Some branches are automatically built every 30 minutes (but only when there are new changes), the results are published at http://dev.laptop.org/~kernels/

The directories you see there are also linked to RPM dropboxes, therefore are automatically published for inclusion in development builds. In other words, to get your kernel changes included in the current software release development efforts, you simply have to push your changes to the correct branch of olpc-2.6.

The utility behind this magic is olpc-kernel-builder:

Running vanilla kernels

In late 2010, OLPC started a focused effort to upstream its kernel patches so that unmodified "vanilla" kernels run with complete functionality on the XO.

As of 2.6.38 this is coming along nicely, and these efforts will continue til everything is upstream. Unmodified kernels run reasonably well with most functionality available.

You may have to hunt around a bit to satisfy the configuration options so that the relevant drivers get built, and the XO-1.5 needs some special kernel parameters to boot (you can find them in a recent olpc-2.6 branch in the XO-1.5 defconfig as CONFIG_CMDLINE). If in doubt, feel free to ask on the devel mailing list for someone's recent .config file.

Boot your development kernel from USB

When doing kernel development, it is time consuming to commit each small change, make an RPM, install RPM on the XO, reboot, and test. Instead, you can follow this procedure:

On your development system, prepare a USB disk as follows:

  • /boot/olpc.fth (download for XO-1 or XO-1.5, be sure to rename to olpc.fth)
  • /boot/irfs.img (download here - this is a hacked OLPC initramfs which doesn't require /ofw support)
  • /boot/bzImage (your kernel that you want to test)

Now plug this disk into your XO, turn it on, and the system will load the kernel from USB while booting the rest of the system as normal. If your new kernel crashes badly, just unplug the USB disk and boot the system again - it will revert to booting the "good" kernel from local disk.

Note: for XO-1 this only works with JFFS2. (small tweaks to olpc.fth or the hacked initramfs would be needed for ubifs).