tree: 1636366b71b273ba3d27f4de0e5018b2f94c1da0 [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_prebuilt_ext.bzl
  32. kernel_sbom.py
  33. kernel_toolchain_ext.bzl
  34. key_value_repo.bzl
  35. kleaf_help.py
  36. libcap.BUILD
  37. libcap_ng.BUILD
  38. navbar.md
  39. ndk.BUILD
  40. pigz.BUILD
  41. print_debug.bzl
  42. print_flags.bzl
  43. README.md
  44. rename_kzip.sh
  45. search_and_cp_output.py
  46. update_source_file.bzl
  47. workspace.bzl
  48. workspace_epilog.bzl
  49. workspace_status.sh
  50. workspace_status_common.sh
  51. workspace_status_stamp.py
  52. 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