From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF3C3C433EF for ; Fri, 17 Dec 2021 14:58:22 +0000 (UTC) Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) by mx.groups.io with SMTP id smtpd.web10.7012.1639753102000821394 for ; Fri, 17 Dec 2021 06:58:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=b7mZ/TWQ; spf=pass (domain: gmail.com, ip: 209.85.222.48, mailfrom: alex.kanavin@gmail.com) Received: by mail-ua1-f48.google.com with SMTP id n7so4757350uaq.12 for ; Fri, 17 Dec 2021 06:58:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zJ08YWimXKWqO62SxXuEieAajM5HtF/dU4AMuBwOkyY=; b=b7mZ/TWQ4WX8HC2xtReEM38l39vzNK12mCHNNQk/KWDLDhFcDRIly4XQ21WrTUowcZ FlMTry63fh9OtBqSpyDclIjzgOL0pNIWyy/H8KmubjJQG14Me0GOJkzVb3hPsoDbPSjR qUsYIAYTmmMvKZclVObtY9euJ9oknUXnzgWRP+y/l8Ggtgh37V/dXd+Z7Bj3OJpBTnb4 VSFsvBnrt9bV7glv4/cBB68aCSenpwIt+x0eDBa5knHG2JpddmzQqLPZjjvnQvLVSl3c T7f4FHZUGfx2Lvp2euavTJl+iBt55hu0N+8nsVWwUjOaky3QOSbpya7L/Aro3lyNukvD 9qQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zJ08YWimXKWqO62SxXuEieAajM5HtF/dU4AMuBwOkyY=; b=iFyVsb76surHg70m6c3mkAXMflt5aUFeWtFqK1QehzGPHiU/1ub2o/pZdXWGqQrRQD YFNhBKbDQOcZcu637EjokWZqosAniT/kr2LA5XinQy/RKOxBXa/+BhLt0+Mz5/k0i0UN pFpL3lD59iT8IulGaG9lzj6gxr399KjmHek0TaqxxXDq1bpetYNKqhhYz+CnvGO864mS 00Coy712+kQLJRGJf6ocY4CaqcyCoWqEkqNoioSKVujHJyMR+VA2EAYp/68N5eZZLUFC N7ObtSHsBLDM+260l64Ikyfzs5knUsTmk/uf/7JaIMe3UKPSCjx9QvrUbsMskWoUjG4b iAyg== X-Gm-Message-State: AOAM532MaJxay6bhJI5j4oZuG6HbfA5lYJ2dKhZNfBVY8gIKmsDxhQi7 WNfXgvdersHjjKU7sYMGrz66oe4lPQDY+cm6WVM= X-Google-Smtp-Source: ABdhPJzxv3apzZNYZwKFJf6fIOraPP/r0vg5oax0k9KLx6WAgE3zIS3fMljsXtUm4i6zS+l2kF9y0/raY8cXNDnxG5A= X-Received: by 2002:a67:7105:: with SMTP id m5mr1234953vsc.81.1639753101063; Fri, 17 Dec 2021 06:58:21 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Alexander Kanavin Date: Fri, 17 Dec 2021 17:58:09 +0300 Message-ID: Subject: Re: [docs] trying (again) to clarify pkg_postinst[_ontarget] To: "Robert P. J. Day" Cc: YP docs mailing list Content-Type: multipart/alternative; boundary="0000000000001bb9db05d358c5bc" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Dec 2021 14:58:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/2307 --0000000000001bb9db05d358c5bc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Robert, may I make a suggestion? Rather than ask someone to explain the implementation of pkg_postinst to you, why don=E2=80=99t you read the implementation and ask questions about specific code where it=E2=80=99s unc= lear what or why. Alex On Fri 17. Dec 2021 at 16.35, Robert P. J. Day 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-installati= on-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 > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > 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] > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > > --0000000000001bb9db05d358c5bc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey Robert, may I make a suggestion? Rather than ask some= one to explain the implementation of pkg_postinst to you, why don=E2=80=99t= you read the implementation and ask questions about specific code where it= =E2=80=99s unclear what or why.

Alex

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

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

http://docs.yocto= project.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.

=C2=A0 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:

=C2=A0 pkg_postinst
=C2=A0 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?

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

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

=C2=A0 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

-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
Links: You receive all messages sent to this group.
View/Reply Online (#2302): https://lists.yoctoproj= ect.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<= /a> [alex.kanav= in@gmail.com]
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-

--0000000000001bb9db05d358c5bc--