Skip to contentSkip to conversation

pkg_postinst() versus pkg_postinst_ontarget() contexts?

DISCUSSION Robert P. J. Day 1 participant 1 message Dec 17, 2021

lore
Share & tools
lore
#0 lore raw

next Q in this thread (rather than posting one all-encompassing
post, i'd rather a small set of more focused posts):

so there is the basic distinction between a package's:

pkg_postinst()
pkg_postinst_ontarget()

but let's be precise.

is that first variation ever run *only* during image install
context? that is, there's no weird magic that lets you defer it to on-target time? more precisely, if that package is not installed initially in the image, but is subsequently installed using package management on the target, is it true that it will not be run at all?

conversely, is it true that pkg_postinst_ontarget() will be run only
in on-target install context?

what this means is that a package might conceivably need to define
both, whose only difference is that the first will make reference to ${D} for its work, and the second will not.

or am i misreading this?

rday