public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v1] rootfs: clean up the base-apt list conditionally in the image rootfs
@ 2024-12-16  5:59 srinuvasan.a via isar-users
  2024-12-20  7:47 ` Uladzimir Bely
  0 siblings, 1 reply; 2+ messages in thread
From: srinuvasan.a via isar-users @ 2024-12-16  5:59 UTC (permalink / raw)
  To: isar-users; +Cc: cedric.hombourger, amikan, srinuvasan

From: srinuvasan <srinuvasan.a@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 <srinuvasan.a@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

-- 
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/20241216055917.1284431-1-srinuvasan.a%40siemens.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-20  7:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-16  5:59 [PATCH v1] rootfs: clean up the base-apt list conditionally in the image rootfs srinuvasan.a via isar-users
2024-12-20  7:47 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox