public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] classes/image-postproc-extension: Remove /etc/machine-id
@ 2022-04-19 15:36 Q. Gylstorff
  2022-04-19 16:15 ` Jan Kiszka
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Q. Gylstorff @ 2022-04-19 15:36 UTC (permalink / raw)
  To: jan.kiszka, isar-users

From: kas <kas@example.com>

In a read-only system the machine id should be deleted or 
set to `unitialized\n`[1]. 

Systemd will generate a new machine-id during the first boot. 
In the case of a read-only root file system Systemd generates a mount point with 
the machine id. If an overlay for /etc is used this creates a mount conflict. 
To avoid the conflict between the overlay filesystem and systemd /etc/machine-id 
mount point deleted the file /etc/machine-id.

[1]: https://systemd.io/BUILDING_IMAGES/

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@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 ca520273..0c412c0d 100644
--- a/meta/classes/image-postproc-extension.bbclass
+++ b/meta/classes/image-postproc-extension.bbclass
@@ -57,7 +57,7 @@ ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_machine_id"
 image_postprocess_machine_id() {
     # systemd(1) takes care of recreating the machine-id on first boot
     sudo rm -f '${IMAGE_ROOTFS}/var/lib/dbus/machine-id'
-    sudo install -m 644 '/dev/null' '${IMAGE_ROOTFS}/etc/machine-id'
+    sudo rm -f '${IMAGE_ROOTFS}/etc/machine-id'
 }
 
 ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_sshd_key_regen"
-- 
2.35.1


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

end of thread, other threads:[~2022-05-14 14:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 15:36 [PATCH] classes/image-postproc-extension: Remove /etc/machine-id Q. Gylstorff
2022-04-19 16:15 ` Jan Kiszka
2022-04-20  9:00   ` Henning Schild
2022-04-19 19:10 ` Anton Mikanovich
2022-04-20  7:28 ` [PATCH v2] " Quirin Gylstorff
2022-04-20 13:00   ` [PATCH v3] " Quirin Gylstorff
2022-05-14 14:04     ` Anton Mikanovich
2022-04-20  8:44 ` [PATCH] " Henning Schild

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