Open-source project
raspberrypi/linux avatar
raspberrypi/linux

raspberrypi/linux: The Raspberry Pi Foundation's Linux Kernel Fork

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/

13,197 stars5,464 forksCNOASSERTION

At a glance

What is it?
raspberrypi/linux is the Raspberry Pi Foundation's downstream fork of the Linux kernel, currently at version 6.18.53 on the rpi-6.18.y branch. It adds Raspberry Pi-specific drivers, device tree overlays, and configuration options that are not yet or not fully present in the upstream mainline kernel.
Who is it for?
Developers who need to build a custom kernel for Raspberry Pi hardware should use this repository rather than mainline Linux, as it includes the Pi-specific drivers and device tree overlays required for full hardware support. Those building generic Linux distributions for Pi who want to track upstream more closely should check which Pi-specific patches have been merged into mainline before deciding which base to use.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 27, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What raspberrypi/linux Is and Why It Exists

The Linux kernel's mainline tree, maintained at kernel.org, is the authoritative source for the Linux kernel. Hardware vendors that require device-specific drivers, device tree configurations, or patches that are not yet accepted into mainline maintain downstream forks. raspberrypi/linux is the Raspberry Pi Foundation's fork, which carries the changes needed to run Linux on Raspberry Pi hardware including SoC-specific drivers, GPIO and hardware peripheral support, and the device tree overlay system that the Pi ecosystem relies on.

This repository is the source that the Raspberry Pi Foundation uses to produce the kernel images shipped with Raspberry Pi OS. Developers who want to build a custom kernel for Pi hardware, add out-of-tree drivers, modify kernel configuration, or compile a kernel optimized for a specific Pi model use this repository as their starting point.

Current Version and Branch Structure

The Makefile at the repository root identifies the current version. The rpi-6.18.y branch, which is the default, contains:

makefile
VERSION = 6
PATCHLEVEL = 18
SUBLEVEL = 53
EXTRAVERSION =
NAME = Baby Opossum Posse

This corresponds to Linux kernel 6.18.53. The build status badges in the README track two active branches: rpi-6.12.y and rpi-6.18.y, each with separate kernel-build and dtoverlaycheck workflows running on GitHub Actions. The branch naming convention follows the upstream Linux stable branch convention of major.minor.y, where y represents a moving patchlevel.

The README links to kernel.org/doc/html/latest/ for the full kernel documentation, and points internally to Documentation/admin-guide/README.rst for build prerequisites and known issues.

Repository Layout: A Full Kernel Source Tree

This is a complete kernel source tree, not a patch set or a tooling repository. The top-level layout follows the standard Linux kernel directory conventions. The arch/ directory contains architecture-specific code including the ARM and ARM64 architectures used by Raspberry Pi hardware. The drivers/ directory holds all device drivers. The fs/ directory contains filesystem implementations. The net/ directory holds networking stack code. The kernel/ directory contains core scheduler, process management, and system call infrastructure.

The Documentation/ directory is particularly relevant for this repository: it contains both the upstream kernel documentation and Pi-specific guides. Building the documentation locally requires running:

bash
make htmldocs

or:

bash
make pdfdocs

The Makefile requires GNU Make version 4.0 or higher; it explicitly checks for this and errors if the version is insufficient. The samples/ directory at the repository root contains kernel programming examples including eBPF, tracing, HID, and cgroup samples.

The repository also includes Rust support infrastructure. The rust/ directory appears in the top-level layout, and the repository root contains a .clippy.toml and .rustfmt.toml, indicating that the Rust kernel development tooling used in recent Linux versions is present in this fork as well.

The Device Tree Overlay System

One of the key Pi-specific additions visible in the repository structure is the device tree overlay system. The second CI workflow visible in the README's build status badges is dtoverlaycheck, which runs on each branch. Device tree overlays are small binary fragments that modify the hardware description at boot time, allowing users to enable or disable hardware peripherals such as SPI, I2C, UART, and GPIO functions without recompiling the kernel.

