public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: Cedric Hombourger <Cedric_Hombourger@mentor.com>,
	isar-users@googlegroups.com
Subject: Re: [PATCH] wic: refactor to use buildchroot_do_mounts
Date: Wed, 17 Oct 2018 15:13:41 +0300	[thread overview]
Message-ID: <a55d79c7-d9d0-b1f0-d47d-794bc6c88495@ilbers.de> (raw)
In-Reply-To: <1539586108-213-1-git-send-email-Cedric_Hombourger@mentor.com>

On 10/15/18 9:48 AM, Cedric Hombourger wrote:
> The wic code needs to bind mount buildchroot directories. Leverage the newly
> added buildchroot_do_mounts function instead of binding required directories
> ourselves.
> 
> For additional mounts (such as layer directories), use mountpoint to check if
> they were already mounted before bind mounting them.

Applied to the 'next'.

Thanks,
Maxim.

> Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com>
> ---
>   meta/classes/wic-img.bbclass | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
> index 5ff8b45..d0747e2 100644
> --- a/meta/classes/wic-img.bbclass
> +++ b/meta/classes/wic-img.bbclass
> @@ -9,6 +9,7 @@ python () {
>           bb.fatal("WKS_FILE must be set")
>   }
>   
> +inherit buildchroot
>   inherit wks-file
>   
>   WKS_FULL_PATH = "${@get_wks_full_path(d)}"
> @@ -67,13 +68,11 @@ WIC_IMAGE_FILE ="${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.wic.img"
>   do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
>   
>   do_wic_image() {
> -    if ! grep -q ${BUILDCHROOT_DIR}/dev /proc/mounts; then
> -        sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${BUILDCHROOT_DIR}/dev
> -        sudo mount -t proc none ${BUILDCHROOT_DIR}/proc
> -    fi
> +    buildchroot_do_mounts
>       for dir in ${BBLAYERS} ${STAGING_DIR} ${ISARROOT}/scripts; do
>   	sudo mkdir -p ${BUILDCHROOT_DIR}/$dir
> -        sudo mount --bind $dir ${BUILDCHROOT_DIR}/$dir
> +        mountpoint ${BUILDCHROOT_DIR}/$dir >/dev/null 2>&1 \
> +        || sudo mount --bind $dir ${BUILDCHROOT_DIR}/$dir
>       done
>       export FAKEROOTCMD=${FAKEROOTCMD}
>       export BUILDDIR=${BUILDDIR}
> 


-- 
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

      reply	other threads:[~2018-10-17 12:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15  6:48 Cedric Hombourger
2018-10-17 12:13 ` 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=a55d79c7-d9d0-b1f0-d47d-794bc6c88495@ilbers.de \
    --to=mosipov@ilbers.de \
    --cc=Cedric_Hombourger@mentor.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