public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] image-postproc-extension: empty mechine-id
@ 2019-07-08  3:37 Su, Bao Cheng
  2019-07-08  6:47 ` Claudius Heine
  0 siblings, 1 reply; 10+ messages in thread
From: Su, Bao Cheng @ 2019-07-08  3:37 UTC (permalink / raw)
  To: isar-users; +Cc: Kiszka, Jan, ch


From: Su Bao Cheng <baocheng.su@siemens.com>
Date: Thu, 4 Jul 2019 15:52:17 +0800
Subject: [PATCH] image-postproc-extension: empty mechine-id
To: isar-users@googlegroups.com

According to manpage of debian machine-id @
https://manpages.debian.org/buster/systemd/machine-id.5.en.html,
/etc/machine-id should be empty instead of removing.

Also according to above manpage, the dbus machine-id is copied to
/etc/machine-id if systemd machine-id is empty. However, the dbus
machine-id is also created during isar building, which stays the same
for every machine using the same image.

So here instead of removing, empty this file, and the mechine id will
be regenerated at the first boot. Also remove the dbus machine-id to
prevent copying.

Signed-off-by: Su Bao Cheng <baocheng.su@siemens.com>
---
 meta/classes/image-postproc-extension.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass
index 495eae6..96f5ad6 100644
--- a/meta/classes/image-postproc-extension.bbclass
+++ b/meta/classes/image-postproc-extension.bbclass
@@ -49,5 +49,7 @@ image_postprocess_mark() {
 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 rm -f '${IMAGE_ROOTFS}/etc/machine-id'
+    sudo install -m 644 '/dev/null' '${IMAGE_ROOTFS}/etc/machine-id'
 }
-- 
2.17.1


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

end of thread, other threads:[~2019-07-11 16:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08  3:37 [PATCH] image-postproc-extension: empty mechine-id Su, Bao Cheng
2019-07-08  6:47 ` Claudius Heine
2019-07-08 10:57   ` Su, Bao Cheng
2019-07-10  8:48     ` Baurzhan Ismagulov
2019-07-10  9:19       ` Su, Bao Cheng
2019-07-10 11:44       ` Henning Schild
2019-07-11  4:06         ` Su, Bao Cheng
2019-07-11  5:34           ` Jan Kiszka
2019-07-11 10:25             ` Baurzhan Ismagulov
2019-07-11 16:37             ` Henning Schild

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