Skip to content

Build notes

chkndrp edited this page Nov 29, 2026 · 6 revisions

Building this source:

☁️ Building using CI/CD (GitHub actions):

  • GitHub actions can be used to automatically build the kernel
  • It can also be used to build other common kernels, provided the same build structure
  • chkndrp/ack-build-workflow

🌿 Building using Kleaf (Bazel):

Cloning the source, and build environment manually:

  • Before everything, make sure your system has development tools (build-essential on debian, development-tools group on fedora/rhel)
  • There is a custom repo manifest in the readme branch root directory, Download it, and move it into some directory.
    • If you are planning to build a custom source, follow the steps in #Forking before the last step here
  • Expecting the manifest is in the current directory, execute these commands
repo init -u https://android.googlesource.com/kernel/manifest -m $(pwd)/chknkernel.xml
repo sync --fetch-submodules

Building the kernel:

# Standard build with FullLTO
tools/bazel build //common:<build config>

# For faster build with ThinLTO. Recommended for low-RAM build workstations:
tools/bazel build --config=fast //common:<build config>
  • Kleaf accepts this build configuration (so far) (others will be appended in the future):
    • chknkernel
  • After building, the artifacts can be found somewhere at bazel-bin/common/chknkernel

Forking:

When forking this repo, unselect this option!

[x] Copy the "readme" branch only

Then, later in the cloning step (if following the guide and building manually). Edit these lines in the downloaded chknkernel.xml:

<remote name="common-repo" fetch="(YOUR GITHUB USER URL)"/>  

And if you entered a different repository name, or changed branch name. Edit this line as well:

<project path="common" name="(YOUR FORK NAME)" remote="common-repo" revision="(YOUR FORK BRANCH)" >
  <linkfile src="." dest=".source_date_epoch_dir" />
</project>

Upstreaming the source:

  • I usually upstream the source by checking what's the newest tag on google's kernel/common project, and go from there.
  • Example: upstreaming the kernel to latest ACK tag at the moment of this edit.
git remote add ack https://android.googlesource.com/kernel/common
git fetch ack android14-6.1-2026-09
git merge ack/android14-6.1-2026-09

# Then fix merge conflicts if any

Clone this wiki locally