From: Cedric Hombourger <Cedric_Hombourger@mentor.com>
To: <isar-users@googlegroups.com>
Cc: Cedric Hombourger <Cedric_Hombourger@mentor.com>
Subject: [PATCH] buildchroot: mount base-apt when using repo caching
Date: Mon, 3 Jun 2019 14:51:25 +0200 [thread overview]
Message-ID: <20190603125125.5214-1-Cedric_Hombourger@mentor.com> (raw)
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
next reply other threads:[~2019-06-03 12:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-03 12:51 Cedric Hombourger [this message]
2019-06-03 13:56 ` Claudius Heine
2019-06-10 16:20 ` 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=20190603125125.5214-1-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