public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Alexander Smirnov <asmirnov@ilbers.de>
To: isar-users@googlegroups.com
Cc: Alexander Smirnov <asmirnov@ilbers.de>
Subject: [PATCH] [RFC] buildchroot: Fix do_setup_mounts
Date: Tue, 13 Feb 2018 23:32:02 +0300	[thread overview]
Message-ID: <20180213203202.4161-1-asmirnov@ilbers.de> (raw)

Fix this function to work correctly for re-running builds.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 meta/recipes-devtools/buildchroot/buildchroot.bb | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb
index 570c0ad..d25b549 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot.bb
@@ -74,20 +74,16 @@ do_build() {
     do_cleanup_mounts
 }
 
-# Invalidate stamp for do_setup_mounts before each build start.
-# This will guarantee that this function will be executed once
-# per build.
-python __anonymous() {
-    stamp = d.getVar("STAMP") + ".do_setup_mounts." + d.getVarFlag("do_setup_mounts", 'stamp-extra-info')
-    os.remove(stamp) if os.path.exists(stamp) else None
-}
-
-do_setup_mounts[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
+do_setup_mounts[nostamp] = "1"
+do_setup_mounts[lockfiles] = "${WORKDIR}/isar.lock"
 
 do_setup_mounts() {
-    sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO} ${BUILDCHROOT_DIR}/isar-apt
-    sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${BUILDCHROOT_DIR}/dev
-    sudo mount -t proc none ${BUILDCHROOT_DIR}/proc
+    grep -q ${BUILDCHROOT_DIR}/isar-apt /proc/mounts || \
+        sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO} ${BUILDCHROOT_DIR}/isar-apt
+    grep -q ${BUILDCHROOT_DIR}/dev /proc/mounts || \
+        sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${BUILDCHROOT_DIR}/dev
+    grep -q ${BUILDCHROOT_DIR}/proc /proc/mounts || \
+        sudo mount -t proc none ${BUILDCHROOT_DIR}/proc
 }
 
 addtask setup_mounts after do_build
-- 
2.1.4


             reply	other threads:[~2018-02-13 20:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 20:32 Alexander Smirnov [this message]
2018-02-13 20:49 ` 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=20180213203202.4161-1-asmirnov@ilbers.de \
    --to=asmirnov@ilbers.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