public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH v2 05/10] image: Add cache_base_repo task
Date: Thu, 11 Oct 2018 18:53:00 +0200	[thread overview]
Message-ID: <20181011165305.1622-6-mosipov@ilbers.de> (raw)
In-Reply-To: <20181011165305.1622-1-mosipov@ilbers.de>

From: Alexander Smirnov <asmirnov@ilbers.de>

This task puts all the packages using in build to base-apt.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
Signed-off-by: Maxim Yu. Osipov <mosipov@ilbers.de>
---
 meta-isar/recipes-core/images/isar-image-base.bb |  3 ++-
 meta/classes/image.bbclass                       | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index 4899593..bf606cc 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -41,7 +41,8 @@ devtmpfs	/dev		devtmpfs	mode=0755,nosuid	0	0
 # End /etc/fstab
 EOF
 
-    setup_root_file_system --clean --fstab "${WORKDIR}/fstab" \
+    setup_root_file_system --clean --keep-apt-cache \
+        --fstab "${WORKDIR}/fstab" \
         "${IMAGE_ROOTFS}" ${IMAGE_PREINSTALL} ${IMAGE_INSTALL}
 
     # Configure root filesystem
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index e948dea..05ff06f 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -123,6 +123,27 @@ do_populate_sdk[depends] = "sdkchroot:do_build"
 
 addtask populate_sdk after do_rootfs
 
+inherit base-apt-helper
+
+do_cache_base_repo[depends] = "base-apt:do_cache_config"
+do_cache_base_repo[stamp-extra-info] = "${MACHINE}-${DISTRO}"
+
+do_cache_base_repo() {
+    if [ -d ${WORKDIR}/apt_cache ]; then
+        populate_base_apt ${WORKDIR}/apt_cache
+    fi
+
+    if [ -d ${BUILDCHROOT_HOST_DIR}/var/cache/apt ]; then
+        populate_base_apt ${BUILDCHROOT_HOST_DIR}/var/cache/apt
+    fi
+
+    if [ -d ${BUILDCHROOT_TARGET_DIR}/var/cache/apt ]; then
+        populate_base_apt ${BUILDCHROOT_TARGET_DIR}/var/cache/apt
+    fi
+}
+
+addtask cache_base_repo after do_rootfs
+
 # Imager are expected to run natively, thus will use the target buildchroot.
 ISAR_CROSS_COMPILE = "0"
 
-- 
2.11.0


  parent reply	other threads:[~2018-10-11 16:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 16:52 [PATCH v2 00/10] Introduce local apt repo to cache upstream debian packages for offline usage Maxim Yu. Osipov
2018-10-11 16:52 ` [PATCH v2 01/10] base-apt: Add helper class Maxim Yu. Osipov
2018-10-23 16:01   ` Henning Schild
2018-10-11 16:52 ` [PATCH v2 02/10] meta: Unify path names to local repositories Maxim Yu. Osipov
2018-10-11 16:52 ` [PATCH v2 03/10] base-apt: Introduce base implementation Maxim Yu. Osipov
2018-10-11 16:52 ` [PATCH v2 04/10] isar-boot-strap: Add option to keep cache Maxim Yu. Osipov
2018-10-23 16:06   ` Henning Schild
2018-10-25 14:28   ` Henning Schild
2018-10-11 16:53 ` Maxim Yu. Osipov [this message]
2018-10-11 16:53 ` [PATCH v2 06/10] isar-bootstrap: Make possible to reuse the cache Maxim Yu. Osipov
2018-10-23 16:30   ` Henning Schild
2018-10-11 16:53 ` [PATCH v2 07/10] buildchroot: Make it buildable from base-apt Maxim Yu. Osipov
2018-10-11 16:53 ` [PATCH v2 08/10] workaround: Use --allow-unauthenticated working with base-apt Maxim Yu. Osipov
2018-10-23 16:09   ` Henning Schild
2018-10-25 14:33     ` Henning Schild
2018-10-11 16:53 ` [PATCH v2 09/10] local.conf: Add option to use cached base repository Maxim Yu. Osipov
2018-10-11 16:53 ` [PATCH v2 10/10] doc: Creation of local apt repo caching upstream Debian packages Maxim Yu. Osipov
2018-10-17 12:13 ` [PATCH v2 00/10] Introduce local apt repo to cache upstream debian packages for offline usage Maxim Yu. Osipov
2018-10-17 17:11 ` Jan Kiszka
2018-10-17 18:15   ` Maxim Yu. Osipov
2018-10-23  9:56     ` Maxim Yu. Osipov
2018-11-19  8:48       ` Baurzhan Ismagulov
2018-11-19  8:58         ` Jan Kiszka
2018-10-23 16:14 ` Henning Schild
2018-10-29 12:28   ` Baurzhan Ismagulov

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=20181011165305.1622-6-mosipov@ilbers.de \
    --to=mosipov@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