From: Jan Kiszka <jan.kiszka@siemens.com>
To: Henning Schild <henning.schild@siemens.com>,
isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH 1/3] buildchroot: Align UID and GID of builder user with caller
Date: Tue, 13 Nov 2018 08:53:03 +0100 [thread overview]
Message-ID: <7d205eef-33f9-ff7b-b267-d5bc92048e02@siemens.com> (raw)
In-Reply-To: <20181112155149.24215-2-henning.schild@siemens.com>
On 12.11.18 16:51, Henning Schild wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This fixes EPERM on rebuild and also some clean builds: We have to align
> the IDs of the builder user with the user in the host environment.
> Otherwise, files and directories can become unaccessible during the
> build.
>
> Fixes: be291cd991bd ("buildchroot: build debian packages as "builder" not "root"")
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> meta/recipes-devtools/buildchroot/buildchroot.inc | 4 +++-
> meta/recipes-devtools/buildchroot/files/configscript.sh | 4 ++--
> 2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-devtools/buildchroot/buildchroot.inc b/meta/recipes-devtools/buildchroot/buildchroot.inc
> index 7dd909e..2c44db9 100644
> --- a/meta/recipes-devtools/buildchroot/buildchroot.inc
> +++ b/meta/recipes-devtools/buildchroot/buildchroot.inc
> @@ -36,7 +36,9 @@ do_build() {
>
> # Configure root filesystem
> sudo install -m 755 ${WORKDIR}/configscript.sh ${BUILDCHROOT_DIR}
> - sudo chroot ${BUILDCHROOT_DIR} /configscript.sh
> + USER_ID=$(id -u)
> + GROUP_ID=$(id -g)
> + sudo chroot ${BUILDCHROOT_DIR} /configscript.sh $USER_ID $GROUP_ID
>
> sudo mount --bind ${DL_DIR} ${BUILDCHROOT_DIR}/downloads
> }
> diff --git a/meta/recipes-devtools/buildchroot/files/configscript.sh b/meta/recipes-devtools/buildchroot/files/configscript.sh
> index 30660e7..7e49385 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
>
> -addgroup --quiet --system builder
> -useradd --system --gid builder --no-create-home --home /home/builder --no-user-group --comment "Isar buildchroot build user" builder
> +addgroup --quiet --system builder --gid $2
> +useradd --system --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
>
-o ?
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2018-11-13 7:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-12 15:51 [PATCH 0/3] "root" to "builder" repair series Henning Schild
2018-11-12 15:51 ` [PATCH 1/3] buildchroot: Align UID and GID of builder user with caller Henning Schild
2018-11-13 7:53 ` Jan Kiszka [this message]
2018-11-14 7:32 ` Henning Schild
2018-11-14 8:31 ` [PATCH v2 " Jan Kiszka
2018-11-12 15:51 ` [PATCH 2/3] Revert "Change ownership of WORKDIR prior to unpacking" Henning Schild
2018-11-14 13:10 ` Jan Kiszka
2018-11-14 13:23 ` Jan Kiszka
2018-11-14 13:58 ` Jan Kiszka
2018-11-14 14:11 ` Henning Schild
2018-11-14 15:43 ` Henning Schild
2018-11-14 15:45 ` Jan Kiszka
2018-11-15 8:28 ` Henning Schild
2018-11-12 15:51 ` [PATCH 3/3] buildchroot: do not chown to builder:builder anymore Henning Schild
2018-11-14 12:55 ` [PATCH 0/3] "root" to "builder" repair series 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=7d205eef-33f9-ff7b-b267-d5bc92048e02@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=henning.schild@siemens.com \
--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