public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2] classes/image-postproc: chroot before postprocessing /etc/machine-id
@ 2025-09-17  9:28 alexander.heinisch via isar-users
  0 siblings, 0 replies; only message in thread
From: alexander.heinisch via isar-users @ 2025-09-17  9:28 UTC (permalink / raw)
  To: isar-users; +Cc: felix.moessbauer, Alexander Heinisch

From: Alexander Heinisch <alexander.heinisch@siemens.com>

If /etc/machine-id happens to be a link to e.g. /var/...
the postprocessing overrides build-hosts /var/... instead of
the desired file on the rootfs.

Signed-off-by: Alexander Heinisch <alexander.heinisch@siemens.com>
---
 meta/classes/image-postproc-extension.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass
index 991bac4c..b332e826 100644
--- a/meta/classes/image-postproc-extension.bbclass
+++ b/meta/classes/image-postproc-extension.bbclass
@@ -63,7 +63,7 @@ image_postprocess_machine_id() {
     if dpkg --compare-versions "$SYSTEMD_VERSION" "lt" "247"; then
         MACHINE_ID=""
     fi
-    echo "$MACHINE_ID" | sudo tee '${IMAGE_ROOTFS}/etc/machine-id'
+    echo "$MACHINE_ID" | sudo chroot ${IMAGE_ROOTFS} tee /etc/machine-id
     sudo rm -f '${IMAGE_ROOTFS}/var/lib/dbus/machine-id'
 }
 
-- 
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/20250917092841.144528-1-alexander.heinisch%40siemens.com.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-17  9:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-17  9:28 [PATCH v2] classes/image-postproc: chroot before postprocessing /etc/machine-id alexander.heinisch via isar-users

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