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

Advanced topics

Handling SCM version

Building against downloaded prebuilts

Customize workspace

Bzlmod support for Kleaf

Building compile_commands.json

Ensuring hermeticity

Internet Access

Toolchain resolution

Checkpatch

Kleaf Development

Configurations in command line

--config=fast: Make local builds faster

--config=local: Sandboxing

--config=release: Release builds

--config=stamp: Handling SCM version

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