21

Is there a resource to download a specific kernel version source? For example, I want to get 2.6.36.2 sources to compare with this package and see what changes were introduced?

  • 1
    The link in this question seems to be broken. – Faheem Mitha Mar 21 '15 at 10:55
25

The easiest and most bandwidth-friendly way, if you expect to do this more than once, would be to clone the kernel's git repository and check out the version you want based on its tag. It's probably best to clone the linux-stable repo, since that will include tags for all of the stable releases:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
cd linux
git checkout v2.6.36.2

To later switch to another version, it's easy:

git checkout v3.5.2

To update your repository to include all of the latest tags and commits:

git fetch
11

Yes, kernel.org has all released versions, including 2.6.36.2. Note, however, that most Linux distributions apply own patches to the vanilla kernel source.

6

If you do not want to download whole kernel commit history (which is well above 1 GiB), you can download only such part of the kernel Git repo that leads to your desired branch. E.g. to locally checkout the Ubuntu kernel in version 4.5, you'd do:

git clone --depth 1 --single-branch --branch v4.5  git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack

This way, the clone is about 150 MiB.

0

If you just want to get one tag for quick compilation, do:

git clone --depth 1 --branch v4.18 \
  git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

--depth 1 does a shallow clone, which drastically reduces the clone time and disk usage.

It only works for tags currently unfortunately, not arbitrary commits, due to how the cgit git server works and is configured. See also: https://stackoverflow.com/questions/3489173/how-to-clone-git-repository-with-specific-revision-changeset

See also: Why is the git clone of the Linux kernel source code much larger than the extracted tar.xz?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.