From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: Henning Schild <henning.schild@siemens.com>, isar-users@googlegroups.com
Cc: Henning Schild <henning@hennsch.de>
Subject: Re: [PATCH 1/2] buildchroot: Enter buildchroot with right user:group directly
Date: Fri, 23 Nov 2018 13:24:11 +0300 [thread overview]
Message-ID: <42b5823c-472e-9636-0ede-d0eb951ddc27@ilbers.de> (raw)
In-Reply-To: <20181122093818.21909-1-henning.schild@siemens.com>
On 11/22/18 12:38 PM, Henning Schild wrote:
> From: Henning Schild <henning@hennsch.de>
>
> 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.
Applied to the 'next' (with corrected authorship).
Thanks,
Maxim.
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
> 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
>
--
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
prev parent reply other threads:[~2018-11-23 10:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 9:38 Henning Schild
2018-11-22 9:38 ` [PATCH 2/2] buildchroot: Assert that we are one of the two valid users Henning Schild
2018-11-23 10:24 ` Maxim Yu. Osipov
2018-11-22 10:13 ` [PATCH 1/2] buildchroot: Enter buildchroot with right user:group directly chombourger
2018-11-22 12:03 ` Henning Schild
2018-11-22 13:58 ` Henning Schild
2018-11-23 10:24 ` Maxim Yu. Osipov [this message]
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=42b5823c-472e-9636-0ede-d0eb951ddc27@ilbers.de \
--to=mosipov@ilbers.de \
--cc=henning.schild@siemens.com \
--cc=henning@hennsch.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