L3-Types of Linux Kernel Source Trees


📚 Linux Kernel Programming

Chapter 2 – Part 2: Dev Cycle

Part 3: Types of Kernel Trees

Part 4: Getting the Kernel Source →

Free linux kernel programming course

Types of Linux Kernel Source Trees

LTS, Stable, Mainline, RC — what they are and which one you should use

⏱ ~12 min read
🎯 Beginner + Intermediate
🐧 Kernel Internals

🎯 What you will learn
  • The different types of kernel release trees that exist
  • What makes a kernel LTS (Long-Term Support) and why it matters
  • The difference between mainline, stable, LTS, and EOL kernels
  • How to read a kernel version number like 6.6.30
  • Which kernel type to choose depending on your situation

1. Not All Kernels Are Created Equal

When you visit the official Linux kernel website kernel.org, you don’t just see one kernel to download. You see several, each labelled differently — mainline, stable, longterm, EOL. This can be confusing for newcomers.

The reason is simple: different users have different needs. A kernel developer experimenting with new features needs something very different from an engineer building a router that must stay secure for 5 years. The kernel project has organised its releases to serve all these needs.

💡 Think of it like car models

A car company sells a concept car (mainline/bleeding-edge), a regular production model (stable), and a fleet edition for taxis and police cars that gets serviced for 10 years (LTS). Same underlying technology, very different maintenance commitments. The Linux kernel works the same way.

2. How to Read a Kernel Version Number

Before we look at the tree types, let’s quickly decode how Linux kernel version numbers work. This removes a lot of confusion.

Anatomy of a Kernel Version Number
6.6.30
6
Major Version
Changes rarely. Linux went from 4 to 5 in 2019, 5 to 6 in 2022. No special technical meaning — just Linus’s decision.
6
Minor Version
Increments with each stable release cycle (roughly every 10–12 weeks). This is the number you track to know how “new” a kernel is.
30
Patch Level
Bug fix / security patch number applied by the stable team after the main release. Higher = more patches applied. No patch level means it’s brand new.
Quick examples:
6.1
Brand new stable release, no patches yet (also an LTS kernel)
6.1.90
Same 6.1 kernel with 90 rounds of bug/security patches applied
6.10-rc3
Release candidate 3 of the upcoming 6.10 kernel — not yet stable

3. The Different Types of Kernel Trees

Here are the main kernel tree types, ordered from least stable to most stable — which also maps from shortest lifespan to longest.

LEAST STABLE
Mainline / RC (Release Candidate)

This is Linus Torvalds’s own tree — the very tip of Linux development. It contains the latest features that have been merged during the merge window, followed by a series of -rc releases as they get stabilised.

Who uses it: Kernel developers and driver authors who need to develop and test against the very latest code. If you are writing a new driver that you plan to submit upstream, you should develop against mainline.

⚠ Never use on production systems.
Expect rough edges, regressions, and changes that break things.

STABLE
Stable Kernel

A stable kernel is the freshly-released version after its rc phase is complete. For example, version 6.9 is a “stable” release. The stable team then applies important bug and security fixes, creating point releases like 6.9.1, 6.9.2, and so on.

Who uses it: Developers who want recent hardware support and new features, but on a version that has gone through proper testing. Desktop Linux users often run stable kernels. However, it has a short life — usually only maintained until the next stable kernel comes out (8–12 weeks).

LONG-TERM (LTS)
Long-Term Support Kernel

An LTS kernel is a specially designated stable release that gets an extended maintenance commitment — a minimum of 2 years, often 4–6 years or more. Only critical bug fixes and security patches are backported. No new features are ever added.

Why it matters: Embedded Linux products (routers, cameras, industrial controllers, medical devices) often have long lifespans — 5 to 10 years in the field. The engineering team cannot upgrade the kernel every 3 months. LTS kernels give them a stable, well-maintained foundation for the entire product lifetime.

Who decides? The kernel maintainers designate certain releases as LTS based on community need and the willingness of major stakeholders (like Google for Android, embedded Linux vendors) to commit resources to maintaining them. Historically, roughly one kernel per year is designated LTS.

✅ Recommended for embedded products and production servers.

END OF LIFE
EOL (End of Life) Kernel

A kernel that has reached its EOL date is no longer maintained. No more security fixes, no more bug fixes, nothing. If a critical vulnerability is found, users of EOL kernels are on their own. Running an EOL kernel in production — especially one connected to a network — is a serious security risk.

❌ Do not use EOL kernels on any live system.
They are archived for historical reference only.

4. Side-by-Side Comparison

Type Stability Lifespan Best for
Mainline / RC Low Weeks Kernel developers, upstream contribution
Stable Medium ~3 months Desktop users, testing new features
LTS High 2–6+ years Embedded products, production servers, Android
EOL None Expired Historical research only — never for live systems

5. LTS Kernels — A Closer Look

LTS kernels deserve extra attention because as an embedded engineer, this is what you will likely work with most. Let’s understand them more deeply.

What makes it LTS?

There is no magic in the kernel release itself that makes it LTS. It is simply a decision by the community and the kernel maintainers. They look at which kernel versions are being widely adopted by major stakeholders — Android (Google), embedded Linux vendors like Yocto Project, major server distributions — and they commit to maintaining those versions for an extended period.

