Upgrade kernel aports

This article is a step-by-step guide for upgrading kernel aports in postmarketOS, where we have postmarketOS specific patches on top of the package. linux-postmarketos-allwinner is used as example.

Clone the repository
Clone the Linux source (if you don't have it already) and add the source of the kernel you are about to update as remote repository.

Find the new upstream version
Either find the branch or tag scheme where the new version to package can be found by looking at the APKBUILD. In case of megi's kernel, we have tags and can list them with:

The new tag needs to be inserted into the APKBUILD. If the kernel doesn't have tags, find the latest commit of the relevant branch with.

Checkout the new version
Checkout a branch called  and reset it to the new upstream tag or branch:

Apply existing patches
Apply the patches from the package to the newer Linux tree

Patch doesn't apply
If a patch does not apply, it looks like this:

Use  to look at the patch and use   or   to verify if it was already applied to the source tree. In that case, you can skip the patch.

Update the patch files
In the linux source tree:

In the pmaport dir:

Update the  in the APKBUILD and run.