temporary-source-code.rst 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Finding Temporary Source Code
  3. *****************************
  4. You might find it helpful during development to modify the temporary
  5. source code used by recipes to build packages. For example, suppose you
  6. are developing a patch and you need to experiment a bit to figure out
  7. your solution. After you have initially built the package, you can
  8. iteratively tweak the source code, which is located in the
  9. :term:`Build Directory`, and then you can force a re-compile and quickly
  10. test your altered code. Once you settle on a solution, you can then preserve
  11. your changes in the form of patches.
  12. During a build, the unpacked temporary source code used by recipes to
  13. build packages is available in the :term:`Build Directory` as defined by the
  14. :term:`S` variable. Below is the default value for the :term:`S` variable as
  15. defined in the ``meta/conf/bitbake.conf`` configuration file in the
  16. :term:`Source Directory`::
  17. S = "${WORKDIR}/${BP}"
  18. You should be aware that many recipes override the
  19. :term:`S` variable. For example, recipes that fetch their source from Git
  20. usually set :term:`S` to ``${WORKDIR}/git``.
  21. .. note::
  22. The :term:`BP` represents the base recipe name, which consists of the name
  23. and version::
  24. BP = "${BPN}-${PV}"
  25. The path to the work directory for the recipe
  26. (:term:`WORKDIR`) is defined as
  27. follows::
  28. ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}
  29. The actual directory depends on several things:
  30. - :term:`TMPDIR`: The top-level build
  31. output directory.
  32. - :term:`MULTIMACH_TARGET_SYS`:
  33. The target system identifier.
  34. - :term:`PN`: The recipe name.
  35. - :term:`EXTENDPE`: The epoch --- if
  36. :term:`PE` is not specified, which is
  37. usually the case for most recipes, then :term:`EXTENDPE` is blank.
  38. - :term:`PV`: The recipe version.
  39. - :term:`PR`: The recipe revision.
  40. As an example, assume a Source Directory top-level folder named
  41. ``poky``, a default :term:`Build Directory` at ``poky/build``, and a
  42. ``qemux86-poky-linux`` machine target system. Furthermore, suppose your
  43. recipe is named ``foo_1.3.0.bb``. In this case, the work directory the
  44. build system uses to build the package would be as follows::
  45. poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0