public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Andreas Naumann <anaumann@emlix.com>
To: isar-users@googlegroups.com
Cc: Andreas Naumann <anaumann@emlix.com>
Subject: [PATCH 4/4] mmdebstrap: lock isar-apt while bootstrapping
Date: Tue, 12 Aug 2025 15:02:49 +0200	[thread overview]
Message-ID: <20250812130249.709960-5-anaumann@emlix.com> (raw)
In-Reply-To: <20250812130249.709960-1-anaumann@emlix.com>

isar-apt must not change while we bootstrap from it. Otherwise, e.g.
if a dpkg recipe deploys a deb-file into it, the Releases or Packages
file may not match the hash which causes apt to stop with an error.

In order to use the bitbake lockfile flag on the entire task, which
is preferred to a flock-wrap around the mmdebstrap command, move code
with conflicting locking to a new finalize task.

Signed-off-by: Andreas Naumann <anaumann@emlix.com>
---
 meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
index b03ae7d772..885963fcc4 100644
--- a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
+++ b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
@@ -86,6 +86,7 @@ do_bootstrap[network] = "${TASK_USE_NETWORK_AND_SUDO}"
 DEB_DL_LOCK ?= "${DEBDIR}/${BOOTSTRAP_BASE_DISTRO}-${BASE_DISTRO_CODENAME}.lock"
 
 do_bootstrap[vardeps] += "DISTRO_BOOTSTRAP_BASE_PACKAGES"
+do_bootstrap[lockfiles] = "${REPO_ISAR_DIR}/isar.lock"
 do_bootstrap() {
     if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
         if [ -z "${COMPAT_DISTRO_ARCH}" ]; then
@@ -217,7 +218,10 @@ do_bootstrap() {
                    "${@get_distro_suite(d)}" \
                    "${WORKDIR}/rootfs.tar.zst" \
                    "$bootstrap_list"
+}
+addtask bootstrap before do_build after do_generate_keyrings
 
+do_bootstrap_finalize() {
     # Finalize bootstrap by setting the link in deploy
     sudo ln -Tfsr "${WORKDIR}/rootfs.tar.zst" "${DEPLOY_ISAR_BOOTSTRAP}.tar.zst"
 
@@ -226,9 +230,9 @@ do_bootstrap() {
         sudo rm -rf --one-file-system "${WORKDIR}/dl_dir"
     fi
 }
-addtask bootstrap before do_build after do_generate_keyrings
+addtask do_bootstrap_finalize after do_bootstrap before do_build
 
-SSTATETASKS += "do_bootstrap"
+SSTATETASKS += "do_bootstrap do_bootstrap_finalize"
 SSTATECREATEFUNCS += "bootstrap_sstate_prepare"
 SSTATEPOSTINSTFUNCS += "bootstrap_sstate_finalize"
 
-- 
2.43.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/20250812130249.709960-5-anaumann%40emlix.com.

      parent reply	other threads:[~2025-08-12 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12 13:02 [PATCH 0/4] Bootstrap from local isar-apt repo Andreas Naumann
2025-08-12 13:02 ` [PATCH 1/4] mmdebstrap: Make use of defined variables Andreas Naumann
2025-08-12 13:02 ` [PATCH 2/4] mmdebstrap: Include isar-apt in bootstrapping sources Andreas Naumann
2025-08-12 13:02 ` [PATCH 3/4] mmdebstrap: Allow for DISTRO_SOURCE to be empty Andreas Naumann
2025-08-12 13:02 ` Andreas Naumann [this message]

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=20250812130249.709960-5-anaumann@emlix.com \
    --to=anaumann@emlix.com \
    --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