English | 中文
This Github Action helps you build kernels. It reads multiple kernel sources from a configuration file and builds them using different toolchains. Additionally, it supports patching the kernel with KernelSU and uploading the built kernel image.
Configure
Quick Start
Local testing
This action contains two jobs: Set-repos and Build-Kernel.
The Set-repos job reads the kernel sources from the configuration file and outputs them to the Build-Kernel job. The Build-Kernel job uses the outputted kernel sources to build the kernels and upload the built kernel images.
| Event name | Description |
|---|---|
| workflow_dispatch | Manually run |
| Step | Description |
|---|---|
| Install prerequisites | Install the necessary dependencies for building the kernel |
| Setup Anykernel3 | Clone the Anykernel3 repository to prepare for packaging the kernel |
| Clone kernel source | Clone the kernel source code repository for the Android device |
| Get toolchains | Obtain the required cross-compilation toolchains for building the kernel |
| Set args | Set the necessary build parameters for the kernel |
| Update KernelSU | Update the KernelSU tool to ensure compatibility with the new kernel |
| Make defconfig | Generate the kernel configuration file |
| Build kernel | Compile the kernel source code to create the kernel image |
| Upload Image | Upload the kernel image file to a designated location |
| Upload Image.gz | Upload the compressed kernel image file to a designated location |
| Upload dtb | Upload the device tree blob file to a designated location |
| Upload dtbo.img | Upload the device tree overlay image file to a designated location |
| Pack AnyKernel3.zip | Package the kernel image and device tree files into an Anykernel3 zip file |
| Upload AnyKernel3 image | Upload the Anykernel3 zip file to a designated location |
| Create GitHub Release | Create a new release on GitHub to share the kernel with the community |
See repo configuration file guidance.
This project's basic usage is as follows:
-
Fork this project on GitHub.
-
Modify the
repos/repos*.jsonfile through the Github website or pull it to your local machine and commit the changes. -
Go to the
Actionpage on Github and findBuild kernels, thenRun workflow.
Notice
In this step, you may encounter the following error when executing
softprops/action-gh-release@v1:👩🏭 Creating new GitHub release for tag v20230619.7... ⚠️ GitHub release failed with status: 403 undefined retrying... (2 retries remaining) 👩🏭 Creating new GitHub release for tag v20230619.7... ⚠️ GitHub release failed with status: 403 undefined retrying... (1 retries remaining) 👩🏭 Creating new GitHub release for tag v20230619.7... ⚠️ GitHub release failed with status: 403 undefined retrying... (0 retries remaining) ❌ Too many retries. Aborting... Error: Too many retries.The reason for this error is related to workflow permissions:
Complete the permission settings and then you can publish your own
Releasenormally.
-
Wait for the compilation to finish, then download the compiled product from the corresponding page.
-
Use your preferred packaging software to package the kernel (AnyKernel3, Android-Image-Kitchen, MagiskBoot, etc.)
If you don't want to run the action on Github, you can use nektos/act to test this workflow locally and output the files.
This is the recommended local testing process. Simply install nektos/act and run the following command:
# Collect artifacts to /tmp/artifacts folder:
act --artifact-server-path /tmp/artifactsIf you want to store the artifacts in a different location, change /tmp/artifacts to your preferred directory.
If there are errors, use the -v flag to generate an error report and submit an issue. Here's the command:
# Collect artifacts to /tmp/artifacts folder:
act --artifact-server-path /tmp/artifacts -vIf you need to perform a completely local build, consider building as follows:
-
Set up a local
GiteaorGitlabGit service and modify the configuration file address to point to the local service address. -
Use
git daemonto create a secondary image locally.
This is just a suggestion, and we do not provide a specific guide.
- Use
MagiskBootto generateboot.img - Web page for configuring profiles
- weishu : Developer of KernelSU
- AKR Android Developer Community : Provides build tutorials
- DogDayAndroid/KSU_Thyme_BuildBot : Predecessor of this project
- xiaoleGun/KernelSU_Action : Drawing on some Github Actions
- UtsavBalar1231/Drone-scripts : Drawing on some Github Actions
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.


