From: Cedric Hombourger <Cedric_Hombourger@mentor.com>
To: <isar-users@googlegroups.com>
Cc: Cedric Hombourger <Cedric_Hombourger@mentor.com>
Subject: [PATCH] wic: refactor to use buildchroot_do_mounts
Date: Mon, 15 Oct 2018 08:48:28 +0200 [thread overview]
Message-ID: <1539586108-213-1-git-send-email-Cedric_Hombourger@mentor.com> (raw)
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.
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}
--
2.11.0
next reply other threads:[~2018-10-15 6:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-15 6:48 Cedric Hombourger [this message]
2018-10-17 12:13 ` 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=1539586108-213-1-git-send-email-Cedric_Hombourger@mentor.com \
--to=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