Effortlessly building Android Generic Kernel Image (GKI).
- Linux
- Python 3.12
-
Debian-based
sudo apt update sudo apt install --no-install-recommends \ bc bison ccache curl flex git tar wget aria2 jq make
-
Fedora
sudo dnf install bc bison ccache curl flex git tar wget aria2 jq make
curl -LsSf https://astral.sh/uv/install.sh | sh
uv --versionNote
If your distro already ships Python 3.12, you can skip this step.
uv python install 3.12
uv run -p 3.12 -- python -V # should print 3.12.x-
Clone the repository:
git clone --recurse-submodule https://github.com/bachnxuan/gki_kernel_builder.git cd gki_kernel_builder -
Set up venv:
uv sync --frozen --no-install-project source .venv/bin/activateOnce you are finished working with the project, disable the virtual environment (venv) via
deactivate.
Builds are performed via the custom wrapper script cli.sh
Note
PAT scopes (read and write): workflow, content
- Rename
.env.templateto.env - Fill in the GH_TOKEN in
.env
To build your kernel with default configuration:
./cli.sh buildThe CLI consists of the following commands:
-
build - Configure and compile the kernel
-
clean - Clean up build artifacts
View all available options:
./cli.sh --helpBuild KernelSU NEXT with SUSFS (no LXC):
./cli.sh build -k NEXT -sBuild SukiSU with LXC without SUSFS:
./cli.sh build --ksu SUKI --no-susfs --lxc-
Fork this repo to your GitHub account.
-
Add secret
GH_TOKEN- PAT scopes (read and write):
workflow,content - Add PAT access to your release and kernel builder repo
- Repo → Settings → Secrets → Actions → New secret.
- PAT scopes (read and write):
-
Optional Telegram secrets
Note
Add the below Telegram secrets below when you want to notify completed build on Telegram.
The Telegram notify feature can be config via NOTIFY on workflows_dispatch and workflows_call input.
TG_BOT_TOKEN– Telegram Bot TokenTG_CHAT_ID– Telegram Chat ID
Warning
If you build a GKI kernel for devices other than xaga (ESK Kernel), set LXC to false or remove the LXC function entirely.
Customize your build by:
config/config.py– Contains kernel configuration settings.config/manifest.py– Specifies repository sources and branches.kernel_builder.py– The main script responsible for orchestrating the build.
Note
See the dedicated guide for more information: Kernel Builder Configuration guide
This project is distributed under the GNU GPL v3. See LICENSE for details.