Once designated as LTS, only the following types of patches go in: security fixes, critical bug fixes, and important hardware enablement patches. New features are never added to an LTS kernel — that would defeat the purpose.

How long does LTS support last?

The minimum commitment is 2 years, but many LTS kernels get extended well beyond that. The deciding factor is often whether large organisations are willing to fund the maintenance effort. Android has historically been a major driver — Google’s Android release is pinned to specific LTS kernels, which creates strong incentive to keep those kernels maintained.

Recent LTS Kernels and Their Support Windows
Kernel Released EOL Date Support Period
5.4 LTS Nov 2019 Dec 2025

~6 years

5.10 LTS Dec 2020 Dec 2026

~6 years

5.15 LTS Oct 2021 Oct 2026

~5 years

6.1 LTS Dec 2022 Dec 2026

~4 years

6.6 LTS Oct 2023 Dec 2026

~3 years

Check kernel.org for current EOL dates — they can be extended based on community needs.

6. Which Kernel Should You Use? A Decision Guide

Here’s a simple guide to help you pick the right kernel for your situation:

🏭
Embedded product that ships to customers
Use the latest active LTS kernel. Check kernel.org for the current active LTS kernels. Pick the newest one whose EOL is well beyond your planned product end-of-life date. Currently, 6.6 LTS is a solid choice.
🖥
Desktop development machine / personal use
Use the latest stable kernel from your distribution. Ubuntu, Fedora, and Arch Linux all ship well-tested kernel versions. You don’t need to compile your own kernel for this use case.
Writing a kernel driver or feature to submit upstream
Develop against mainline. Patches submitted to the kernel mailing list must apply cleanly on the latest mainline tree. Testing on an LTS or older stable kernel is a recipe for rejection.
📚
Learning kernel internals (like this course)
Use an LTS kernel on your development VM/machine. Concepts don’t change between versions, but having a stable, well-documented version makes your learning smoother. The latest LTS is always a good pick.

🌐 Where to check current LTS kernels

Visit kernel.org — the official kernel website. The main page always shows currently active stable and LTS kernels with their version numbers and EOL dates. A yellow background means “latest stable”, a green background means “longterm (LTS)”.

You can also check kernel.org/releases.json programmatically if you are building tools that need to track kernel versions.

🎤 Interview Questions

Q1: What is an LTS kernel and why is it important for embedded systems?
An LTS (Long-Term Support) kernel is a specially designated stable kernel release that receives an extended maintenance commitment — typically 2 to 6 years or more. Only critical bug fixes and security patches are backported; no new features are added. For embedded products with long field lives (3–10 years), LTS kernels are essential because the product team needs a kernel that remains secure and supported throughout the product’s lifetime without requiring a full OS upgrade.
Q2: What does the version number 6.6.42 tell you about a kernel?
The number breaks down as: major version 6, minor version 6, and patch level 42. The major version (6) rarely changes and has no deep technical meaning. The minor version (6) identifies which development cycle this kernel comes from — 6.6 is the sixth kernel release in the 6.x series. The patch level (42) tells you that 42 rounds of bug fix or security patches have been applied to the 6.6 base by the stable team. A higher patch level means the kernel has received more maintenance, which is generally a sign of greater stability.
Q3: If you are writing a driver to submit to the mainline Linux kernel, which tree should you develop against and why?
You must develop against the mainline (Linus’s) tree, specifically the latest -rc kernel. The kernel community requires that patches apply cleanly on the current mainline tree before they will be reviewed. Submitting a patch that only works on an LTS or older stable kernel will be rejected immediately — those trees have diverged from mainline and applying your patch to them does not guarantee it will work on what the maintainers are reviewing.
Q4: What is the difference between a stable kernel and an LTS kernel?
Both are released after the same rc stabilisation process and are safe to use. The difference is in their support lifespan. A regular stable kernel is maintained only until the next stable release comes out — roughly 8 to 12 weeks. After that, it becomes End of Life. An LTS kernel, on the other hand, continues receiving bug and security fixes for a minimum of 2 years and often much longer (4–6 years). LTS kernels are specifically chosen because they represent solid, well-tested releases that the broader community has committed to supporting long-term.
Q5: What is an EOL kernel and what are the risks of using one?
EOL stands for End of Life — a kernel that is no longer receiving any maintenance, bug fixes, or security patches. The primary risk is security: when new vulnerabilities are discovered (which happens regularly), they are patched in active kernels but not in EOL ones. A system running an EOL kernel with a known unpatched vulnerability is a target for exploitation. Additionally, EOL kernels will not support newer hardware. There is never a good reason to run an EOL kernel on a live production system.

✅ Key Takeaways
  • Kernel trees are ordered: mainline → stable → LTS → EOL (by increasing lifespan and stability)
  • Version numbers follow major.minor.patchlevel — e.g. 6.6.42
  • LTS kernels receive bug and security fixes for 2–6+ years — no new features ever
  • For embedded products, always choose an active LTS kernel with an EOL date beyond your product’s lifespan
  • For upstream kernel development, always target mainline
  • Never run an EOL kernel on any production or networked system

EmbeddedPathashala · Free Embedded Systems Education · embeddedpathashala.com

Leave a Reply

Your email address will not be published. Required fields are marked *