Recipes which have pkg_postinst scripts have to use PACKAGE_WRITE_DEPS to define dependencies on any non-standard native tool that might be required during rootfs construction, otherwise the tool might be missing and execution of the postinst gets deferred to first boot, which is undesirable and not even possible in a read-only rootfs. This variable and the general concept (how to define dependencies of scripts) needs to be explained in http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#new-recipe-post-installation-scripts See also http://stackoverflow.com/questions/43067776/linux-capabilities-with-yocto/43109887#43109887 which has a real example. For more information on PACKAGE_WRITE_DEPS and how it is used, see commit aff8ca95b8303a4a2a5600c0d8ec0a50ad677258 Author: Richard Purdie <richard.purdie@linuxfoundation.org> Date: Thu Jan 19 16:49:00 2017 +0000 classes/package*: Add support for PACKAGE_WRITE_DEPS Add a new variable to allow markup of postinstall (and preinst) script dependnecies on native/cross tools. If your postinstall can execute at rootfs creation time rather than on target but depends on a native tool in order to execute, you need to list that tool in PACKAGE_WRITE_DEPENDS. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Hi Patrick, See http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#new-recipe-post-installation-scripts for a new paragraph at the end of the section for describing this situation. See http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#var-PACKAGE_WRITE_DEPS for the new glossary entry for PACKAGE_WRITE_DEPS. Please read them over and let me know of any adjustments. Thanks, Scott
(In reply to comment #1) > Hi Patrick, > > See > http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#new-recipe- > post-installation-scripts for a new paragraph at the end of the section for > describing this situation. The "Note: Equivalent support for pre-install, pre-uninstall..." might be misunderstood as referring to PACKAGE_WRITE_DEPS in the preceding paragraph, which then begs the question of whether there are separate variables for those. I would reorder and slightly reword as: The previous example delays execution until the image boots again because the environment variable D points to the directory containing the image when the root filesystem is created at build time but is unset when executed on the first boot. Note Equivalent support for pre-install, pre-uninstall, and post-uninstall scripts .... If you have recipes that use [PO: pkg_postinst deleted here] scripts and they require the use of non-standard native tools that have dependencies during rootfs construction, you need to use the PACKAGE_WRITE_DEPS variable in your recipe to list these tools. If you do not use this variable, the tools might be missing and execution of the post-installation script is deferred until first boot. Deferring the script to first boot is undesirable and for read-only rootfs impossible. > See > http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#var- > PACKAGE_WRITE_DEPS for the new glossary entry for PACKAGE_WRITE_DEPS. Looks good.
Thanks Patrick, Setting to RESOLVED and marking the doc flag as "done." Scott
Hello, I know this bug is solved and closed, but I'm sorry I'm facing a problem with an old version of Yocto. Can you please check my question on stackoverflow: http://stackoverflow.com/questions/43476801/use-linux-setcap-command-to-set-capabilities-during-yocto-build
Hi Sherif, These package dependencies are varied and specific to all sorts of distros and on what a person is trying to do. I am probably not the appropriate person to assign to this bug. I don't figure these things out... I document the results after someone else figures out the problem/solution with the system and the circumstances. I will CC some people here on the bug but cannot dig into a solution. Sorry I can't be of more immediate help on this. Scott