Lesson 3: "Git"ting the Linux kernel source

Printer-friendly versionPrinter-friendly version

At this point, it's time to get yourself a copy of the current Linux kernel source and -- I'm going to make a long story short -- avoid every other option and simply check out the main Linux Git repository anywhere under your home directory:

$ git clone \
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git \

The other options typically include downloading a fixed tarball or installing a distro-specific package but, for maximum flexibility, you really want your own Git clone, even though it's going to cost you some bandwidth. So pick a location, start the clone and go get a coffee.

And while I'll be coming back shortly to show you a few useful Git commands you can use later, you don't need them just yet so I'll put those on hold so we can head into the lesson you've all been waiting for ... how to configure, build and boot your new kernel.

NOTE: If you just want to browse the current kernel development tree, you can find it here.


2.6 kernel?

IMHO it will be better to git clone the mainline kernel instead of linux-2.6. Anyhow, in your examples you have 3.3-rc7 listed, may be you intended to put the source to the same on this page. :)

"linux-2.6.git" *is* the current mainstream Git repository.

While the name is admittedly slightly misleading, the "linux-2.6.git" directory above does indeed represent the mainstream development repository for the Linux kernel, which is now up to 3.3-rc7 and beyond. But your point is well taken -- I should make that more obvious.


Oh is that so, I was not aware of this. Thanks for informing.

Would the linux-stable git tree be more appropriate?

Would the linux-stable git tree be more appropriate? Rather than Linus' main development tree? I can see his tree being a bit unstable during merge windows, where as the stable tree should at least stick with the latest tag, and may be slightly more reasonable if people are simply 'git clone'ing and then trying to build (although even then, early rc's may have issues, too).

A good approach might be to fixate on one longer term supported release. 3.0.y or 3.2.y are probably good candidates (Greg KH says 3.0.y is a long term kernel and Debian and Ubuntu are mostly committed to 3.2 for their upcoming releases).

The possibilities for the git clone

I'll be covering Git and cloning in far more detail in a future lesson, but you have a point -- perhaps I'll add a bit more to this section about checking out a stable tag.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <br> <pre> <h1> <h2> <h3> <h4>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.