This overlay system is a Raspberry Pi Foundation contribution that differs from how mainline Linux handles hardware configuration. It allows Pi users to change hardware configuration by editing /boot/config.txt on the SD card rather than by modifying and recompiling the device tree source. The check workflow validates that the overlay files in the repository compile and conform to expected structure.

Where This Fork Has Limitations

The primary limitation is that this fork is downstream of mainline Linux. Pi-specific patches are rebased onto new upstream versions, which introduces a merge and testing cost. There is a lag between a new upstream LTS release and the availability of a stable Pi-targeted branch. Users who need the absolute latest upstream features or security patches before the Foundation has rebased may find that the most recent rpi- branch trails mainline by several minor versions.

The repository description notes that issues unrelated to the Linux kernel itself should go to the community forum at forums.raspberrypi.com. The repository's issue tracker is specifically for kernel bugs, not for general Raspberry Pi OS questions or hardware setup help. Filing a general Pi question as a kernel issue is unlikely to receive a useful response.

The license is not declared in the repository metadata (NOASSERTION), but the kernel source carries the standard GPL-2.0 license via the COPYING file and the LICENSES/ directory, consistent with mainline Linux.

Raspberry Pi Fork vs Mainline Linux Kernel

Mainline Linux, the kernel.org tree, is the canonical upstream. Over the years, the Raspberry Pi Foundation has worked to upstream Pi-specific drivers and device tree support into mainline. The practical difference is that mainline may not yet include all Pi hardware support, particularly for newer Pi models shortly after release. The Foundation's fork carries those patches sooner.

Building mainline Linux for a Raspberry Pi is possible, but some peripherals may not work correctly without the Pi-specific patches. Distributions that ship their own kernels for Pi, such as some Arch Linux ARM builds, choose which base to use based on how much Pi-specific functionality they need and how closely they want to track upstream security fixes. For the majority of Pi use cases, the Foundation's fork is the appropriate starting point because it represents what the Foundation tests and ships.

Maintenance and Build Status

The last push to the repository was on 2026-09-25. The Raspberry Pi Foundation maintains multiple active branches simultaneously, as shown by the separate CI badges for rpi-6.12.y and rpi-6.18.y in the README. This parallel maintenance means security fixes can be backported to older stable branches.

Building the kernel requires cross-compilation toolchain setup for most developers who are building on a non-ARM host. The Documentation/process/changes.rst file, referenced in the README, lists the minimum tool versions required for a successful build. The Makefile enforces GNU Make 4.0 as a hard requirement at the start of the build process.

Editorial conclusion

Developers who need to build a custom kernel for Raspberry Pi hardware should use this repository rather than mainline Linux, as it includes the Pi-specific drivers and device tree overlays required for full hardware support. Those building generic Linux distributions for Pi who want to track upstream more closely should check which Pi-specific patches have been merged into mainline before deciding which base to use. The correct channel for questions unrelated to the kernel itself is the Raspberry Pi community forum at forums.raspberrypi.com, not this repository's issue tracker.

Frequently asked questions

What is the difference between raspberrypi/linux and the mainline Linux kernel?

raspberrypi/linux is the Raspberry Pi Foundation's downstream fork that includes Pi-specific drivers, device tree overlays, and configuration options needed for full hardware support on Pi models. Mainline Linux at kernel.org may lack some Pi-specific patches, particularly for newer Pi models shortly after release.

What Linux kernel version is on the rpi-6.18.y branch?

The Makefile on the rpi-6.18.y branch shows VERSION=6, PATCHLEVEL=18, SUBLEVEL=53, with the codename Baby Opossum Posse. The repository also maintains the older rpi-6.12.y branch in parallel.

Where should I report Raspberry Pi problems that are not kernel bugs?

The repository description directs non-kernel issues to the Raspberry Pi community forum at forums.raspberrypi.com. The GitHub issue tracker for this repository is specifically for bugs in the Linux kernel itself.

Official sources

  1. Issues
  2. raspberrypi/linux on GitHub
  3. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/raspberrypi-linux.svg)](https://hysenlabs.com/projects/raspberrypi-linux)