public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] do_bootstrap if {HOST,ROOTFS,DISTRO}_ARCH is not set warns
@ 2023-01-30 12:51 roberto.foglietta
  0 siblings, 0 replies; only message in thread
From: roberto.foglietta @ 2023-01-30 12:51 UTC (permalink / raw)
  To: isar-users; +Cc: roberto.foglietta

From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>

isar-debootstrap, do_bootstrap(): configuration warning added

These variables determine which debootstrap command to use because
in the general case the qemu-debootstrap should be used but it is
a slower choice when the host/target architectures match. This is
obviously managed by ISAR but the machine configuration file set
by the user could miss to properly set one of these 3 values.

So it is necessary to warn about unless the ISAR layer will properly
fix the user shortage. Also, the day the ISAR layer will correctly
address any lack, a double-check reminder/warning would be useful
because fixed things could be broken again in the future.

Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index faba73fe..5afe49b6 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -291,11 +291,15 @@ do_bootstrap() {
     sudo rm -rf --one-file-system "${ROOTFSDIR}"
     deb_dl_dir_import "${ROOTFSDIR}" "${BOOTSTRAP_BASE_DISTRO}-${BASE_DISTRO_CODENAME}"
 
+    if [ "${BOOTSTRAP_FOR_HOST}" = "0" ]; then
+        test -z "${HOST_ARCH}" -o -z "${ROOTFS_ARCH}" -o -z "${DISTRO_ARCH}" && \
+            bbwarn "*** ATTENTION *** BOOTSTRAP_FOR_HOST=0, DEBOOTSTRAP=${DEBOOTSTRAP},"\
+                "HOST_ARCH=${HOST_ARCH}, ROOTFS_ARCH=${ROOTFS_ARCH}, DISTRO_ARCH=${DISTRO_ARCH}."
+        export arch_param="--arch=${DISTRO_ARCH}"
+    fi
+
     sudo -E -s <<'EOSUDO'
         set -e
-        if [ "${BOOTSTRAP_FOR_HOST}" = "0" ]; then
-            arch_param="--arch=${DISTRO_ARCH}"
-        fi
         ${DEBOOTSTRAP} $debootstrap_args \
                        $arch_param \
                        ${@get_distro_components_argument(d)} \
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-30 12:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 12:51 [PATCH] do_bootstrap if {HOST,ROOTFS,DISTRO}_ARCH is not set warns roberto.foglietta

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