From: Uladzimir Bely <ubely@ilbers.de>
To: Henning Schild <henning.schild@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH] example-raw: fix postinst script dependency on adduser
Date: Tue, 15 Nov 2022 12:11:25 +0300 [thread overview]
Message-ID: <4741870.OV4Wx5bFTl@hp> (raw)
In-Reply-To: <20221114110758.78eb62cd@md1za8fc.ad001.siemens.net>
In mail from понедельник, 14 ноября 2022 г. 13:07:58 +03 You wrote:
> Am Mon, 14 Nov 2022 10:01:20 +0100
>
> schrieb Uladzimir Bely <ubely@ilbers.de>:
> > Starting from Nov 2022, package `adduser` is not preinstalled
> > when the distro debootstrapped.
> >
> > This caused example-raw `postinst: 6: addgroup: not found` error
> > when installing `container-amd64-bookworm` image.
> >
> > The problem was not reproduced on `qemuamd64-bookworm` while `adduser`
> > exist in the image as a dependency of some other package.
> >
> > Fix the problem by adding explicit dependency to `adduser` package.
> >
> > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > ---
> >
> > meta-isar/recipes-app/example-raw/example-raw_0.3.bb | 2 +-
> > meta-isar/recipes-app/example-raw/files/postinst | 2 ++
> > 2 files changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.3.bb
> > b/meta-isar/recipes-app/example-raw/example-raw_0.3.bb index
> > 21664642..7f90d43b 100644 ---
> > a/meta-isar/recipes-app/example-raw/example-raw_0.3.bb +++
> > b/meta-isar/recipes-app/example-raw/example-raw_0.3.bb @@ -5,7 +5,7 @@
>
> I would suggest to bump to 0.3.1 with that.
>
> > DESCRIPTION = "Sample application for ISAR"
> > MAINTAINER = "Your name here <you@domain.com>"
> >
> > -DEBIAN_DEPENDS = "apt (>= 0.4.2), passwd"
> > +DEBIAN_DEPENDS = "adduser, apt (>= 0.4.2), passwd"
>
> Nice catch. But you can remove passwd now since adduser depends on
> passwd in all distros.
>
> Henning
>
> > SRC_URI = "file://README \
> >
> > file://postinst \
> >
> > diff --git a/meta-isar/recipes-app/example-raw/files/postinst
> > b/meta-isar/recipes-app/example-raw/files/postinst index
> > d25c251d..a461600a 100644 ---
> > a/meta-isar/recipes-app/example-raw/files/postinst +++
> > b/meta-isar/recipes-app/example-raw/files/postinst @@ -3,6 +3,8 @@
> >
> > set -e
> >
> > if ! getent group isar >/dev/null; then
> >
> > + # We use `addgroup` instead of `groupadd` here in order
> > + # to prove `adduser` Debian dependency in the recipe
>
> I think this mainly serves as an example on how people should create a
> group with a package. So we should skip that comment. If we find that
> groupadd should rather be used to create a group with a package, we
> should switch to be a good example.
>
Actually, `groupadd` also works, so we technically don't need `adduser`
package at all. From my experiment, the difference is that `groupadd` creates
the group with GID=999, while addgroup creates it with GID=N+1, where N is the
last GID in /etc/group.
> I do not remember where i got that pattern from. Likely some postinst
> from some service package like apache or nginx.
>
> Henning
>
> > addgroup --quiet --system isar
> >
> > fi
next prev parent reply other threads:[~2022-11-15 9:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 9:01 Uladzimir Bely
2022-11-14 10:07 ` Henning Schild
2022-11-15 9:11 ` Uladzimir Bely [this message]
2022-11-15 16:40 ` Henning Schild
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=4741870.OV4Wx5bFTl@hp \
--to=ubely@ilbers.de \
--cc=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox