(Close to) Mainline

The term "mainline" is used with different meaning in the wider Linux community. When talking about "mainline" in postmarketOS without further context, we are usually referring to "close to mainline" kernels (to distinct from Android's heavily patched downstream kernels, also called vendor kernels). It is our intention to get devices from an Android downstream kernel first to "close to mainline", and eventually into mainline by upstreaming the patches.

To find out, whether a device has a "mainline" or "close to mainline" kernel, look at the device- and linux- pmaports.

If somebody got confused about the terminology, please point them to this wiki page. Let's make an effort to use the right terminology, "mainline" vs. "close to mainline". But don't nitpick about it in conversations when other people use it wrong. Usually it is clear from the context.

Mainline
On kernel.org, it refers to the "mainline" tree of the Linux kernel (other trees: linux-next, prepatch, stable, longterm): Mainline tree is maintained by Linus Torvalds. It's the tree where all new features are introduced and where all the exciting new development happens. New mainline kernels are released every 2-3 months.

The stable and longterm trees are based on mainline. This means, if a patch made it to mainline Linux, it ends up in mainline, stable and longterm releases.

Close to mainline
A "close to mainline" kernel is based on a source tree from kernel.org with "a few patches" on top. This is an important distinction from Android's heavily patched downstream kernels, which have tens of thousands of lines of code changed (not even counting vendor specific changes which easily reach into the millions; the trend goes towards minimizing the changed lines). With a "close to mainline" kernel, it should be feasible to get the few patches into the mainline Linux kernel, whereas this is not feasible for an Android downstream kernel.

Other software
In the context of software other than the Linux kernel, to get something into "mainline" means to get it into the official source tree of that software.