From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH v5 9/9] buildchroot/configscript: make creation of builder uid/gid idempotent
Date: Tue, 14 May 2019 20:03:00 +0200 [thread overview]
Message-ID: <20190514180300.27164-10-mosipov@ilbers.de> (raw)
In-Reply-To: <20190514180300.27164-1-mosipov@ilbers.de>
From: Claudius Heine <ch@denx.de>
Signed-off-by: Claudius Heine <ch@denx.de>
---
meta/recipes-devtools/buildchroot/files/configscript.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-devtools/buildchroot/files/configscript.sh b/meta/recipes-devtools/buildchroot/files/configscript.sh
index 25a21ef..c4d8cf8 100644
--- a/meta/recipes-devtools/buildchroot/files/configscript.sh
+++ b/meta/recipes-devtools/buildchroot/files/configscript.sh
@@ -10,6 +10,6 @@ locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8
locales locales/default_environment_locale select en_US.UTF-8
END
-groupadd --system builder -o --gid $2
-useradd --system -o --uid $1 --gid builder --no-create-home --home /home/builder --no-user-group --comment "Isar buildchroot build user" builder
+grep -q "builder:x:$2" /etc/group || groupadd -f --system builder -o --gid $2
+grep -q "builder:x:$1" /etc/passwd || useradd --system -o --uid $1 --gid builder --no-create-home --home /home/builder --no-user-group --comment "Isar buildchroot build user" builder
chown -R builder:builder /home/builder
--
2.11.0
next prev parent reply other threads:[~2019-05-14 18:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-14 18:02 [PATCH v5 0/9] Cleanup rootfs creation Maxim Yu. Osipov
2019-05-14 18:02 ` [PATCH v5 1/9] isar-bootstrap-host: disable DISTRO_BOOTSTRAP_KEYS usage Maxim Yu. Osipov
2019-05-14 18:02 ` [PATCH v5 2/9] isar-bootstrap-helper: move 'HOST_ARCH' and 'HOST_DISTRO' to base.bbclass Maxim Yu. Osipov
2019-05-14 18:02 ` [PATCH v5 3/9] move 'HOST_DISTRO_APT_SOURCES' from bootstrap-helper to isar-bootstrap Maxim Yu. Osipov
2019-05-14 18:02 ` [PATCH v5 4/9] buildchroot.bbclass: only cross build if HOST_ARCH != DISTRO_ARCH Maxim Yu. Osipov
2019-05-14 18:02 ` [PATCH v5 5/9] isar-bootstrap/buildchroot/sdkchroot: refactor PF and WORKDIR Maxim Yu. Osipov
2019-05-14 18:02 ` [PATCH v5 6/9] bitbake.conf: remove unneeded and differently used variables Maxim Yu. Osipov
2019-05-14 18:02 ` [PATCH v5 7/9] image.bbclass: make IMAGE_ROOTFS overwritable Maxim Yu. Osipov
2019-05-14 18:02 ` [PATCH v5 8/9] bitbake.conf: set default QEMU_ARCH variables Maxim Yu. Osipov
2019-05-14 18:03 ` Maxim Yu. Osipov [this message]
2019-05-15 6:43 ` [PATCH v5 0/9] Cleanup rootfs creation Claudius Heine
2019-05-15 6:55 ` 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=20190514180300.27164-10-mosipov@ilbers.de \
--to=mosipov@ilbers.de \
--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