From: Henning Schild <henning.schild@siemens.com>
To: isar-users@googlegroups.com
Cc: Michael Adler <michael.adler@siemens.com>,
Jan Kiszka <jan.kiszka@siemens.com>,
Henning Schild <henning.schild@siemens.com>
Subject: [PATCH] buildchroot: do not assume group of "builder" to be "builder"
Date: Wed, 27 Feb 2019 11:26:06 +0100 [thread overview]
Message-ID: <20190227102606.18017-1-henning.schild@siemens.com> (raw)
From: Henning Schild <henning.schild@siemens.com>
We try to align the user and group ids of the user running bitbake with
the users inside the chroots. If that outside user happens to be in a
group that already exists in a fresh installation (i.e. users:100) we
will not create a group called "builder" so checking the group name
later will fail. Just check that the gid is the gid of "builder" instead
of checking that the group name is "builder".
Reported-by: Michael Adler <michael.adler@siemens.com>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/recipes-devtools/buildchroot/files/common.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meta/recipes-devtools/buildchroot/files/common.sh b/meta/recipes-devtools/buildchroot/files/common.sh
index 9e6adbc..01d3c57 100644
--- a/meta/recipes-devtools/buildchroot/files/common.sh
+++ b/meta/recipes-devtools/buildchroot/files/common.sh
@@ -7,10 +7,10 @@
set -e
printenv | grep -q BB_VERBOSE_LOGS && set -x
-# assert we are either "root:root" or "builder:builder"
-if ([ "$(id -un)" != "builder" ] || [ "$(id -gn)" != "builder" ]) &&
+# assert we are either "root:root" or "builder:<gid of builder>"
+if ([ "$(id -un)" != "builder" ] || [ "$(id -g)" != "$(id -g builder)" ]) &&
([ "$(id -un)" != "root" ] || [ "$(id -gn)" != "root" ]); then
- echo "This script can only be run as root:root or builder:builder!" >&2
+ echo "This script can only be run as root:root or builder:<gid of builder>!" >&2
echo "(Currently running as $(id -un)($(id -u)):$(id -gn)($(id -g)))" >&2
exit 1
fi
--
2.19.2
next reply other threads:[~2019-02-27 10:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-27 10:26 Henning Schild [this message]
2019-02-27 10:28 ` Henning Schild
2019-02-27 11:26 ` Adler, Michael
2019-03-14 19:19 ` Maxim Yu. Osipov
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=20190227102606.18017-1-henning.schild@siemens.com \
--to=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
--cc=michael.adler@siemens.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