Kernel: Difference between revisions

From OLPC
Jump to navigation Jump to search
(add xo-1.5 verified method, quozl)
No edit summary
Line 1: Line 1:
{{OLPC}}
[[Category:Developers]]
[[Category:Developers]]
[[Category:Software]]
[[Category:Software]]
{{Merge | Rebuilding OLPC kernel}}
{{Merge | Rebuilding OLPC kernel}}


== The OLPC kernel ==
We use a modified version of the [[Linux]] kernel on the OLPC laptop.


OLPC OS [[Releases]] use our OLPC-modified version of the [[Linux]] kernel.
'''Note:''' You will not be able to boot a new kernel on your XO until you have a [[Developer key]].


== The OLPC kernel git repository ==
The OLPC kernel is maintained in git:
* git://dev.laptop.org/olpc-2.6
* http://dev.laptop.org/git?p=olpc-2.6;a=summary


Current maintainers: Chris Ball, Daniel Drake, Paul Fox
We use git to track changes that we've made, as well as to easily merge with Linus's (and others!) kernel tree. The git repository can be downloaded with the following command:


We work on specific branches for each release. Looking at git history should be enough to 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).
<pre>
git clone git://dev.laptop.org/olpc-2.6
</pre>


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.
Alternatively, you can use gitweb to view and search changes by going to:


=== RPM generation ===
http://dev.laptop.org/git?p=olpc-2.6;a=summary


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/
Note that at the bottom of that page, there is a list of branches. We keep around different branches for a number of reasons; within a cloned git repository, you can switch to branch 'FOO' by running:


The RPMs have the dates they were built, and the number of the build. For example, 'kernel-2.6.21-20070322.4.olpc.5fe63334a44da42.i586.rpm' was built on March 22, 2007. It was the 4th build on that day. The '5fe63334a44da42' is part of the git commit ID, if you're trying to match up what specific commits made it into the kernel.
<pre>
git checkout FOO
</pre>


=== Installing kernel RPMs ===
The branches to note are:


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:
* master - this is the default branch, and is the equivalent of cvs's HEAD. Code that we want in our future releases goes into this branch, and needs to be vetted before being committed.
* stable - this is the branch that we automatically pull kernels from when we build a release. It is usually a snapshot of the 'master' branch, although we sometimes cherry-pick fixes into it.
* testing - this is the branch for joyride kernels. It is usually more recently updated than stable but not as recently updated as master.


If running a software release that uses partitions:
The other branches can be ignored - if you don't already know what they are, they're not going to be of any use to you.
rsync --delete-before -av /boot/ /bootpart/boot/


If running a software release that does not use partitions:
== OLPC kernel configuration ==

The Linux kernel has a config file that describes the various options that are built into the kernel. For OLPC, we store that in the root of the git repository, in the 'arch/i386/configs/olpc_defconfig' file. Via gitweb, it can be viewed (for the 'master' branch) here:

http://dev.laptop.org/git?p=olpc-2.6;a=blob;f=arch/i386/configs/olpc_defconfig;h=f1675e86312eee9c1cc9e59ebefca91ff8afe979;hb=HEAD

For official OLPC kernel RPMS (and on OLPC OS images), the config ends up being installed as /boot/config-$VERS. This allows you to see how the currently running kernel is configured.

== Installing OLPC kernel RPMs ==

We auto-build kernel RPMs every 30 mins, which means that new, shiny commit that just occurred will show up in the following places (depending upon branch):

* master - http://dev.laptop.org/~dilinger/master/
* stable - http://dev.laptop.org/~dilinger/stable/
* testing - http://dev.laptop.org/~dilinger/testing/
* 2.6.31 - http://dev.laptop.org/~kernels/

The SRPMs (Source RPMs) are available in the same place.

The RPMs have the dates they were built, and the number of the build. For example, 'kernel-2.6.21-20070322.4.olpc.5fe63334a44da42.i586.rpm' was built on March 22, 2007. It was the 4th build on that day. The '5fe63334a44da42' is part of the git commit ID, if you're trying to match up what specific commits made it into the kernel.

The 'kernel-' RPMs contains all you need to boot into that new kernel; simply install it, reboot, and you're set. The 'kernel-devel-' RPMs contain headers necessary for building out-of-tree kernel modules. The 'kernel-debuginfo-' RPMs contain debugging info necessary for debugging the kernel with, say, systemtap.

To install your RPM on XO-1:
rpm -ivh kernel-*.rpm
cp -a /boot/* /versions/boot/current/boot/
cp -a /boot/* /versions/boot/current/boot/
(If you omit the -a in the above recipe, the vmlinuz symlink will not be updated correctly)

To install your RPM on XO-1.5:
rpm -ivh kernel-*.rpm
cp -af /boot/vmlinuz* /boot/init* /bootpart/boot/

See the instructions at [[Kernel Building]] if you need to update modules in the initramfs. If you don't do this, you will likely get modprobe warnings at boot (before the initramfs starts); they are harmless.

== Building an OLPC kernel ==


=== Building an OLPC kernel ===
So you've decided that you want to build an OLPC kernel? Are you certain? The kernel is filled with arcane magic and sharp pointy things that may draw blood. If you're really serious, see the [[Kernel Building]] page.


== Building an OLPC kernel RPM ==
# Check out the kernel from git
# Switch to the appropriate branch
# Make your changes (updating the configs under arch/x86/configs/ if changes are needed)
# Commit all your changes
# Run <tt>make xo_1-kernel-rpm</tt> for XO-1, or <tt>make xo_1_5-kernel-rpm</tt> 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).
It takes a bit longer to build, but it's easier to distribute if you build a proper kernel RPM. The instructions for doing so are on the [[Rebuilding OLPC kernel]] page.


[[Category:Subsystems]]
[[Category:Subsystems]]

Revision as of 14:51, 21 February 2011

Merge-arrows.gif
It has been suggested that this article or section be merged with Rebuilding OLPC kernel. (Discuss)


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 branches for each release. Looking at git history should be enough to 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.

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 RPMs have the dates they were built, and the number of the build. For example, 'kernel-2.6.21-20070322.4.olpc.5fe63334a44da42.i586.rpm' was built on March 22, 2007. It was the 4th build on that day. The '5fe63334a44da42' is part of the git commit ID, if you're trying to match up what specific commits made it into the kernel.

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. Check out the kernel from git
  2. Switch to the appropriate branch
  3. Make your changes (updating the configs under arch/x86/configs/ if changes are needed)
  4. Commit all your changes
  5. 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).