public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] buildchroot: mount base-apt when using repo caching
@ 2019-06-03 12:51 Cedric Hombourger
  2019-06-03 13:56 ` Claudius Heine
  2019-06-10 16:20 ` Maxim Yu. Osipov
  0 siblings, 2 replies; 3+ messages in thread
From: Cedric Hombourger @ 2019-06-03 12:51 UTC (permalink / raw)
  To: isar-users; +Cc: Cedric Hombourger

Debian package builds start with the installation of dependencies. In our case,
they get installed into the buildchroot from either upstream package feeds or
from the local package cache (aka base-apt) when ISAR_USE_CACHED_REPO is set.
For the latter to work, /base-apt obviously needs to be bind mounted in the
buildchroot. This was simply missing.

Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com>
---
 meta/classes/buildchroot.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
index ea1538a..b7a8ea5 100644
--- a/meta/classes/buildchroot.bbclass
+++ b/meta/classes/buildchroot.bbclass
@@ -38,6 +38,14 @@ buildchroot_do_mounts() {
             mount --rbind /sys '${BUILDCHROOT_DIR}/sys'
         mount --make-rslave '${BUILDCHROOT_DIR}/sys'
 
+        # Mount base-apt if 'ISAR_USE_CACHED_BASE_REPO' is set
+        if [ "${@repr(bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')))}" = 'True' ]
+        then
+            mkdir -p '${BUILDCHROOT_DIR}/base-apt'
+            mountpoint -q '${BUILDCHROOT_DIR}/base-apt' || \
+                mount --bind '${REPO_BASE_DIR}' '${BUILDCHROOT_DIR}/base-apt'
+        fi
+
         # Refresh /etc/resolv.conf at this chance
         cp -L /etc/resolv.conf '${BUILDCHROOT_DIR}/etc'
         ) 9>'${MOUNT_LOCKFILE}'
-- 
2.11.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-10 16:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-03 12:51 [PATCH] buildchroot: mount base-apt when using repo caching Cedric Hombourger
2019-06-03 13:56 ` Claudius Heine
2019-06-10 16:20 ` Maxim Yu. Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox