Draft:Porting to a new device/Kernel package/Mainline
Determining SoC support status
The level of support for SoCs in the mainline Linux kernel is varied - some have all components working, whereas for others, certain features like GPU support, audio or suspend may be missing.
For SoCs supported by postmarketOS, you can find the status of their features on the list of supported SoCs. The wiki page for your SoC may contain more in-depth information.
If your SoC is not listed on the wiki, you can try to find it directly in the kernel; open a copy of the Linux kernel (or a mirror on GitHub) and search for a file named after the SoC's codename under arch/arm/boot/dts or arch/arm64/boot/dts.
Each mainlined SoC or family of SoCs supported by postmarketOS has a shared kernel package in pmaports. This kernel package is used by all mainlined devices with the SoC (in contrast to vendor kernels, where each device gets its own kernel package).
The package name for your SoC should be listed on its wiki page; it follows the format of linux-postmarketos-(socvendor)-(codename), where (socvendor) is the name (or shortened name) of the SoC vendor (qcom for Qualcomm), mediatek for Mediatek, etc.)
Keep the name of this package in mind, as we will need to re-build it to include support for our device.
Getting the kernel source code
For most SoCs, community developers maintain close-to-mainline forks of the Linux kernel. These forks contain patches for SoC and device support that haven't yet been upstreamed, and are the basis for the shared kernel packages present in postmarketOS.
You can usually find the kernel source repository for your SoC under the "community page" link in the infobox on the chipset's wiki page. Alternatively, you can check the APKBUILD of the SoC's kernel package.
Some devices use linux-stable or linux-edge; in those cases, get the kernel source code directly from upstream (git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git).
Working with the mainline kernel
There are per-SoC mainlining guides available for the following SoCs:
| SoC | Mainlining page |
|---|---|
| Qualcomm Snapdragon S4 (MSM8960) | Qualcomm S4/Krait 200 mainlining |
| Qualcomm Snapdragon 410 (MSM8916) | MSM8916 Mainlining |
| Qualcomm Snapdragon 730/730G/732G (SM7150) | SM7150 Mainlining |
| Qualcomm Snapdragon 820 (MSM8996) | MSM8996_Mainlining |
| Qualcomm Snapdragon 845 (SDM845) | SDM845 Mainlining |
| All SoCs (if your SoC is not listed above) | Mainlining Guide |