From: Henning Schild <henning.schild@siemens.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH v3] wic-image: Fix up file ownership in isar repo after wic run
Date: Wed, 12 Sep 2018 14:49:55 +0200 [thread overview]
Message-ID: <20180912144955.4ce5ab6c@md1pvb1c.ad001.siemens.net> (raw)
In-Reply-To: <f37e89cf-8753-75cf-1ca9-4781e47235f7@siemens.com>
Am Thu, 23 Aug 2018 14:12:19 +0200
schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> This prevents needlessly leaving the __pycache__ directories
> root-owned behind after running wic as superuser - will only cause
> troubles to the user when trying to clean up the isar repo.
>
> We update the ownership only for selected subdirs of the repo to avoid
> touching local files.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> Changes in v3:
> - catch ALL relevant folders (first test, then post - hmpf)
>
> meta/classes/wic-img.bbclass | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/meta/classes/wic-img.bbclass
> b/meta/classes/wic-img.bbclass index b56df7b..bc405c1 100644
> --- a/meta/classes/wic-img.bbclass
> +++ b/meta/classes/wic-img.bbclass
> @@ -71,6 +71,7 @@ do_wic_image() {
> export MTOOLS_SKIP_CHECK=1
>
> sudo -E chroot ${BUILDCHROOT_DIR} ${ISARROOT}/scripts/wic create
> ${WKS_FILE} --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -o /tmp/ -e
> ${IMAGE_BASENAME} ${WIC_CREATE_EXTRA_ARGS}
> + sudo chown -R $(stat -c "%U" ${ISARROOT}) ${ISARROOT}/meta
> ${ISARROOT}/meta-isar ${ISARROOT}/scripts cp -f `ls -t -1
> ${BUILDCHROOT_DIR}/tmp/${WKS_FILE}*.direct | head -1`
> ${WIC_IMAGE_FILE} }
This breaks if ISARROOT is mounted ro, chown will fail with "read only
file system" and there will not even be any __pycache__ things to chown.
Steps to reproduce:
git clone isar
cd isar
mkdir out
docker run -v $(pwd):/this/:ro -v $(pwd)/out:/out:rw -e USER_ID=$(id
-u) --rm -t -i --cap-add=SYS_ADMIN --cap-add=MKNOD -e
http_proxy=$http_proxy -e https_proxy=$https_proxy -e
ftp_proxy=$ftp_proxy -e no_proxy=$no_proxy $CONTAINER sh -c bash
docker> cd /out
docker> source /this/isar-init-build-env
isar> bitbake <a wic image>
Henning
next prev parent reply other threads:[~2018-09-12 12:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-23 12:12 Jan Kiszka
2018-08-23 12:26 ` Christian Storm
2018-08-23 12:29 ` Jan Kiszka
2018-08-27 22:14 ` Maxim Yu. Osipov
2018-09-12 12:49 ` Henning Schild [this message]
2018-09-12 13:22 ` Jan Kiszka
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=20180912144955.4ce5ab6c@md1pvb1c.ad001.siemens.net \
--to=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.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