debugging-buildroot.txt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. [[debugging-buildroot]]
  4. == Debugging Buildroot
  5. It is possible to instrument the steps +Buildroot+ does when building
  6. packages. Define the variable +BR2_INSTRUMENTATION_SCRIPTS+ to contain
  7. the path of one or more scripts (or other executables), in a
  8. space-separated list, you want called before and after each step. The
  9. scripts are called in sequence, with three parameters:
  10. - +start+ or +end+ to denote the start (resp. the end) of a step;
  11. - the name of the step about to be started, or which just ended;
  12. - the name of the package.
  13. For example :
  14. ----
  15. make BR2_INSTRUMENTATION_SCRIPTS="/path/to/my/script1 /path/to/my/script2"
  16. ----
  17. The list of steps is:
  18. - +extract+
  19. - +patch+
  20. - +configure+
  21. - +build+
  22. - +install-host+, when a host-package is installed in +$(HOST_DIR)+
  23. - +install-target+, when a target-package is installed in +$(TARGET_DIR)+
  24. - +install-staging+, when a target-package is installed in +$(STAGING_DIR)+
  25. - +install-image+, when a target-package installs files in +$(BINARIES_DIR)+
  26. The script has access to the following variables:
  27. - +BR2_CONFIG+: the path to the Buildroot .config file
  28. - +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+: see
  29. xref:generic-package-reference[]
  30. - +BUILD_DIR+: the directory where packages are extracted and built
  31. - +BINARIES_DIR+: the place where all binary files (aka images) are
  32. stored
  33. - +BASE_DIR+: the base output directory