public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH v3 3/5] meta: always use base-apt repo in local mode
Date: Fri, 25 Mar 2022 11:32:24 +0100	[thread overview]
Message-ID: <20220325103226.27033-4-ubely@ilbers.de> (raw)
In-Reply-To: <20220325103226.27033-1-ubely@ilbers.de>

This means that only local URLs in apt sources.list* is present during
the build. Any installation of packages is done from local base-apt.
So, base-apt should be always mounted in *_do_mounts since now.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/buildchroot.bbclass              | 10 +++-----
 meta/classes/rootfs.bbclass                   | 10 +++-----
 .../isar-bootstrap/isar-bootstrap.inc         | 24 ++++++++-----------
 3 files changed, 16 insertions(+), 28 deletions(-)

diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
index dd8f4206..23e78c24 100644
--- a/meta/classes/buildchroot.bbclass
+++ b/meta/classes/buildchroot.bbclass
@@ -50,13 +50,9 @@ 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
+        mkdir -p '${BUILDCHROOT_DIR}/base-apt'
+        mountpoint -q '${BUILDCHROOT_DIR}/base-apt' || \
+            mount --bind '${REPO_BASE_DIR}' '${BUILDCHROOT_DIR}/base-apt'
 
         # Refresh or remove /etc/resolv.conf at this chance
         if [ "${@repr(bb.utils.to_boolean(d.getVar('BB_NO_NETWORK')))}" = 'True' ]
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index ba86c60a..54d1f714 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -52,13 +52,9 @@ rootfs_do_mounts() {
                 mount --bind '${REPO_ISAR_DIR}/${DISTRO}' '${ROOTFSDIR}/isar-apt'
         fi
 
-        # 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 '${ROOTFSDIR}/base-apt'
-            mountpoint -q '${ROOTFSDIR}/base-apt' || \
-                mount --bind '${REPO_BASE_DIR}' '${ROOTFSDIR}/base-apt'
-        fi
+        mkdir -p '${ROOTFSDIR}/base-apt'
+        mountpoint -q '${ROOTFSDIR}/base-apt' || \
+            mount --bind '${REPO_BASE_DIR}' '${ROOTFSDIR}/base-apt'
 
 EOSUDO
 }
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 24925dbb..545bd474 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -341,20 +341,16 @@ do_bootstrap() {
         install -v -m644 "${APTPREFS}" \
                          "${ROOTFSDIR}/etc/apt/preferences.d/bootstrap"
         mkdir -p "${ROOTFSDIR}/etc/apt/sources.list.d"
-        if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
-            line="file:///base-apt/${BASE_DISTRO} ${BASE_DISTRO_CODENAME} main"
-            if [ -z "${BASE_REPO_KEY}" ]; then
-                line="[trusted=yes] ${line}"
-            fi
-            echo "deb ${line}" >  "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
-            echo "deb-src ${line}" >>  "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
-
-            mkdir -p ${ROOTFSDIR}/base-apt
-            mount --bind ${REPO_BASE_DIR} ${ROOTFSDIR}/base-apt
-        else
-            install -v -m644 "${APTSRCS}" \
-                             "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
-        fi
+
+        line="file:///base-apt/${BASE_DISTRO} ${BASE_DISTRO_CODENAME} main"
+        [ -z "${BASE_REPO_KEY}" ] && line="[trusted=yes] ${line}"
+
+        echo "deb ${line}" >  "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
+        echo "deb-src ${line}" >>  "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
+
+        mkdir -p ${ROOTFSDIR}/base-apt
+        mount --bind ${REPO_BASE_DIR} ${ROOTFSDIR}/base-apt
+
         install -v -m644 "${APTSRCS_INIT}" "${ROOTFSDIR}/etc/apt/sources-list"
         rm -f "${ROOTFSDIR}/etc/apt/sources.list"
         rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"*
-- 
2.20.1


  parent reply	other threads:[~2022-03-25 10:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 10:32 [PATCH v3 0/5] Improving base-apt usage PoC Uladzimir Bely
2022-03-25 10:32 ` [PATCH v3 1/5] Add debrepo python script handling base-apt Uladzimir Bely
2022-03-25 10:32 ` [PATCH v3 2/5] meta: Use cached base-apt repo to debootstrap Uladzimir Bely
2022-03-25 10:32 ` Uladzimir Bely [this message]
2022-03-25 10:32 ` [PATCH v3 4/5] base-apt: Predownload packages to base-apt before install Uladzimir Bely
2022-03-30 13:41   ` Moessbauer, Felix
2022-03-25 10:32 ` [PATCH v3 5/5] draft: make isar-apt repo visible for base-apt Uladzimir Bely

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=20220325103226.27033-4-ubely@ilbers.de \
    --to=ubely@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