tree: ae3fdfd173a42aa88940b2c74261a27d75d692a1 [path history] [tgz]
  1. analysis/
  2. artifact_tests/
  3. bazelrc/
  4. bzlmod/
  5. docs/
  6. impl/
  7. platforms/
  8. tests/
  9. workspace_status_dir/
  10. bazel.py
  11. bazel.sh
  12. BUILD.bazel
  13. build_cleaner.py
  14. build_cleaner_test.py
  15. buildozer_command_builder.py
  16. check_declared_output_list.py
  17. check_declared_output_list_test.py
  18. check_duplicated_files_in_archives.py
  19. common.bazelrc
  20. common_kernels.bzl
  21. constants.bzl
  22. directory_with_structure.bzl
  23. fail.bzl
  24. hermetic_tools.bzl
  25. kernel.bzl
  26. kernel_prebuilt_ext.bzl
  27. kernel_sbom.py
  28. kernel_toolchain_ext.bzl
  29. key_value_repo.bzl
  30. kleaf_help.py
  31. libcap.BUILD
  32. libcap_ng.BUILD
  33. lz4.BUILD
  34. navbar.md
  35. ndk.BUILD
  36. pigz.BUILD
  37. print_debug.bzl
  38. print_flags.bzl
  39. README.md
  40. rename_kzip.sh
  41. search_and_cp_output.py
  42. spotless_log_regex.txt
  43. toybox.BUILD
  44. update_source_file.bzl
  45. workspace_status.sh
  46. workspace_status_common.sh
  47. workspace_status_stamp.py
  48. zlib.BUILD
  49. zopfli.BUILD
kleaf/README.md

Kleaf - Building Android Kernels with Bazel

Table of contents

Getting started

Introduction to Kleaf

Building your kernels and drivers with Bazel

Creating distributions

Driver Development Kit (DDK)

Cheatsheet

Configuring your build

build.sh build configs

Configuring kernel_build

ABI monitoring

Support ABI monitoring (GKI)

Support ABI monitoring (Device)

Debugging and testing

Resolving common errors

Kleaf testing

Debugging Kleaf

Visualizing dependencies

Advanced topics

Handling SCM version

Building against downloaded prebuilts

Bzlmod support (also: setting up workspace)

Building compile_commands.json

Ensuring hermeticity

Internet Access

Toolchain resolution

Checkpatch

Kleaf Development

Discover newest Kleaf features in Canary

Configurations in command line

--config=fast: Make local builds faster

--config=local: Sandboxing

--config=release: Release builds

--config=stamp: Handling SCM version

--config=canary: Kleaf Canary Features

--config=musl: Use musl libc for host binaries

Flags

For a full list of flags, run

$ tools/bazel help kleaf

--gcov: Keep GCOV files

--kasan: kasan

--kbuild_symtypes: KBUILD_SYMTYPES

--kgdb: GDB scripts

--lto: Configure LTO during development

--notrim: Disables TRIM_NONLISTED_KMI globally.

--btf_debug_info: Enable/disable BTF debug information

--gki_build_config_fragment: Supporting GKI_BUILD_CONFIG_FRAGMENT on Kleaf

--defconfig_fragment: Defconfig fragments

Other flags for debugging and disabling integrity checks may be found in the Debugging Kleaf page.

References

References to Bazel rules and macros for the Android Kernel