On Thu, 26 Aug 2021 at 11:23, Robert P. J. Day <rpj...@crashcourse.ca>
wrote:

>   so, just to confirm the previous tidbits of information (thank you
> for your patience), here's my current understanding so i can submit
> updated docs:
>
> * pkg_postinst:${PN} is run at image creation time and *only* at image
>   creation time; it is no longer deferred to boot time under any
>   circumstances(?)
>

If a package is installed on directly target using a package management
system,
this will run there. Also, if the snippet does contain an explicit call to
the defer to first boot
hook as a part of its logic, then that will happen, and the same code will
run again on first boot.


> * pkg_postinst_ontarget:${PN} is run at boot time and *only* at boot
>   time
>

First boot, or package installation on target.


> * because of the above, there is no value to the numerous legacy
> checks of:
>
>   if [ -z "$D" ]
>   if [ -n "$D" ]
>
>   or any of its variations (even though, in a lot of cases, they don't
> hurt)
>

There might be use cases for doing explicit manual logic where you want
full control over
a) checking what environment you're in
b) doing first boot deferral.
In that case, you want to use $D and the hook directly. But most are legacy
scriptlets that need converting for readability.



> * from within pkg_postinst:${PN}, you can still defer some work to
>   boot time with "postinst_intercept delay_to_first_boot", although
>   isn't this precisely what pkg_postinst_ontarget:${PN} is for, so is
>   this postinst_intercept construct still useful?
>

_ontarget is basically a wrapper for the delay to first boot hook. It might
be useful
for manual control, as explained above.


> * PACKAGE_WRITE_DEPS is still necessary to identify non-standard
> native tools you might need for any pkg_postinst:${PN} processing
>

Yes.

Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155350): 
https://lists.openembedded.org/g/openembedded-core/message/155350
Mute This Topic: https://lists.openembedded.org/mt/85146007/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to