public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] buildchroot: do not assume group of "builder" to be "builder"
@ 2019-02-27 10:26 Henning Schild
  2019-02-27 10:28 ` Henning Schild
  2019-03-14 19:19 ` Maxim Yu. Osipov
  0 siblings, 2 replies; 4+ messages in thread
From: Henning Schild @ 2019-02-27 10:26 UTC (permalink / raw)
  To: isar-users; +Cc: Michael Adler, Jan Kiszka, Henning Schild

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


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

end of thread, other threads:[~2019-03-14 19:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-27 10:26 [PATCH] buildchroot: do not assume group of "builder" to be "builder" Henning Schild
2019-02-27 10:28 ` Henning Schild
2019-02-27 11:26   ` Adler, Michael
2019-03-14 19:19 ` Maxim Yu. Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox