esk builder builds Linux kernel packages for two targets:
devicebuilds the phone kernel configured by the current builder branch.genericbuilds the generic Android Generic Kernel Image (GKI) target.
The build downloads the selected kernel source and required tools, applies the enabled patches, compiles the kernel, and writes packages to out/.
AnyKernel3 is the flashable zip layout used to package the compiled kernel for both targets.
| target | use it for | configuration | main output |
|---|---|---|---|
device |
The device supported by the current builder branch | The branch-specific device block in config.sh |
An AnyKernel3 zip with the device modules |
generic |
The separate generic GKI build | The generic case in config.sh |
An AnyKernel3 zip and raw, gzip, and LZ4 boot images |
device is the build target name. The native device codename is the value of DEVICE_NAME in config.sh; it identifies the configured device but is not a valid build target. Use device or generic in commands, never the codename.
The checked-out builder branch controls the device identity, kernel and AnyKernel3 repositories, source branch, defconfig (kernel build configuration) overlay, release repository, and supported device features. Check the first block of config.sh before a device build instead of relying on values copied from another branch.
just build uses the default target, which is device. Use just generic only when you want the separate generic GKI build.
This is a Linux-only Bash and Python project. Clone or check out the builder branch for the device you want, then run every command below from the repository root.
The first build needs network access. It downloads the kernel source, AnyKernel3, Android build tools, mkbootimg, an AOSP Clang toolchain, and libfakestat. A generic build also downloads a certified GKI archive for its boot image template.
Ubuntu 24.04 or newer and Debian 13 or newer:
sudo apt update
sudo apt install \
aria2 bc bison bsdextrautils build-essential ccache curl flex git gzip just \
kmod libfaketime llvm lz4 patch python3 shellcheck shfmt tar unzip xz-utils \
zip zstdFedora:
sudo dnf install \
aria2 bc bison ccache curl flex gcc git gzip just kmod libfaketime llvm lz4 \
make patch python3 ShellCheck shfmt tar unzip util-linux xz zip zstdInstall uv if it is not already available:
curl -LsSf https://astral.sh/uv/install.sh | shRestart the shell if the installer asks you to update PATH, then verify the two project commands:
just --version
uv --versionSet up the Python 3.14 helper environment and run the default device build:
uv python install 3.14
uv sync --project py --locked --no-dev
just buildThe first two commands create py/.venv with the runtime dependencies used by the Bash build. just build then runs build.sh with the branch-configured device target. Build packages appear in out/; build.log and github.json appear at the repository root.
To build the generic target instead:
just genericWarning
Treat kernel/, anykernel3/, build-tools/, mkbootimg/, and susfs/ as build-managed checkouts. A build cleans and resets existing source repositories, and it recreates anykernel3/, out/, and boot_image/. Do not keep source changes or untracked files in those directories. RESET_SOURCES=true deletes and reclones the managed source directories before continuing.
List the available commands:
just --listBuild the current BUILD_TARGET, which defaults to device:
just buildBuild the branch-configured device explicitly:
just deviceBuild generic GKI:
just genericPass build settings after the recipe name:
just device KSU=true SUSFS=true LXC=falseThe recipes pass these values to build.sh as environment variables.
The default settings live in config.sh. Override the supported settings for one command as shown above, or export them before running just build.
| variable | purpose | accepted values | default |
|---|---|---|---|
BUILD_TARGET |
Select the build target | device, generic |
device |
KSU |
Add KernelSU | Boolean | false |
SUSFS |
Add SuSFS to a KernelSU build | Boolean | false |
LXC |
Apply the Linux Containers (LXC) patch | Boolean | false |
STOCK_CONFIG |
Apply the stock configuration patch | auto, true, false |
auto: device resolves to false, generic resolves to true |
BRANCH_OVERRIDE |
Override the selected target's kernel source branch | Branch name | Device value from config.sh; generic uses main |
JOBS |
Set parallel make jobs |
Integer | nproc --all |
CCACHE_SIZE |
Set the compiler cache size | A ccache size such as 2G |
2G |
RESET_SOURCES |
Delete and reclone managed source directories before the build | Boolean | false locally, true in GitHub Actions |
TG_NOTIFY |
Send Telegram build messages and packages | Boolean | false locally; true when unset in GitHub Actions |
IS_RELEASE |
Use release package naming without the kernel commit suffix | Boolean | false |
GH_TOKEN |
Authenticate GitHub API requests for release assets | Token string | Unset |
TG_BOT_TOKEN |
Authenticate the Telegram bot | Token string | Unset |
TG_CHAT_ID |
Select the Telegram destination | Chat ID | Unset |
Boolean values accept true/false, t/f, yes/no, y/n, on/off, and 1/0. Only STOCK_CONFIG accepts auto. Invalid values stop the build with an error.
Feature rules:
KSU=trueruns the KernelSU setup script fromESK-Project/ReSukiSU@main.SUSFS=truerequiresKSU=trueand applies the configured SuSFS patches.LXC=trueis valid only fordevice, and only when that branch setsDEVICE_LXC_SUPPORTED=trueinconfig.sh.STOCK_CONFIG=autofollows the target defaults shown in the table.BRANCH_OVERRIDEchanges only the selected kernel source branch. It does not switch the builder branch or changeDEVICE_NAME.TG_NOTIFY=truerequires bothTG_BOT_TOKENandTG_CHAT_ID.- The release workflow passes
TG_NOTIFY=false; other GitHub Actions builds use their workflow input. GH_TOKENis optional for local builds. Without it, GitHub API requests can be rate-limited. GitHub Actions requires the token when the needed release assets are not already cached.
Common configuration errors are reported before compilation. If a build rejects a codename as an unknown target, use device. If it rejects SuSFS, enable KernelSU too. If it rejects LXC, select a branch whose device configuration supports LXC or disable it.
Each build clears out/ before packaging. <package> has the form ${KERNEL_NAME}-${KERNEL_VERSION}-${VARIANT}. Local builds append -${KERNEL_COMMIT}; release builds do not.
VNL means KernelSU is disabled. KSU means it is enabled. Enabled SuSFS and LXC features add -SUSFS and -LXC to the variant.
| path | target | description |
|---|---|---|
out/<package>-AnyKernel3.zip |
Both | Flashable AnyKernel3 package containing the compiled kernel |
out/module.tar.xz |
Device | Staged vendor_boot and vendor_dlkm modules, also copied into the AnyKernel3 package |
out/<package>-boot-raw.img |
Generic | Boot image containing the raw kernel image |
out/<package>-boot-gz.img |
Generic | Boot image containing the gzip-compressed kernel image |
out/<package>-boot-lz4.img |
Generic | Boot image containing the LZ4-compressed kernel image |
github.json |
Both | Release metadata, including the kernel commit, toolchain, package name, output directory, and release repository |
build.log |
Both | Build log |
work/ |
Both | Kernel compilation output used to create the packages |
For local development, install the Python development dependencies instead of the runtime-only environment:
uv sync --project py --lockedCheck formatting without changing files:
just fmt-checkRun all shell formatting, shell syntax, ShellCheck, Ruff, and Python type checks:
just checkjust --list also shows the individual bash-check, lint, py-lint, and py-check recipes.
Format tracked shell scripts in place:
just fmtRemove out/, work/, staged/, boot_image/, build.log, and github.json. This does not remove downloaded source or tool directories:
just cleanbuild.sh: top-level build flow and validationconfig.sh: branch-owned device settings, generic target settings, defaults, repositories, and pathsbuild/: source setup, patching, toolchain setup, and kernel compilationci/: module handling, packaging, metadata, and Telegram notificationspy/: uv-managed Python 3.14 helper CLI for API and JSON workmodules/: branch-ownedmodules.loadfiles used by device packagingkernel_patches/: optional stock configuration and LXC patches.github/matrix/: release feature combinations for each target.github/workflows/: checks, manual builds, and release workflows