temporary-source-code.rst 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 = "${UNPACKDIR}/${BP}"
  18. You should be aware that many recipes override the
  19. :term:`S` variable when the default isn't accurate.
  20. .. note::
  21. The :term:`BP` represents the base recipe name, which consists of the name
  22. and version::
  23. BP = "${BPN}-${PV}"
  24. This matches the location that the git fetcher unpacks to, and usually
  25. matches unpacked content of release tarballs (e.g. they contain a single
  26. directory which matches value of ${BP} exactly).
  27. The path to the unpack directory for the recipe
  28. (:term:`UNPACKDIR`) is defined as follows::
  29. ${WORKDIR}/sources
  30. In turn, the path to the work directory for the recipe
  31. (:term:`WORKDIR`) is defined as
  32. follows::
  33. ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}
  34. The actual directory depends on several things:
  35. - :term:`TMPDIR`: The top-level build
  36. output directory.
  37. - :term:`MULTIMACH_TARGET_SYS`:
  38. The target system identifier.
  39. - :term:`PN`: The recipe name.
  40. - :term:`EXTENDPE`: The epoch --- if
  41. :term:`PE` is not specified, which is
  42. usually the case for most recipes, then :term:`EXTENDPE` is blank.
  43. - :term:`PV`: The recipe version.
  44. - :term:`PR`: The recipe revision.
  45. As an example, assume a Source Directory top-level folder named
  46. ``poky``, a default :term:`Build Directory` at ``poky/build``, and a
  47. ``qemux86-poky-linux`` machine target system. Furthermore, suppose your
  48. recipe is named ``foo_1.3.0.bb``. In this case, the work directory the
  49. build system uses to build the package would be as follows::
  50. poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0