From: "Su, Bao Cheng" <baocheng.su@siemens.com>
To: "Heine, Claudius" <claudius.heine.ext@siemens.com>,
"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "Kiszka, Jan" <jan.kiszka@siemens.com>, "ch@denx.de" <ch@denx.de>
Subject: RE: [PATCH] image-postproc-extension: empty mechine-id
Date: Mon, 8 Jul 2019 10:57:36 +0000 [thread overview]
Message-ID: <8f32d02f4d6e433fb17bb80cd0ea5a66@siemens.com> (raw)
In-Reply-To: <f7fcfb51-f929-5ad4-e8d7-84e307d40d87@siemens.com>
> -----Original Message-----
> From: Heine, Claudius (ext) (CT RDA IOT SES-DE)
> Sent: Monday, July 08, 2019 2:48 PM
> To: Su, Bao Cheng (RC-CN DI FA R&D SW); isar-users@googlegroups.com
> Cc: Kiszka, Jan (CT RDA IOT SES-DE); ch@denx.de
> Subject: Re: [PATCH] image-postproc-extension: empty mechine-id
>
> Hi,
>
> On 08/07/2019 05.37, [ext] Su, Bao Cheng wrote:
> >
> > 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.
>
> Good catch!
>
> >
> > 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'
>
> You could probably just replace the `sudo rm ...machine-id` with that line, since `install` would overwrite the content, so removing it would
> not be necessary.
>
> Otherwise LGTM
>
> regards,
> Claudius
>
>
> > }
> >
>
> --
> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de
Please see the revision:
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 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass
index 495eae6..3f7b73b 100644
--- a/meta/classes/image-postproc-extension.bbclass
+++ b/meta/classes/image-postproc-extension.bbclass
@@ -49,5 +49,6 @@ 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}/etc/machine-id'
+ sudo rm -f '${IMAGE_ROOTFS}/var/lib/dbus/machine-id'
+ sudo install -m 644 '/dev/null' '${IMAGE_ROOTFS}/etc/machine-id'
}
--
2.17.1
next prev parent reply other threads:[~2019-07-08 10:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-08 3:37 Su, Bao Cheng
2019-07-08 6:47 ` Claudius Heine
2019-07-08 10:57 ` Su, Bao Cheng [this message]
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=8f32d02f4d6e433fb17bb80cd0ea5a66@siemens.com \
--to=baocheng.su@siemens.com \
--cc=ch@denx.de \
--cc=claudius.heine.ext@siemens.com \
--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