Getting source

Getting source

There is no longer a special out-of-tree Linux/SH tree, and as a result, none of the old trees are maintained or used any more. The old trees are left around for historical reasons, particularly as many vendors are still using very old trees.

For those seeking the current kernel source, please use Linus's git tree and the kernel.org kernels directly. Updates are placed in a special pull-tree for merging, but this tree is only updated when preparing a merge request, and should not be used by others. Changes are also pulled in to Andrew Morton's -mm tree automatically, so those that are looking to try out more experimental things are recommended to use that instead.

Getting legacy and historical source

Kernel source is presently tracked in a couple of different ways. There are both [WWW] GNU arch and CVS trees available, which essentially mirror each other. This has been done for a number of reasons. Historically this project has always used CVS, and as such, most users and developers are at ease using it. Using arch simplifies many complex branching and merging operations and is therefore a preferable choice for doing tree development and maintenance. Eventually migrating off of CVS entirely will be desirable, but as it is easy enough to keep both trees in sync, this is not a pressing necessity. Thus, people are free to use whichever method of development suits them best.

Briefly there was also a BK tree that was primarily being used for sh64 work, but this has since migrated to arch as well, and as such there is no point in discussing the BK tree any further. Those using it for any reason whatsoever are strongly advised to switch off to something more sane and up to date, such as the arch tree.

This page describes how to get your hands on an SH-specific 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 source with arch

For those unfamiliar with GNU arch, it is advisable that the [WWW] Quick Introduction to arch be read through first. This should also make it apparent how to go about getting changes sent back, keeping up to date, and so on. 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:

lethal@linux-sh.org--linux \
    http://www.stampede.org/~lethal/{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 http://www.stampede.org/~lethal/{archive}/linux
Registering archive: lethal@linux-sh.org--linux
$ tla archives
lethal@linux-sh.org--linux
    http://www.stampede.org/~lethal/{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

There are quite a lot of branches relating to sh and sh64, though the stable ones are called sh--stable--2.6 and sh64--stable--2.6 respectively. People interested in doing development for any reason are encouraged to branch off of either of these at whatever patch level they wish and later make their tree accessible for star-merging to keep history intact. Vendors are encouraged to do the same, even if numerous sub-branches need to be created privately.

Branches may be browsed at varying levels:

$ tla abrowse lethal@linux-sh.org--linux                   # all Linux stuff
$ tla abrowse lethal@linux-sh.org--linux/sh                # just sh-related stuff
$ tla abrowse lethal@linux-sh.org--linux/sh--stable        # stable sh stuff
$ tla abrowse lethal@linux-sh.org--linux/sh--stable--2.6   # stable 2.6-specific stuff

Branches with specific version numbers like sh--stable--2.6.4 or sh--stable-2.6.8.1 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.

Fetching previous versions

Tags are in the format of sh--stable--<kernel-version> (sh--stable--2.6.8, sh--stable--2.6.8.1, etc.). These can be more verbosely listed by browsing the archive.

Getting a drop-in tree

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

$ tla get lethal@linux-sh.org--linux/sh--stable--2.6.8.1    # specific version 
$ tla get lethal@linux-sh.org--linux/sh--stable--2.6        # 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 source with CVS

Basic information on fetching the source from CVS can be found [WWW] here. The module containing the kernel source is called "linux".

Fetching previous versions

The kernel is tagged at every -final kernel release point. Tags are in the form of linux-2_4_20, linux-2_5_69, and so forth. The tag should be unset when attempting to get at the latest version of the tree, as the tag is only set when the tree is moved to the next stable.

The Makefile is the best way to determine all of the available tags, and this can be done via:

$ cvs status -v Makefile

at the top-level of the checked-out tree.

last edited 2006-11-01 06:31:00 by PaulMundt