From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6626616999001718784 X-Received: by 2002:a7b:c0cd:: with SMTP id s13mr1756643wmh.15.1542895123482; Thu, 22 Nov 2018 05:58:43 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:8bc5:: with SMTP id n188-v6ls2755511wmd.1.canary-gmail; Thu, 22 Nov 2018 05:58:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/WJaFeRwr8An+szBKNFrE0VmOZbSG4EtA9huLdX757gg/eFnjaJ0xC/KtsqfDJC/kBWUvDq X-Received: by 2002:a1c:13d5:: with SMTP id 204mr1811753wmt.16.1542895123084; Thu, 22 Nov 2018 05:58:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542895123; cv=none; d=google.com; s=arc-20160816; b=rHk+dOuP59Zk1TlbMQcfbdOYUTF+FhKDnqI3qps17Ae2W8zUpZmBzVAd9rvHwIx00V Y71PbW9G8sxzhMJL06rXvi/Chlxv3O8UTTxiQSvwsie+QEwduo+ca95idaqgOPfllgyv MzT69XdscbPhdLkpefVcvtAsWYV85sTteYivdY4zLM3P6vghQ9A/SDYhv9xz/Wwk6ZLf 27xlER/zH5qZntN6heb9ZgGuq00+HZEFGUUVe2dHs9R2MCdVUPNj79IPLOQgeu3UaA+K qRf7kIbFSCQh5lXMUw5G0G8NqAR5g3dDHGYZ/D9FvF9UrRzbwxhIYrzPtQqGW7rpk9Ci uGIg== 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:subject:to:from:date; bh=RB/d58Li2N5q3trVQM16DR1pztJiaIYQLTzbpl9TZic=; b=XD6H+SY5mE8EOoj/ekx8Gq4Huvunu+oIg70uiINijd1ct1H46KFsfFLbbDmLsFgqvR 8ESAALzgCOd5DGWQS2Rz4iYRuT8BAw4cDHSRTypQm4pq9kMXPJi0F8xCu8E/x//RVFww cyUlZXN24bxD84VS1YJv+JeH29k/Qlc3M07gD+QrLLpS3B1TfycH3p22a4XlqBe4k9Ic SH9odCf4gEVb8sdOUavURQJu+/g53VKucsnv8KmPnELxuDHPXkdvrf8HX2kQi1PoMHwn UpTwq9p97mOsJUmSD2qE7nqm7xSMD2eoclCCtIPWcJPLhL6vhvGt92dxeTBOqxU6iJ7c 3EDg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id 191-v6si182552wmv.0.2018.11.22.05.58.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 05:58:43 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id wAMDwgVS013017 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 22 Nov 2018 14:58:42 +0100 Received: from md1za8fc.ad001.siemens.net ([139.25.69.187]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id wAMDwgqO017781 for ; Thu, 22 Nov 2018 14:58:42 +0100 Date: Thu, 22 Nov 2018 14:58:42 +0100 From: Henning Schild To: Subject: Re: [PATCH 1/2] buildchroot: Enter buildchroot with right user:group directly Message-ID: <20181122145842.01ead424@md1za8fc.ad001.siemens.net> In-Reply-To: <20181122093818.21909-1-henning.schild@siemens.com> References: <20181122093818.21909-1-henning.schild@siemens.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: tbYSAmuKdlXi Am Thu, 22 Nov 2018 10:38:17 +0100 schrieb Henning Schild : > From: Henning Schild Wrong author ... Henning > Instead of using "su" use "chroot --userspec". That should also be the > pattern for other chroot users that do not need root. i.e. kernel > build and upcoming "apt-get source" fetcher. > This way we can skip all the chowning we had/have to do otherwise. > > Signed-off-by: Henning Schild > --- > meta/classes/dpkg.bbclass | 2 +- > meta/recipes-devtools/buildchroot/files/build.sh | 3 +-- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass > index f74c9c9..24b9fe3 100644 > --- a/meta/classes/dpkg.bbclass > +++ b/meta/classes/dpkg.bbclass > @@ -19,5 +19,5 @@ do_install_builddeps[stamp-extra-info] = > "${DISTRO}-${DISTRO_ARCH}" # Build package from sources using build > script dpkg_runbuild() { > E="${@ bb.utils.export_proxies(d)}" > - sudo -E chroot ${BUILDCHROOT_DIR} /isar/build.sh ${PP}/${PPS} > ${DISTRO_ARCH} > + sudo -E chroot --userspec=$( id -u ):$( id -g ) > ${BUILDCHROOT_DIR} /isar/build.sh ${PP}/${PPS} ${DISTRO_ARCH} } > diff --git a/meta/recipes-devtools/buildchroot/files/build.sh > b/meta/recipes-devtools/buildchroot/files/build.sh index > f977b16..1ba394c 100644 --- > a/meta/recipes-devtools/buildchroot/files/build.sh +++ > b/meta/recipes-devtools/buildchroot/files/build.sh @@ -14,5 +14,4 @@ > for i in configure aclocal.m4 Makefile.am Makefile.in; do fi > done > > -# Build the package as user "builder" > -su builder -c "cd $1; dpkg-buildpackage -a$target_arch -d > --source-option=-I" +dpkg-buildpackage -a$target_arch -d > --source-option=-I