[PATCH v1] rootfs: clean up the base-apt list conditionally in the image rootfs

14 views
Skip to first unread message

srinuv...@siemens.com

unread,
Dec 16, 2024, 12:51:24 AM12/16/24
to isar-...@googlegroups.com, cedric.h...@siemens.com, ami...@ilbers.de, srinuvasan
From: srinuvasan <srinuv...@siemens.com>

base-apt list is created under /etc/apt/sources.list.d only when we
enable the ISAR_USE_CACHED_BASE_REPO as "1", otherwise, we use the
bootstrap.list

Presently the removal of base-apt.list is happening unconditionally,
hence remove the base-apt list only when we use the local cached repo.

isar-mmdebstrap generates the base-apt list with prefixes 0000 (0000base-apt.list)
and isar-bootstrap generates the base-apt list with no prefixes (base-apt.list)
handle the scenario to remove if any one of the list present under /etc/apt/sources.list.d

Signed-off-by: srinuvasan <srinuv...@siemens.com>
---
meta/classes/rootfs.bbclass | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index dd43fd4e..205da640 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -359,16 +359,16 @@ rootfs_cleanup_isar_apt() {
set -e
rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/isar-apt.list"
rm -f "${ROOTFSDIR}/etc/apt/preferences.d/isar-apt"
+ rm -f "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar"
EOSUDO
}

-ROOTFS_POSTPROCESS_COMMAND += "rootfs_cleanup_base_apt"
+ROOTFS_POSTPROCESS_COMMAND += "${@'rootfs_cleanup_base_apt' if bb.utils.to_boolean(d.getVar('ISAR_USE_CACHED_BASE_REPO')) else ''}"
rootfs_cleanup_base_apt[weight] = "2"
rootfs_cleanup_base_apt() {
sudo -s <<'EOSUDO'
set -e
- rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
- rm -f "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar"
+ rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/*base-apt.list"
EOSUDO
}

--
2.39.5

Uladzimir Bely

unread,
Dec 20, 2024, 2:47:59 AM12/20/24
to srinuv...@siemens.com, isar-...@googlegroups.com
Applied to next, thanks.

--
Best regards,
Uladzimir.



Reply all
Reply to author
Forward
0 new messages