public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Cedric Hombourger <cedric.hombourger@siemens.com>,
	Srinuvasan A <srinuvasan.a@siemens.com>,
	Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH] image: Account for differences with mmdebstrap
Date: Mon, 10 Feb 2025 13:49:54 +0100	[thread overview]
Message-ID: <b1e4bdbf-bb22-4eef-844d-10b8ebab32a8@siemens.com> (raw)

From: Jan Kiszka <jan.kiszka@siemens.com>

Only legacy debootstrap needed moving of sources-list. With mmdebstrap,
we are now creating the list twice, and apt will complain about that on
the target.

Furthermore, the cleaning prior to installing custom lists needs to take
the different filenames with mmdebstrap into account.

Fixes: d0fd18ef87d2 ("meta: Allow selecting bootstrap providers")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Please double-check, I didn't test the custom lists path.

 meta/classes/image.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 49861b75..56eca202 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -416,12 +416,16 @@ do_rootfs_finalize() {
                 -maxdepth 1 -name 'qemu-*-static' -type f -delete
         fi
 
-        if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ] && [ -d "${ROOTFSDIR}/etc/apt/sources.list.d" ]; then
+        # needed only for debootstrap, mmdebstrap leave a 0000bootstrap.list behind
+        if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ] && \
+           [ -d "${ROOTFSDIR}/etc/apt/sources.list.d" ] && \
+           [ -z "$(find ${ROOTFSDIR}/etc/apt/sources.list.d -mindepth 1)" ]; then
             mv "${ROOTFSDIR}/etc/apt/sources-list" \
                 "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
         fi
+
         if [ -n "${IMAGE_LISTS}" ]; then
-            rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
+            find "${ROOTFSDIR}/etc/apt/sources.list.d/" ! -type d -exec rm -f {} \;
             for l in ${IMAGE_LISTS}; do
                 cp "${WORKDIR}"/${l} "${ROOTFSDIR}/etc/apt/sources.list.d/"
             done
-- 
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/b1e4bdbf-bb22-4eef-844d-10b8ebab32a8%40siemens.com.

             reply	other threads:[~2025-02-10 12:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10 12:49 'Jan Kiszka' via isar-users [this message]
2025-02-18  6:48 ` 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=b1e4bdbf-bb22-4eef-844d-10b8ebab32a8@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=amikan@ilbers.de \
    --cc=cedric.hombourger@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --cc=srinuvasan.a@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