Kernel configuration

From postmarketOS Wiki

Kernel configurations determine which features of the Linux kernel are enabled for a particular build, such as filesystems, camera, WiFi related options and a lot more. This article gives an overview of how kernel configs are managed in postmarketOS and how one can change them.

Why do we have multiple kernel configs?

We would ideally run mainline Linux without any patches on all devices and only have one kernel config per device architecture. But oftentimes we need to carry a few patches for our (Close to) Mainline kernels (used for devices in main and community categories). Another reason is that in many cases want to be on a specific, known-working version before we upgrade to the next one. Furthermore devices in the testing category may just use the downstream kernel to get the device booting at all. Because of that, you will find a lot of Linux kernels when looking at the postmarketOS specific package build recipes in pmaports.git.

Keeping kernel configs consistent

All kernel configs are stored inside pmaports (list them with find device -name 'config-*'). We ensure that they have specific options enabled, disabled or set to a certain value with a CI script that essentially runs pmbootstrap kconfig check. This pmbootstrap command reads our requirements from kconfigcheck.toml in the currently checked out pmaports branch and verifies that all kernels pass the requirements. See Kernel configuration/Adjusting multiple kernels for more information.

Future plans

At some point we would like to generate the kernel configs for main and community devices from fragments. Work on this has been started in pmaports#2492 (big thanks to Jenneron and everybody involved!). However this is quite the big undertaking and work has stalled. So we decided to improve and document the current process instead, which we will still need for devices in testing in any case.

Adjusting one kernel config

It is recommended to change kernel config options not just for one kernel, but for all where it makes sense (typically all devices in the community or main category as explained here). However before you do that, you should first edit the one kernel you are currently using on your device to test if the change has the desired effect.

You basically need to run pmbootstrap kconfig edit followed by the name of the kernel package, see Kernel configuration/Adjusting one kernel for details.

Subpages