From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6680483261914808320 X-Received: by 2002:a1c:ef09:: with SMTP id n9mr3681400wmh.104.1556199945320; Thu, 25 Apr 2019 06:45:45 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:6b10:: with SMTP id v16ls4144441wrw.11.gmail; Thu, 25 Apr 2019 06:45:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXcCZHlBTOyQ5494bVlKvMu/APzBN+v2GGvDY/ZEpRMfrsGBrFhavlPMm6kxALotR/Tec7 X-Received: by 2002:adf:b64e:: with SMTP id i14mr3318480wre.72.1556199944956; Thu, 25 Apr 2019 06:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556199944; cv=none; d=google.com; s=arc-20160816; b=REEFfU6pDPaDhy82ephSq1yAN8TvQYj6RhHekv3syLB1iYHj+SgR8pS2tBvRp7S0Pj /fiPqyMYxXvzNV3xvv5u8IhERwbQtUIDJ/fxKEd90ap3/lz0VWZmEe7GFq6h7oIXF8ce HOVXfJVswvHUO/vjm1/LHcmuYXM8oyMqj8imXlNl1Nwu8pOkDWFrIXQ5MrmBd5GRn+pi KNnMsd2+AKNt5Joz9LRL7d01jxWcL+W4lHomZIPdokSdVldMqhZ8Y5BTJMFCT4X40UNA 6Bm7UzBee/fP6SmZPJioWPqbu8stP044Iv2C+JXGPxf3xccAMQ0MbOXD7/Gr82mnUkZJ y0sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=wFXxIm2Z8c1E90s4VcUWMUbirQFgkEX4v3rv5h5bJ3s=; b=tP03BOr+caFUFSUoHeypHr+pwcPQP6MEGD367gBhu6FPw0xxXrkeNWYpEVegXep5V7 534zb6YoUWhG4IFhpBkunU3sTBfpds5pnX/7xxZP9Af9Pf1aBVST+kewzJsKTDLJThm+ lPtJ7CDpXO4IyE/qll5us/E3O0Wy1Jn52yqO9A5p1/B8959MsZMJGcliU93X5urF9sKY ZDEMALkWUtBfqseMC6akfaDmWYJIMV5I/kXlDJagZf+/Q814f6uRe91UmDO+o9M5uZvu SKLK2wj7yuEv7tQCQ8FnWFr/f9i5hr902VpxuwGWfFzrVwUfOYuXOLWj74oorKXFBV83 ikoA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id u6si1393710wrw.2.2019.04.25.06.45.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 06:45:44 -0700 (PDT) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id x3PDjh3O008924 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Apr 2019 15:45:44 +0200 Received: from ring.ppmd.siemens.net (linux-ses-ext02.ppmd.siemens.net [139.25.69.232]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x3PDjhOQ017181; Thu, 25 Apr 2019 15:45:43 +0200 From: claudius.heine.ext@siemens.com To: isar-users@googlegroups.com Cc: Claudius Heine Subject: [PATCH v4 9/9] buildchroot/configscript: make creation of builder uid/gid idempotent Date: Thu, 25 Apr 2019 15:44:50 +0200 Message-Id: <20190425134450.13443-10-claudius.heine.ext@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190425134450.13443-1-claudius.heine.ext@siemens.com> References: <20190425134450.13443-1-claudius.heine.ext@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: 4V+d4X46LA3A From: Claudius Heine Signed-off-by: Claudius Heine --- 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.20.1