Getting an SH kernel

Getting an SH kernel source tree

This page describes how to get your hands on an SH-specific 2.6 Linux kernel source tree. This generally involves three steps:

In short, you don't just download an SH-ready source tree; you have to create one by downloading both a kernel source tree and a drop-in tree, and combining them. The rationale for this is that the drop-in tree is normally much smaller than a full kernel tree, so it's much more space-efficient to just keep track of the differences and let you download those diffs and apply them to the source.

You have to be careful in that there are different versions of the drop-in tree for different versions of the kernel source tree, so you have to make sure your two downloads are compatible. More on this shortly.

Getting the drop-in tree

We'll start by explaining how to get the drop-in tree first, since which version you get will dictate which version of the generic kernel source you'll have to download to go with it. You can get the drop-in tree using either arch or CVS; we'll start by explaining how to use arch since that seems to be the preferred SCM system for all of this.

Getting the drop-in tree using arch

If you're not familiar with arch, you should probably read the online tutorial at [WWW] Quick Introduction. The rest of this section assumes you've installed arch, and can run the corresponding tla command.

Registering with the arch archive

The primary SH-related development tree which mirrors CVS HEAD is located at the arch archive: \{archive}/linux

In order to get a branch from that archive, you first have to register with the archive, after which you can verify that the registration worked by asking for your list of currently-registered archives:

$ tla register-archive{archive}/linux
Registering archive:
$ tla archives{archive}/linux      # looks good

If you get all of the above, you're registered and can go on to browse the archive.

Browsing the archive

The archive has a number of branches related to both sh and sh64, with the stable ones called sh--stable--2.6 and sh64--stable--2.6, respectively. You can browse the branches to different levels:

$ tla abrowse                   # all Linux stuff
$ tla abrowse                # just sh-related stuff
$ tla abrowse        # stable sh stuff
$ tla abrowse   # stable 2.6-specific stuff

Branches with specific version numbers like sh--stable--2.6.4 or sh--stable- refer to the drop-in trees for precisely those kernel versions, while the more generic branch sh--stable--2.6 refers to the most up-to-date drop-in tree, whose kernel version you can figure out once you download it.

Getting a drop-in tree

Once you decide which branch you want, use the tla command to download it:

$ tla get    # specific version 
$ tla get        # most recent version

For any of these get operations, you can add an optional argument for the directory name to use, otherwise it will correspond to the branch you downloaded.

Once you've downloaded the drop-in tree, you can cd into that new directory and what you'll find is a subset of the kernel source tree that you'll overlay on top of a generic source tree. And in that directory, you should find a file that identifies the kernel version that this drop-in tree matches, something like AGAINST-2.6.9 or something similar.

Getting the drop-in tree via CVS


Linking the drop-in tree to the source tree

At this point, you should have both your drop-in tree and its corresponding generic kernel source tree. In the scripts/ directory in the drop-in tree, you'll find the script which takes two arguments: a drop-in tree directory, and a kernel source directory to apply it to. If you're in the scripts/ directory, you could run a command similar to the following:

$ ./ ../../<drop-in tree dirname> <kernel source tree name>

This will subsequently symlink all of the drop-in tree components over top of the stock kernel ones, resulting in a full kernel tree ready for development and building.

Updating the kernel source tree

Naturally, there will be ongoing updates to the drop-in tree that you'll want to add to your working tree. With arch, you can check if there are any updates to your drop-in tree, and get those updates, by running these commands inside the top-level directory of the tree:

$ tla missing
$ tla missing --summary         # surprisingly, more verbose
$ tla update                    # get all updates

If there were changes that still correspond to the same kernel version, you can use the script to undo the SH-related additions to the kernel tree, then relink with the newer drop-in tree.

If there is a whole new kernel version drop-in tree, then naturally you'll have to get the newer kernel source and start the process all over again.

last edited 2004-12-03 11:55:54 by