public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Su, Bao Cheng" <baocheng.su@siemens.com>
To: "isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "Kiszka, Jan" <jan.kiszka@siemens.com>, "ch@denx.de" <ch@denx.de>
Subject: [PATCH] image-postproc-extension: empty mechine-id
Date: Mon, 8 Jul 2019 03:37:40 +0000	[thread overview]
Message-ID: <7a6b3fd0f6414612ab93e8a0044b2d96@siemens.com> (raw)


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


             reply	other threads:[~2019-07-08  3:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08  3:37 Su, Bao Cheng [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a6b3fd0f6414612ab93e8a0044b2d96@siemens.com \
    --to=baocheng.su@siemens.com \
    --cc=ch@denx.de \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox