We in the Purism kernel team maintain a set of patches against the mainline Linux codebase that is released by Linus Torvalds on a regular basis. We need it in order to support the Librem 5 phone hardware for our users as mainline Linux doesn’t yet support everything needed.

But our out-of-tree patchset also exists in order to test the kernel, improve it and work with the development community to include it in mainline Linux. It’s a “development tree” if you will, currently based on the v5.13.5 mainline release. We rebase it regularly. In an ideal world, at some point, the kernel we ship to users won’t include out-of-tree changes anymore.

Speaking of supporting mainline: Since January 12th 2021, the “linux-next” kernel tree can be built using the arm64 default configuration and run on the Librem 5 devkit without any changes whatsoever:

Devkit running mainline

It doesn’t yet include all optimizations and drivers we ship to users, but it is usable and an important milestone for us. We’re also working on getting to that point on the phone too.

Back to our development tree: Keeping the goal of including everything in the mainline project is important in order to support our hardware for a long time. We want to maintain the drivers we need as part of the community, not outside of it.

Let’s look at the patchset we’re talking about at the time of this writing:

As git-diff quickly tells us, we change 156 files and do 42801 insertions and 1308 deletions. That may look a lot compared to other software projects, but looking a bit into what we change, at a high level, makes things clearer:

We still include drivers for the camera stack but are almost done with pushing the remaining parts upstream and moving to a full mainline solution. Excluding that part from the statistics leaves us with 128 files changed, 31298 insertions, 1301 deletions.

Similarly, we include a driver for our wifi modem card. There is an in-tree replacement, but that needs some more work in order for it to be usable. Once we get to it, we’ll tick that off and remove the driver from our tree. Excluding it too, gives us 84 files changed, 8574 insertions, 1297 deletions.

The bulk of the remaining changes comes from one LED driver, two Displayport drivers we are working on, one rfkill driver, and devicetree description updates that we are moving into the mainline kernel on a regular basis. We hope to be able to integrate all the above with mainline Linux soon. The remaining patches make roughly a thousand lines of code changes. The important part is that they are simple, maintainable and that we keep the goal of “mainlining” them all.

We cannot do this alone and would like to thank all developers and maintainers that help us in our quest.


Have a look at our Linux tree to see what is currently being worked on and tested (or help if you feel like joining the fun).

Discover the Librem 5

Purism believes building the Librem 5 is just one step on the road to launching a digital rights movement, where we—the-people stand up for our digital rights, where we place the control of your data and your family’s data back where it belongs: in your own hands.

Order now

Recent Posts

Related Content