All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: YP docs mailing list <docs@lists.yoctoproject.org>
Subject: trying (again) to clarify pkg_postinst[_ontarget]
Date: Fri, 17 Dec 2021 08:35:42 -0500 (EST)	[thread overview]
Message-ID: <f63931-692c-7af-251c-6f6dfdb0451e@crashcourse.ca> (raw)


  i know i once asked about this (probably on oe-core list), but i was
reading this section in the dev manual,

http://docs.yoctoproject.org/dev-manual/common-tasks.html#post-installation-scripts

and i think it needs work, or i just have no idea how to read it
properly, so let me ask some really dumb, basic questions.

  first, IIRC, once upon a time, such a script had the option of being
run at image install time, or on-target install time (depending on i
think whether the script exited with 0 or 1 or something like that).
those days are gone, and the new design is to use one of:

  pkg_postinst
  pkg_postinst_ontarget

fair enough, but in the old days, such a script might check the value
of ${D} to see if it was running in the image context, or on-target
context, and obviously run differently. given the current setup with
those two distinct routines, is there any purpose in such a script
*ever* checking the value of ${D} anymore? that is, is it safe to
assume that the first version above is run in image context, and the
second in on-target context? or is there still some obscure reason to
need to check?

  i ask as i see this in base-passwd_3.5.29.bb:

    pkg_postinst:${PN}-update () {
    #!/bin/sh
    if [ -n "$D" ]; then
            exit 0
    fi
    ${sbindir}/update-passwd
    }

  how does one interpret that? or is just a holdover from the old
days? certainly that section in the docs is not going to help a reader
understand the (still) numerous references to ${D} in some of those
scripts.

rday


             reply	other threads:[~2021-12-17 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 13:35 Robert P. J. Day [this message]
2021-12-17 14:58 ` [docs] trying (again) to clarify pkg_postinst[_ontarget] Alexander Kanavin
     [not found]   ` <16C19319C1030E42.10196@lists.yoctoproject.org>
     [not found]     ` <b22aac2c-ee65-c3f6-ebfd-9c51f28a77f5@crashcourse.ca>
2021-12-17 16:32       ` Alexander Kanavin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f63931-692c-7af-251c-6f6dfdb0451e@crashcourse.ca \
    --to=rpjday@crashcourse.ca \
    --cc=docs@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.