public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v2 1/2] bootstrap: directly deploy via sstate cache
Date: Tue, 21 Jul 2026 17:04:14 +0200	[thread overview]
Message-ID: <20260721150415.845260-1-felix.moessbauer@siemens.com> (raw)

To simplify the sstate handling (including cleanup), we deploy via
sstate-outputdirs.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes-recipe/bootstrap.bbclass         |  5 ---
 .../isar-mmdebstrap/isar-mmdebstrap-host.bb   |  2 +-
 .../isar-mmdebstrap/isar-mmdebstrap-target.bb |  2 +-
 .../isar-mmdebstrap/isar-mmdebstrap.inc       | 34 ++++---------------
 4 files changed, 8 insertions(+), 35 deletions(-)

diff --git a/meta/classes-recipe/bootstrap.bbclass b/meta/classes-recipe/bootstrap.bbclass
index 51cd2517..c1a59fd2 100644
--- a/meta/classes-recipe/bootstrap.bbclass
+++ b/meta/classes-recipe/bootstrap.bbclass
@@ -226,8 +226,3 @@ python do_apt_config_prepare() {
     aggregate_aptsources_list(d, apt_sources_list, apt_sources_out)
 }
 addtask apt_config_prepare before do_bootstrap after do_unpack
-
-CLEANFUNCS = "clean_deploy"
-clean_deploy() {
-    rm -f "${DEPLOY_ISAR_BOOTSTRAP}"
-}
diff --git a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap-host.bb b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap-host.bb
index 6de9c21a..fa4b76a6 100644
--- a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap-host.bb
+++ b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap-host.bb
@@ -7,7 +7,7 @@
 
 Description = "Minimal host Debian root file system"
 
-DEPLOY_ISAR_BOOTSTRAP = "${DEPLOY_DIR_BOOTSTRAP}/${HOST_DISTRO}-host_${DISTRO}-${DISTRO_ARCH}"
+DEPLOY_ISAR_BOOTSTRAP = "${HOST_DISTRO}-host_${DISTRO}-${DISTRO_ARCH}"
 
 PROVIDES += "bootstrap-host"
 
diff --git a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap-target.bb b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap-target.bb
index a9695d44..9b51ab88 100644
--- a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap-target.bb
+++ b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap-target.bb
@@ -7,7 +7,7 @@
 
 Description = "Minimal target Debian root file system"
 
-DEPLOY_ISAR_BOOTSTRAP = "${DEPLOY_DIR_BOOTSTRAP}/${DISTRO}-${DISTRO_ARCH}"
+DEPLOY_ISAR_BOOTSTRAP = "${DISTRO}-${DISTRO_ARCH}"
 MMOPTS ?= "${DISTRO_MM_OPTS}"
 
 PROVIDES += "bootstrap-target"
diff --git a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
index a2e15627..994da174 100644
--- a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
+++ b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
@@ -13,6 +13,7 @@ DISTRO_BOOTSTRAP_BASE_PACKAGES += "locales apt"
 DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = " ca-certificates"
 
 BOOTSTRAP_TMPDIR = "${WORKDIR}/tempdir"
+DEPLOYDIR = "${WORKDIR}/deploy"
 
 # Fix for /var/lib/apt/available while maybe-jessie-or-older hook do not work
 MM_HOOK_JESSIE = "/usr/share/mmdebstrap/hooks/jessie-or-older"
@@ -129,7 +130,10 @@ do_bootstrap[vardeps] += " \
     ${DISTRO_VARS_PREFIX}DISTRO_APT_SOURCES \
     bootstrap_cleanup \
     "
-do_bootstrap[dirs] = "${DEPLOY_DIR_BOOTSTRAP} ${BOOTSTRAP_TMPDIR} ${WORKDIR}/trusted.gpg.d ${WORKDIR}/sources.list.d"
+do_bootstrap[cleandirs] = "${DEPLOYDIR}"
+do_bootstrap[sstate-inputdirs] = "${DEPLOYDIR}"
+do_bootstrap[sstate-outputdirs] = "${DEPLOY_DIR_BOOTSTRAP}"
+do_bootstrap[dirs] = "${BOOTSTRAP_TMPDIR} ${WORKDIR}/trusted.gpg.d ${WORKDIR}/sources.list.d"
 do_bootstrap[depends] = "base-apt:do_cache isar-apt:do_cache_config"
 do_bootstrap[network] = "${TASK_USE_NETWORK_AND_SUDO}"
 
@@ -259,10 +263,7 @@ do_bootstrap() {
                    ${@get_distro_components_argument(d)} \
                    "${@get_distro_suite(d)}" \
                    - \
-                   "$bootstrap_list" > ${WORKDIR}/rootfs.tar.zst
-
-    # Finalize bootstrap by setting the link in deploy
-    ln -Tfsr "${WORKDIR}/rootfs.tar.zst" "${DEPLOY_ISAR_BOOTSTRAP}.tar.zst"
+                   "$bootstrap_list" > ${DEPLOYDIR}/${DEPLOY_ISAR_BOOTSTRAP}.tar.zst
 
     if [ "${ISAR_USE_CACHED_BASE_REPO}" != "1" ]; then
         deb_dl_dir_export "${WORKDIR}/dl_dir" "${BOOTSTRAP_BASE_DISTRO}-${BASE_DISTRO_CODENAME}"
@@ -273,31 +274,8 @@ do_bootstrap() {
 addtask bootstrap before do_build after do_generate_keyrings
 
 SSTATETASKS += "do_bootstrap"
-SSTATECREATEFUNCS += "bootstrap_sstate_prepare"
-SSTATEPOSTINSTFUNCS += "bootstrap_sstate_finalize"
-
-bootstrap_sstate_prepare() {
-    [ "${SSTATE_CURRTASK}" = "bootstrap" ] || return 0
-
-    # this runs in SSTATE_BUILDDIR, which will be deleted automatically
-    cp -a "${WORKDIR}/rootfs.tar.zst" ./bootstrap.tar.zst
-}
-
-bootstrap_sstate_finalize() {
-    [ "${SSTATE_CURRTASK}" = "bootstrap" ] || return 0
-
-    # this runs in SSTATE_INSTDIR
-    # we should restore symlinks after using tar
-    if [ -f bootstrap.tar.zst ]; then
-        mv bootstrap.tar.zst "${WORKDIR}/rootfs.tar.zst"
-        ln -Tfsr "${WORKDIR}/rootfs.tar.zst" \
-                 "${DEPLOY_ISAR_BOOTSTRAP}.tar.zst"
-    fi
-}
 
 python do_bootstrap_setscene() {
     sstate_setscene(d)
 }
-
 addtask do_bootstrap_setscene
-do_bootstrap_setscene[dirs] = "${DEPLOY_DIR_BOOTSTRAP}"
-- 
2.53.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260721150415.845260-1-felix.moessbauer%40siemens.com.

             reply	other threads:[~2026-07-21 15:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 15:04 'Felix Moessbauer' via isar-users [this message]
2026-07-21 15:04 ` [PATCH v2 2/2] dpkg: " 'Felix Moessbauer' via isar-users
2026-07-23 10:16   ` 'MOESSBAUER, Felix' via isar-users
2026-07-23 13:36     ` Zhihang Wei
2026-07-28 18:24   ` 'Jan Kiszka' via isar-users
2026-07-29  8:07     ` 'MOESSBAUER, Felix' via isar-users
2026-07-28 15:29 ` [PATCH v2 1/2] bootstrap: " Zhihang Wei

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=20260721150415.845260-1-felix.moessbauer@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=felix.moessbauer@siemens.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