All of lore.kernel.org
 help / color / mirror / Atom feed
* trying (again) to clarify pkg_postinst[_ontarget]
@ 2021-12-17 13:35 Robert P. J. Day
  2021-12-17 14:58 ` [docs] " Alexander Kanavin
  0 siblings, 1 reply; 3+ messages in thread
From: Robert P. J. Day @ 2021-12-17 13:35 UTC (permalink / raw)
  To: YP docs mailing list


  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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [docs] trying (again) to clarify pkg_postinst[_ontarget]
  2021-12-17 13:35 trying (again) to clarify pkg_postinst[_ontarget] Robert P. J. Day
@ 2021-12-17 14:58 ` Alexander Kanavin
       [not found]   ` <16C19319C1030E42.10196@lists.yoctoproject.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Kanavin @ 2021-12-17 14:58 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: YP docs mailing list

[-- Attachment #1: Type: text/plain, Size: 2385 bytes --]

Hey Robert, may I make a suggestion? Rather than ask someone to explain the
implementation of pkg_postinst to you, why don’t you read the
implementation and ask questions about specific code where it’s unclear
what or why.

Alex

On Fri 17. Dec 2021 at 16.35, Robert P. J. Day <rpjday@crashcourse.ca>
wrote:

>
>   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
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#2302):
> https://lists.yoctoproject.org/g/docs/message/2302
> Mute This Topic: https://lists.yoctoproject.org/mt/87788937/1686489
> Group Owner: docs+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/docs/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 3518 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [docs] trying (again) to clarify pkg_postinst[_ontarget]
       [not found]     ` <b22aac2c-ee65-c3f6-ebfd-9c51f28a77f5@crashcourse.ca>
@ 2021-12-17 16:32       ` Alexander Kanavin
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Kanavin @ 2021-12-17 16:32 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: YP docs mailing list

[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]

The code is the canonical definition of behavior. If you see recipes or
docs disagreeing with the code, please show where and how. Note: recipes
directly using $D or explicitly calling defer to first boot helper are not
in disagreement, they're just not using the documented syntactic sugar.

Alex

On Fri, 17 Dec 2021 at 18:08, Robert P. J. Day <rpjday@crashcourse.ca>
wrote:

> On Fri, 17 Dec 2021, Robert P. J. Day wrote:
>
> > On Fri, 17 Dec 2021, Alexander Kanavin wrote:
> >
> > > Hey Robert, may I make a suggestion? Rather than ask someone to
> > > explain the implementation of pkg_postinst to you, why don’t you
> > > read the implementation and ask questions about specific code where
> > > it’s unclear what or why.
> >
> >   i'm actually doing that, but i'm still not a python expert so i
> > struggle with some of the bbclass files trying to follow the logic.
>
>   there's one other complication -- even when i think i follow the
> code, i like to look at sample recipes to confirm my understanding,
> but that's when i run across stuff like this in
> sysvinit-inittab_2.88dsf.bb:
>
>   pkg_postinst:${PN} () {
>   # run this on host and on target
>   if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
>        exit 0
>   fi
>
> so i have the docs, the code and the sample recipes all seeming to
> disagree with each other.
>
> rday

[-- Attachment #2: Type: text/html, Size: 1904 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-17 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17 13:35 trying (again) to clarify pkg_postinst[_ontarget] Robert P. J. Day
2021-12-17 14:58 ` [docs] " 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

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.