From 39639ad3eaf8e2841324017d69a819ccef0492db Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Wed, 21 Sep 2016 09:42:31 -0700 Subject: dev-manual: Updates to the "Writing a New Recipe" section. Made several improvements to this section. * fixed a typo where a YP release was referred to as 7.1 instead of 1.7 * Added a note box to the "Using Variables" list item elaborating on the expansion behavior. * Removed the detail around the WORKDIR discussion. * In the "Loccate or Automatically Create a Base Recipe", I added the devtool add method to the list of ways to create a base recipe. (From yocto-docs rev: 79c86fc3653c747ae42f08528063a8984cdd3b4d) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 89 ++++++++++++++-------- 1 file changed, 58 insertions(+), 31 deletions(-) diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 74deac5452..9521c7cd56 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -1254,21 +1254,52 @@ You can always write a recipe from scratch. - However, two choices exist that can help you quickly get a + However, three choices exist that can help you quickly get a start on a new recipe: - recipetool: + + devtool add: + A command that assists in creating a recipe and + an environment condusive to development. + + + recipetool: A tool provided by the Yocto Project that automates creation of a base recipe based on the source files. - Existing Recipes: + + Existing Recipes: Location and modification of an existing recipe that is similar in function to the recipe you need. +
+ Creating the Base Recipe Using <filename>devtool add</filename> + + + The devtool add command uses the same + logic for auto-creating the recipe as + recipetool create, which is listed + below. + Additionally, however, devtool add + sets up an environment that makes it easy for you to + patch the source and to make changes to the recipe as + is often necessary when adding a recipe to build a new + piece of software to be included in a build. + + + + You can find a complete description of the + devtool add command in the + "Use devtool add to Add an Application" + section in the Yocto Project Software Development Kit (SDK) + Developer's Guide. + +
+
Creating the Base Recipe Using <filename>recipetool</filename> @@ -1566,12 +1597,29 @@ or tabs after the slash character. - Using Variables: ${...} - + + Using Variables: ${...} - Use the ${VARNAME} syntax to access the contents of a variable: SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/zlib-${PV}.tar.gz" + + It is important to understand that the value of a + variable expressed in this form does not get + substituted automatically. + The expansion of these expressions happens + on-demand later (e.g. usually when a function that + makes reference to the variable executes). + This behavior ensures that the values are most + appropriate for the context in which they are + finally used. + On the rare occasion that you do need the variable + expression to be expanded immediately, you can use + the := operator instead of + = when you make the + assignment, but this is not generally needed. + Quote All Assignments: "value" - Use double quotes around the value in all variable @@ -1779,11 +1827,12 @@ - The per-recipe temporary work directory is constructed as follows and - depends on several factors: + The path to the per-recipe temporary work directory depends + on the context in which it is being built. + The quickest way to find this path is to have BitBake return it + by running the following: - BASE_WORKDIR ?= "${TMPDIR}/work" - WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}" + $ bitbake -e recipename | grep ^WORKDIR= As an example, assume a Source Directory top-level folder named poky, a default Build Directory at @@ -1817,28 +1866,6 @@ "A Closer Look at the Yocto Project Development Environment" chapter of the Yocto Project Reference Manual. - - - You can also reference the following variables in the - Yocto Project Reference Manual's glossary for more information: - - TMPDIR: - The top-level build output directory - MULTIMACH_TARGET_SYS: - The target system identifier - PN: - The recipe name - EXTENDPE: - The epoch - (if - PE - is not specified, which is usually the case for most - recipes, then EXTENDPE is blank) - PV: - The recipe version - PR: - The recipe revision - -
@@ -2251,7 +2278,7 @@ configure script with some options, or by modifying a build configuration file. - As of Yocto Project Release 7.1, some of the core recipes + As of Yocto Project Release 1.7, some of the core recipes that package binary configuration scripts now disable the scripts due to the scripts previously requiring error-prone path substitution. -- cgit 1.2.3-korg