diff options
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 24 | ||||
-rw-r--r-- | documentation/ref-manual/ref-variables.xml | 25 |
2 files changed, 44 insertions, 5 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index bdf9cfc241..f9b2910578 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml | |||
@@ -3207,21 +3207,21 @@ | |||
3207 | a package on the target or during image creation when a | 3207 | a package on the target or during image creation when a |
3208 | package is included in an image. | 3208 | package is included in an image. |
3209 | To add a post-installation script to a package, add a | 3209 | To add a post-installation script to a package, add a |
3210 | <filename>pkg_postinst_PACKAGENAME()</filename> function to | 3210 | <filename>pkg_postinst_</filename><replaceable>PACKAGENAME</replaceable><filename>()</filename> function to |
3211 | the recipe file (<filename>.bb</filename>) and replace | 3211 | the recipe file (<filename>.bb</filename>) and replace |
3212 | <filename>PACKAGENAME</filename> with the name of the package | 3212 | <replaceable>PACKAGENAME</replaceable> with the name of the package |
3213 | you want to attach to the <filename>postinst</filename> | 3213 | you want to attach to the <filename>postinst</filename> |
3214 | script. | 3214 | script. |
3215 | To apply the post-installation script to the main package | 3215 | To apply the post-installation script to the main package |
3216 | for the recipe, which is usually what is required, specify | 3216 | for the recipe, which is usually what is required, specify |
3217 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename> | 3217 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename> |
3218 | in place of <filename>PACKAGENAME</filename>. | 3218 | in place of <replaceable>PACKAGENAME</replaceable>. |
3219 | </para> | 3219 | </para> |
3220 | 3220 | ||
3221 | <para> | 3221 | <para> |
3222 | A post-installation function has the following structure: | 3222 | A post-installation function has the following structure: |
3223 | <literallayout class='monospaced'> | 3223 | <literallayout class='monospaced'> |
3224 | pkg_postinst_PACKAGENAME() { | 3224 | pkg_postinst_<replaceable>PACKAGENAME</replaceable>() { |
3225 | # Commands to carry out | 3225 | # Commands to carry out |
3226 | } | 3226 | } |
3227 | </literallayout> | 3227 | </literallayout> |
@@ -3250,7 +3250,7 @@ | |||
3250 | To delay script execution until boot time, use the following | 3250 | To delay script execution until boot time, use the following |
3251 | structure in the post-installation script: | 3251 | structure in the post-installation script: |
3252 | <literallayout class='monospaced'> | 3252 | <literallayout class='monospaced'> |
3253 | pkg_postinst_PACKAGENAME() { | 3253 | pkg_postinst_<replaceable>PACKAGENAME</replaceable>() { |
3254 | if [ x"$D" = "x" ]; then | 3254 | if [ x"$D" = "x" ]; then |
3255 | # Actions to carry out on the device go here | 3255 | # Actions to carry out on the device go here |
3256 | else | 3256 | else |
@@ -3268,6 +3268,20 @@ | |||
3268 | when executed on the first boot. | 3268 | when executed on the first boot. |
3269 | </para> | 3269 | </para> |
3270 | 3270 | ||
3271 | <para> | ||
3272 | If you have recipes that use <filename>pkg_postinst</filename> | ||
3273 | scripts and they require the use of non-standard native | ||
3274 | tools that have dependencies during rootfs construction, you | ||
3275 | need to use the | ||
3276 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_WRITE_DEPS'><filename>PACKAGE_WRITE_DEPS</filename></ulink> | ||
3277 | variable in your recipe to list these tools. | ||
3278 | If you do not use this variable, the tools might be missing and | ||
3279 | execution of the post-installation script is deferred until | ||
3280 | first boot. | ||
3281 | Deferring the script to first boot is undesirable and for | ||
3282 | read-only rootfs impossible. | ||
3283 | </para> | ||
3284 | |||
3271 | <note> | 3285 | <note> |
3272 | Equivalent support for pre-install, pre-uninstall, and | 3286 | Equivalent support for pre-install, pre-uninstall, and |
3273 | post-uninstall scripts exist by way of | 3287 | post-uninstall scripts exist by way of |
diff --git a/documentation/ref-manual/ref-variables.xml b/documentation/ref-manual/ref-variables.xml index 758de36e70..ae2abdeddc 100644 --- a/documentation/ref-manual/ref-variables.xml +++ b/documentation/ref-manual/ref-variables.xml | |||
@@ -9318,6 +9318,31 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3" | |||
9318 | </glossdef> | 9318 | </glossdef> |
9319 | </glossentry> | 9319 | </glossentry> |
9320 | 9320 | ||
9321 | <glossentry id='var-PACKAGE_WRITE_DEPS'><glossterm>PACKAGE_WRITE_DEPS</glossterm> | ||
9322 | <info> | ||
9323 | PACKAGE_WRITE_DEPS[doc] = "Specifies post-installation and pre-installation script dependencies on native/cross tools." | ||
9324 | </info> | ||
9325 | <glossdef> | ||
9326 | <para role="glossdeffirst"> | ||
9327 | <!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> --> | ||
9328 | Specifies a list of dependencies for post-installation and | ||
9329 | pre-installation scripts on native/cross tools. | ||
9330 | If your post-installation or pre-installation script can | ||
9331 | execute at rootfs creation time rather than on the | ||
9332 | target but depends on a native tool in order to execute, | ||
9333 | you need to list the tools in | ||
9334 | <filename>PACKAGE_WRITE_DEPENDS</filename>. | ||
9335 | </para> | ||
9336 | |||
9337 | <para> | ||
9338 | For information on running post-installation scripts, see | ||
9339 | the | ||
9340 | "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-post-installation-scripts'>Post-Installation Scripts</ulink>" | ||
9341 | section in the Yocto Project Development Manual. | ||
9342 | </para> | ||
9343 | </glossdef> | ||
9344 | </glossentry> | ||
9345 | |||
9321 | <glossentry id='var-PACKAGECONFIG'><glossterm>PACKAGECONFIG</glossterm> | 9346 | <glossentry id='var-PACKAGECONFIG'><glossterm>PACKAGECONFIG</glossterm> |
9322 | <info> | 9347 | <info> |
9323 | PACKAGECONFIG[doc] = "This variable provides a means of enabling or disabling features of a recipe on a per-recipe basis." | 9348 | PACKAGECONFIG[doc] = "This variable provides a means of enabling or disabling features of a recipe on a per-recipe basis." |