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?
-
1The link in this question seems to be broken.– Faheem MithaMar 21, 2015 at 10:55
4 Answers
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-stable
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
-
3Any clue why minor tags don't show on GitHub? E.g. github.com/torvalds/linux/releases/tag/v3.5.2 vs github.com/torvalds/linux/releases/tag/v3.5 Nor on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/refs Jun 13, 2017 at 22:26
-
1
--depth
and--branch
can also drastically reduce the clone size: unix.stackexchange.com/a/473373/32558 Oct 5, 2018 at 5:43 -
Ah.. Thanks. That repository is one of hundreds of the addresses in git.kernel.org. Why should it be so difficult to find it? linux people are keeping it as a secret??– Chan KimJun 28, 2021 at 3:05
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.
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.
-
3
--depth
implies--single-branch
BTW, according toman git-clone
. Oct 5, 2018 at 5:43
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?