[PATCH] image: Account for differences with mmdebstrap

16 views
Skip to first unread message

Jan Kiszka

unread,
Feb 10, 2025, 7:50:04 AM2/10/25
to isar-users, Cedric Hombourger, Srinuvasan A, Anton Mikanovich
From: Jan Kiszka <jan.k...@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.k...@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

Uladzimir Bely

unread,
Feb 18, 2025, 1:48:16 AM2/18/25
to Jan Kiszka, isar-users
Applied to next, thanks.

--
Best regards,
Uladzimir.



Reply all
Reply to author
Forward
0 new messages