[PATCH] Fix rootfs source list handling in image.bbclass

46 views
Skip to first unread message

Vidyasagar G C

unread,
Nov 27, 2024, 1:02:57 PM11/27/24
to isar-...@googlegroups.com, Vidyasagar G C
Ensure that the APT sources list is only moved if both the sources-list
file and the sources.list.d directory exist. This prevents errors when
APT is not installed, as the sources.list.d directory will be missing.

Signed-off-by: Vidyasagar G C <vidyas...@siemens.com>
---
meta/classes/image.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 472df3cf..31be4267 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -418,7 +418,7 @@ do_rootfs_finalize() {
-maxdepth 1 -name 'qemu-*-static' -type f -delete
fi

- if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ]; then
+ if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ] && [ -e "${ROOTFSDIR}/etc/apt/sources-list.d" ]; then
mv "${ROOTFSDIR}/etc/apt/sources-list" \
"${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
fi
--
2.39.2

Uladzimir Bely

unread,
Dec 6, 2024, 2:28:39 AM12/6/24
to Vidyasagar G C, isar-...@googlegroups.com
Applied to next, thanks.

--
Best regards,
Uladzimir.



Reply all
Reply to author
Forward
0 new messages