Read this in other languages: English, 中文.
This GitHub Action automates the process of building Android kernel drivers in the cloud, eliminating the need for local compilation environments. It solves common issues like accessing Google's source repositories and reduces compilation time to under 30min.
- ✅ Cloud-based compilation - No local setup required
- ✅ Automatic source handling - Fetches official Android kernel sources
- ✅ Version-aware building - Automatically selects correct build system
- ✅ Parameterized inputs - Customize builds via workflow inputs
- ✅ Artifact packaging - Downloads compiled drivers and kernel images
- Create a
codedirectory in your repository - Place these files in the
codedirectory:- Driver source files (
.cand.h) Makefilefor your driver- Any additional dependencies
- Driver source files (
- Go to your GitHub repository's Actions tab
- Select Android Kernel Driver Builder
- Click Run workflow
- Provide these parameters:
android_version: Your Android version (Kernel) (e.g.,14)kernel_version: Kernel version (e.g.,6.1)driver_name: Your driver filename (e.g.,mydriver.ko)target_arch: Device architecture (default:aarch64)
After successful compilation (30minutes):
- Go to the completed workflow run
- Download the
kernel-driver-<arch>artifact - Extract to find:
- Compiled driver (
.kofile) - Kernel images (
boot.img) - Build logs
- Compiled driver (
| Parameter | Description | Example |
|---|---|---|
android_version |
Android OS version | 11, 12, 13, 14 |
kernel_version |
Linux kernel version | 5.10, 5.15, 6.1 |
driver_name |
Output driver filename | custom_driver.ko |
target_arch |
Device CPU architecture | aarch64, x86_64 |
-
Build System Selection:
- Android 11 and earlier: Legacy
build.shsystem - Android 12 and later: Modern Bazel build system
- Android 11 and earlier: Legacy
-
Source Management:
- Automatically fetches kernel sources from Google's repositories
- Uses parallel downloading for faster sync
-
Driver Integration:
- Automatically adds driver to kernel build system
- Registers driver as GKI module
- Handles Makefile modifications
Q: Build fails with "repo sync" errors
A: Retry the workflow. Google's servers can occasionally timeout.
Q: Driver not found in output artifacts
A: Verify:
- Correct
driver_nameparameter (must match Makefile) - Source files are in
/codedirectory - Makefile produces expected
.kofilename
Q: "Kernel configuration not found" error
A: Confirm your kernel_version matches existing branches at Android Kernel Sources
For issues and feature requests:
- Open an Issue
- Provide workflow logs and input parameters