* [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
* Re: [PATCH] buildchroot: do not assume group of "builder" to be "builder"
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
1 sibling, 1 reply; 4+ messages in thread
From: Henning Schild @ 2019-02-27 10:28 UTC (permalink / raw)
To: Michael Adler; +Cc: isar-users, Jan Kiszka
Michael,
could you please give that a try. Building something like hello-isar
should work.
Henning
On Wed, 27 Feb 2019 11:26:06 +0100
Henning Schild <henning.schild@siemens.com> wrote:
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] buildchroot: do not assume group of "builder" to be "builder"
2019-02-27 10:28 ` Henning Schild
@ 2019-02-27 11:26 ` Adler, Michael
0 siblings, 0 replies; 4+ messages in thread
From: Adler, Michael @ 2019-02-27 11:26 UTC (permalink / raw)
To: isar-users; +Cc: henning.schild, jan.kiszka
> could you please give that a try. Building something like hello-isar
> should work.
Seems to work. Thanks!
--
Michael Adler
Siemens AG, Corporate Technology, CT RDA IOT SES-DE, Otto-Hahn-Ring 6, 81739 Munich, Germany
Siemens Aktiengesellschaft: Chairman of the Supervisory Board: Gerhard Cromme; Managing Board: Joe Kaeser, Chairman, President and Chief Executive Officer; Roland Busch, Lisa Davis, Klaus Helmrich, Janina Kugel, Siegfried Russwurm, Ralf P. Thomas; Registered offices: Berlin and Munich, Germany; Commercial registries: Berlin Charlottenburg, HRB 12300, Munich, HRB 6684; WEEE-Reg.-No. DE 23691322
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] buildchroot: do not assume group of "builder" to be "builder"
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-03-14 19:19 ` Maxim Yu. Osipov
1 sibling, 0 replies; 4+ messages in thread
From: Maxim Yu. Osipov @ 2019-03-14 19:19 UTC (permalink / raw)
To: Henning Schild, isar-users; +Cc: Michael Adler, Jan Kiszka
On 2/27/19 11:26 AM, Henning Schild wrote:
> 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".
Applied to the 'next'.
Thanks,
Maxim.
> 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
>
--
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ 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