docs/generic-kernels: Add device package template

This is currently hidden away in a GitLab issue comment. For broader
visibility, let's just put this in the documentation to encourage people
to follow it.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8108>
This commit is contained in:
Aelin 2026-03-01 15:22:32 +01:00 committed by The Friendly Meow (merge) Bot
parent 846482ea84
commit b7cb738a62
No known key found for this signature in database

View file

@ -80,3 +80,35 @@ The following types of patches can be temporarily added to the generic kernels:
get the patch fixed or reverted).
Out-of-tree patches are not acceptable for the generic kernels.
## Device package template
For a consistent packaging setup, we recommend following this template when
using the generic kernels in a device package:
```shell
subpackages="
$pkgname-kernel-stable:kernel_stable
$pkgname-kernel-lts:kernel_lts
$pkgname-kernel-mainline:kernel_mainline
"
...
kernel_stable() {
pkgdesc="Stable kernel (recommended, best balance between stability and features)"
depends="linux-postmarketos-stable"
devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}
kernel_lts() {
pkgdesc="Long-term maintainance kernel (most stability, not all security fixes & new features)"
depends="linux-postmarketos-lts"
devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}
kernel_mainline() {
pkgdesc="Upstream development kernel (regular breakage, latest features)"
depends="linux-postmarketos-mainline"
devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}
```