From d9cf5753df7355b30309cc0640c2180eb3b38780 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Tue, 5 May 2015 12:57:00 -0700 Subject: ref-manual: Added and updated variables to support calling functions Fixed [YOCTO #7632] Looked for, updated, and added (if necessary) the following variables: * ROOTFS_PREPROCESS_COMMAND * ROOTFS_POSTPROCESS_COMMAND * SDK_POSTPROCESS_COMMAND * POPULATE_SDK_POST_TARGET_COMMAND * POPULATE_SDK_POST_HOST_COMMAND, * IMAGE_POSTPROCESS_COMMAND * IMAGE_PREPROCESS_COMMAND * ROOTFS_POSTUNINSTALL_COMMAND * ROOTFS_POSTINSTALL_COMMAND Each of these variables no longer accepts arbitrary shell commands but rather functions. The wordings now support that behavior. Also, updated the migration section for going to 1.6 release to note this change. (From yocto-docs rev: e1ab48f7def9d1eb080e007b88f75172470b8007) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/ref-manual/migration.xml | 29 ++++ documentation/ref-manual/ref-variables.xml | 229 +++++++++++++++++++++++++++-- 2 files changed, 243 insertions(+), 15 deletions(-) diff --git a/documentation/ref-manual/migration.xml b/documentation/ref-manual/migration.xml index 7c78c9dd50..984485ede2 100644 --- a/documentation/ref-manual/migration.xml +++ b/documentation/ref-manual/migration.xml @@ -1413,6 +1413,35 @@ it encounters the variable. + +
+ Preprocess and Post Process Command Variable Behavior + + + The following variables now expect a semicolon separated + list of functions to call and not arbitrary shell commands: + + ROOTFS_PREPROCESS_COMMAND + ROOTFS_POSTPROCESS_COMMAND + SDK_POSTPROCESS_COMMAND + POPULATE_SDK_POST_TARGET_COMMAND + POPULATE_SDK_POST_HOST_COMMAND + IMAGE_POSTPROCESS_COMMAND + IMAGE_PREPROCESS_COMMAND + ROOTFS_POSTUNINSTALL_COMMAND + ROOTFS_POSTINSTALL_COMMAND + + For migration purposes, you can simply wrap shell commands in + a shell function and then call the function. + Here is an example: + + my_postprocess_function() { + echo "hello" > ${IMAGE_ROOTFS}/hello.txt + } + ROOTFS_POSTPROCESS_COMMAND += "my_postprocess_function; " + + +
diff --git a/documentation/ref-manual/ref-variables.xml b/documentation/ref-manual/ref-variables.xml index dfe775b23f..e70445762f 100644 --- a/documentation/ref-manual/ref-variables.xml +++ b/documentation/ref-manual/ref-variables.xml @@ -5433,24 +5433,50 @@ IMAGE_POSTPROCESS_COMMAND - IMAGE_POSTPROCESS_COMMAND[doc] = "Added by classes to run post processing commands once the OpenEmbedded build system has created the image." + IMAGE_POSTPROCESS_COMMAND[doc] = "Specifies a list of functions to call once the OpenEmbedded build system has created the final image output files." - Added by classes to run post processing commands once the - OpenEmbedded build system has created the image. - You can specify shell commands separated by semicolons: + Specifies a list of functions to call once the + OpenEmbedded build system has created the final image + output files. + You can specify functions separated by semicolons: - IMAGE_POSTPROCESS_COMMAND += "shell_command; ... " + IMAGE_POSTPROCESS_COMMAND += "function; ... " - If you need to pass the path to the root filesystem within - the command, you can use + If you need to pass the root filesystem path to a command + within the function, you can use ${IMAGE_ROOTFS}, which points to - the root filesystem image. + the directory that becomes the root filesystem image. + + + + + IMAGE_PREPROCESS_COMMAND + + IMAGE_PREPROCESS_COMMAND[doc] = "Specifies a list of functions to call before the OpenEmbedded build system has created the final image output files." + + + + + Specifies a list of functions to call before the + OpenEmbedded build system has created the final image + output files. + You can specify functions separated by semicolons: + + IMAGE_PREPROCESS_COMMAND += "function; ... " + + + + + If you need to pass the root filesystem path to a command + within the function, you can use + ${IMAGE_ROOTFS}, which points to + the directory that becomes the root filesystem image. @@ -8948,6 +8974,64 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3" + POPULATE_SDK_POST_HOST_COMMAND + + POPULATE_SDK_POST_HOST_COMMAND[doc] = "Specifies a list of functions to call once the OpenEmbedded build system has created host part of the SDK." + + + + + Specifies a list of functions to call once the + OpenEmbedded build system has created the host part of + the SDK. + You can specify functions separated by semicolons: + + POPULATE_SDK_POST_HOST_COMMAND += "function; ... " + + + + + If you need to pass the SDK path to a command + within a function, you can use + ${SDK_DIR}, which points to + the parent directory used by the OpenEmbedded build + system when creating SDK output. + See the + SDK_DIR + variable for more information. + + + + + POPULATE_SDK_POST_TARGET_COMMAND + + POPULATE_SDK_POST_TARGET_COMMAND[doc] = "Specifies a list of functions to call once the OpenEmbedded build system has created target part of the SDK." + + + + + Specifies a list of functions to call once the + OpenEmbedded build system has created the target part of + the SDK. + You can specify functions separated by semicolons: + + POPULATE_SDK_POST_TARGET_COMMAND += "function; ... " + + + + + If you need to pass the SDK path to a command + within a function, you can use + ${SDK_DIR}, which points to + the parent directory used by the OpenEmbedded build + system when creating SDK output. + See the + SDK_DIR + variable for more information. + + + + PR PR[doc] = "The revision of the recipe. The default value for this variable is 'r0'." @@ -9691,26 +9775,113 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3" + ROOTFS_POSTINSTALL_COMMAND + + ROOTFS_POSTINSTALL_COMMAND[doc] = "Specifies a list of functions to call after installing packages." + + + + + Specifies a list of functions to call after the + OpenEmbedded build system has installed packages. + You can specify functions separated by semicolons: + + ROOTFS_POSTINSTALL_COMMAND += "function; ... " + + + + + If you need to pass the root filesystem path to a command + within a function, you can use + ${IMAGE_ROOTFS}, which points to + the directory that becomes the root filesystem image. + See the + IMAGE_ROOTFS + variable for more information. + + + + ROOTFS_POSTPROCESS_COMMAND - ROOTFS_POSTPROCESS_COMMAND[doc] = "Added by classes to run post processing commands once the OpenEmbedded build system has created the root filesystem." + ROOTFS_POSTPROCESS_COMMAND[doc] = "Specifies a list of functions to call once the OpenEmbedded build system has created the root filesystem." + + + + + Specifies a list of functions to call once the + OpenEmbedded build system has created the root filesystem. + You can specify functions separated by semicolons: + + ROOTFS_POSTPROCESS_COMMAND += "function; ... " + + + + + If you need to pass the root filesystem path to a command + within a function, you can use + ${IMAGE_ROOTFS}, which points to + the directory that becomes the root filesystem image. + See the + IMAGE_ROOTFS + variable for more information. + + + + + ROOTFS_POSTUNINSTALL_COMMAND + + ROOTFS_POSTUNINSTALL_COMMAND[doc] = "Specifies a list of functions to call after removal of unneeded packages." + + + + + Specifies a list of functions to call after the + OpenEmbedded build system has removed unnecessary + packages. + When runtime package management is disabled in the + image, several packages are removed including + base-passwd, + shadow, and + update-alternatives. + You can specify functions separated by semicolons: + + ROOTFS_POSTUNINSTALL_COMMAND += "function; ... " + + + + + If you need to pass the root filesystem path to a command + within a function, you can use + ${IMAGE_ROOTFS}, which points to + the directory that becomes the root filesystem image. + See the + IMAGE_ROOTFS + variable for more information. + + + + + ROOTFS_PREPROCESS_COMMAND + + ROOTFS_PREPROCESS_COMMAND[doc] = "Specifies a list of functions to call before the OpenEmbedded build system has created the root filesystem." - Added by classes to run post processing commands once the + Specifies a list of functions to call before the OpenEmbedded build system has created the root filesystem. - You can specify shell commands separated by semicolons: + You can specify functions separated by semicolons: - ROOTFS_POSTPROCESS_COMMAND += "shell_command; ... " + ROOTFS_PREPROCESS_COMMAND += "function; ... " - If you need to pass the path to the root filesystem within - the command, you can use + If you need to pass the root filesystem path to a command + within a function, you can use ${IMAGE_ROOTFS}, which points to - the root filesystem image. + the directory that becomes the root filesystem image. See the IMAGE_ROOTFS variable for more information. @@ -10182,6 +10353,34 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3" + SDK_POSTPROCESS_COMMAND + + SDK_POSTPROCESS_COMMAND[doc] = "Specifies a list of functions to call once the OpenEmbedded build system has created the SDK." + + + + + Specifies a list of functions to call once the + OpenEmbedded build system has created the SDK. + You can specify functions separated by semicolons: + + SDK_POSTPROCESS_COMMAND += "function; ... " + + + + + If you need to pass an SDK path to a command within a + function, you can use + ${SDK_DIR}, which points to + the parent directory used by the OpenEmbedded build system + when creating SDK output. + See the + SDK_DIR + variable for more information. + + + + SDK_PREFIX SDK_PREFIX[doc] = "The toolchain binary prefix used for nativesdk recipes." -- cgit v1.2.3-54-g00ecf