From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7346118313451192320 X-Received: by 2002:a05:6402:4588:b0:567:e0e:dda5 with SMTP id ig8-20020a056402458800b005670e0edda5mr898034edb.17.1710401456102; Thu, 14 Mar 2024 00:30:56 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6402:380e:b0:568:2764:b455 with SMTP id es14-20020a056402380e00b005682764b455ls451849edb.1.-pod-prod-00-eu; Thu, 14 Mar 2024 00:30:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmyQD3PtZBNbdaBc3HqyJyc+A6dyjeQebYIHDhjUyvvPsyGjdfyB5/oFuRzKQuAik7D2bz X-Received: by 2002:a17:906:d0c7:b0:a46:6df5:3511 with SMTP id bq7-20020a170906d0c700b00a466df53511mr1296600ejb.4.1710401453640; Thu, 14 Mar 2024 00:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710401453; cv=none; d=google.com; s=arc-20160816; b=q23RFpyE3S0qw9e5e8XcaauxWmYrB5PZlQAELZd65u4/C6y7PZ0VtZBBiI+my4c5zr BmnnudEUbCKvAHIE9kvuIHurP94R4daev2TLN+JV8qOgvhKNqI6ZlwRST7cSNoX3jVyx +YWqA5fTlzJs4GbcKc6Kp99f3du+zrwKqqAfdSDViBzJCDzIju7d+lCPUl0KjDE0+duE 1uT7l08Izfje81eGHaNpn3LJci7sXyAphy5GQEiBnPRV/Q4JPkzlz3gxi5O4vc5VrhPp W5JvoQ0sVx8IWDB+97DEDuIHd0Y1morI8tzQ2rUQyWnisGXWxPPW35/nScljvvPWG72q OY7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=UD5y/dXcMVuvvSNV4kUevqVtox3oeo0vurNRka5Fm2g=; fh=7tclEdh7YbwSQowgJ6LNq720O7H5HTEaqj22NJWRE2E=; b=kLgoWUTO7aZFVzaLgJ/zjKhAwg52dy+eWvg/+yztpA8ytzY+54SDRGWg3tkB49dOOY iPQ4k7WKPuz5GXtwmgazge5smyKmCXIlcnFpu8KRZ4ojQ5c1yqFhsGZPks2xPglpg/fE pKxbzng0VA4fbTzHDyd/3yvR61bHv86dz5bZj5RNK4UJ+ao+9kRmPXrY9+X0btFRdW0d 6fHpl1DnY5ZL3V2gUCpNKXbgfDGbcHuJIDiFsespOK31LZXiZZNkEAkEAaKIfvhUG4Gh hoG1PNfHQfiTwqE9EGIXNgqtt9jsQmctzxvjVBG+DYQh5EG3lUgbqafMfXqMLYrRvdcm LQSg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id bc4-20020a056402204400b00568a42a7564si4948edb.0.2024.03.14.00.30.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Mar 2024 00:30:53 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from hp15.localdomain (mm-209-185-213-37.mogilev.dynamic.pppoe.byfly.by [37.213.185.209]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 42E7Uo9w021482 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Mar 2024 08:30:52 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v6 03/11] meta: Always use base-apt repo in local mode Date: Thu, 14 Mar 2024 10:27:20 +0300 Message-ID: <20240314073047.29465-4-ubely@ilbers.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240314073047.29465-1-ubely@ilbers.de> References: <20240314073047.29465-1-ubely@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: 17ShcG9uul58 This means only local URLs in apt sources.list* are 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 --- meta/classes/rootfs.bbclass | 5 +++-- .../isar-bootstrap/isar-bootstrap.inc | 12 +++++++---- meta/recipes-devtools/base-apt/base-apt.bb | 21 ++++++++++++------- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass index 498fbfd6..ddc5d12c 100644 --- a/meta/classes/rootfs.bbclass +++ b/meta/classes/rootfs.bbclass @@ -54,8 +54,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' ] + # Mount base-apt if 'ISAR_PREFETCH_BASE_APT' or 'ISAR_USE_CACHED_BASE_REPO' is set + if [ "${@repr(bb.utils.to_boolean(d.getVar('ISAR_PREFETCH_BASE_APT')))}" = 'True' ] || \ + [ "${@repr(bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')))}" = 'True' ] then mkdir -p '${ROOTFSDIR}/base-apt' mountpoint -q '${ROOTFSDIR}/base-apt' || \ diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index 17f19fd8..05c80308 100644 --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -42,7 +42,8 @@ python () { # installation afterwards. However, debootstrap will include the key into # the rootfs automatically thus the right place is distro_bootstrap_keys. - if bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')): + if bb.utils.to_boolean(d.getVar('ISAR_PREFETCH_BASE_APT')) or \ + bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')) : own_pub_key = d.getVar("BASE_REPO_KEY") if own_pub_key: distro_bootstrap_keys += own_pub_key.split() @@ -110,7 +111,8 @@ def parse_aptsources_list_line(source_list_line): def get_apt_source_mirror(d, aptsources_entry_list): import re - if bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')): + if bb.utils.to_boolean(d.getVar('ISAR_PREFETCH_BASE_APT')) or \ + bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')) : premirrors = "\S* file://${REPO_BASE_DIR}/${BOOTSTRAP_BASE_DISTRO}\n" else: premirrors = d.getVar('DISTRO_APT_PREMIRRORS') or "" @@ -283,7 +285,8 @@ do_bootstrap() { if [ -f "${DISTRO_BOOTSTRAP_KEYRING}" ]; then debootstrap_args="$debootstrap_args --keyring=${DISTRO_BOOTSTRAP_KEYRING}" fi - if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" -a -z "${BASE_REPO_KEY}" ]; then + if [ "${ISAR_PREFETCH_BASE_APT}" = "1" -a -z "${BASE_REPO_KEY}" ] || \ + [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" -a -z "${BASE_REPO_KEY}" ]; then debootstrap_args="$debootstrap_args --no-check-gpg" fi E="${@ isar_export_proxies(d)}" @@ -314,7 +317,8 @@ 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 + if [ "${ISAR_PREFETCH_BASE_APT}" = "1" ] || \ + [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then line="file:///base-apt/${BOOTSTRAP_BASE_DISTRO} ${BASE_DISTRO_CODENAME} main" if [ -z "${BASE_REPO_KEY}" ]; then line="[trusted=yes] ${line}" diff --git a/meta/recipes-devtools/base-apt/base-apt.bb b/meta/recipes-devtools/base-apt/base-apt.bb index ea885fe6..e62958d1 100644 --- a/meta/recipes-devtools/base-apt/base-apt.bb +++ b/meta/recipes-devtools/base-apt/base-apt.bb @@ -57,9 +57,12 @@ repo() { "${BASE_DISTRO_CODENAME}" \ "${WORKDIR}/distributions.in" \ "${KEYFILES}" - populate_base_apt "${BASE_DISTRO}" - repo_sanity_test "${REPO_BASE_DIR}"/"${BASE_DISTRO}" \ - "${REPO_BASE_DB_DIR}"/"${BASE_DISTRO}" + if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ] && \ + [ "${ISAR_PREFETCH_BASE_APT}" != "1" ]; then + populate_base_apt "${BASE_DISTRO}" + repo_sanity_test "${REPO_BASE_DIR}"/"${BASE_DISTRO}" \ + "${REPO_BASE_DB_DIR}"/"${BASE_DISTRO}" + fi if [ '${BASE_DISTRO}' != '${HOST_BASE_DISTRO}' ]; then repo_create "${REPO_BASE_DIR}"/"${HOST_BASE_DISTRO}" \ @@ -67,14 +70,18 @@ repo() { "${BASE_DISTRO_CODENAME}" \ "${WORKDIR}/distributions.in" \ "${KEYFILES}" - populate_base_apt "${HOST_BASE_DISTRO}" - repo_sanity_test "${REPO_BASE_DIR}"/"${HOST_BASE_DISTRO}" \ - "${REPO_BASE_DB_DIR}"/"${HOST_BASE_DISTRO}" + if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ] && \ + [ "${ISAR_PREFETCH_BASE_APT}" != "1" ]; then + populate_base_apt "${HOST_BASE_DISTRO}" + repo_sanity_test "${REPO_BASE_DIR}"/"${HOST_BASE_DISTRO}" \ + "${REPO_BASE_DB_DIR}"/"${HOST_BASE_DISTRO}" + fi fi } python do_cache() { - if not bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')): + if not bb.utils.to_boolean(d.getVar('ISAR_PREFETCH_BASE_APT')) and \ + not bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')): return 0 for key in d.getVar('BASE_REPO_KEY').split(): -- 2.43.0