tree: 9a8577fec4110181bbaabaf092e99c71c87c13bc
  1. analysis/
  2. artifact_tests/
  3. bazelrc/
  4. bootstrap_hermetic_tools/
  5. bzlmod/
  6. docs/
  7. impl/
  8. platforms/
  9. tests/
  10. workspace_status_dir/
  11. argp-standalone.BUILD
  12. avb_test.BUILD
  13. bazel.py
  14. bazel.sh
  15. bazelrc_writer.py
  16. bazelrc_writer_test.py
  17. BUILD.bazel
  18. build_cleaner.py
  19. build_cleaner_test.py
  20. buildozer_command_builder.py
  21. check_declared_output_list.py
  22. check_declared_output_list_test.py
  23. check_duplicated_files_in_archives.py
  24. common.bazelrc
  25. common_kernels.bzl
  26. constants.bzl
  27. directory_with_structure.bzl
  28. dwarves.BUILD
  29. dwarves.bzl
  30. fail.bzl
  31. fallback_dtc.BUILD
  32. fallback_kmod.BUILD
  33. hermetic_tools.bzl
  34. kernel.bzl
  35. kernel_prebuilt_ext.bzl
  36. kernel_sbom.py
  37. kernel_toolchain_ext.bzl
  38. key_value_repo.bzl
  39. kleaf_help.py
  40. libcap.BUILD
  41. libcap_ng.BUILD
  42. lz4.BUILD
  43. navbar.md
  44. ndk.BUILD
  45. obstack.BUILD
  46. pigz.BUILD
  47. print_debug.bzl
  48. print_flags.bzl
  49. README.md
  50. rename_kzip.sh
  51. search_and_cp_output.py
  52. spotless_log_regex.txt
  53. toybox.BUILD
  54. update_source_file.bzl
  55. workspace_status.sh
  56. workspace_status_ci.sh
  57. workspace_status_common.sh
  58. workspace_status_stamp.py
  59. zlib.BUILD
  60. zopfli.BUILD
kleaf/README.md

Kleaf - Building Android Kernels with Bazel

Getting started

Introduction to Kleaf

Building your kernels and drivers with Bazel

Building devicetree

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

Kunit with Kleaf

Bug template

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