From: claudius.heine.ext@siemens.com
To: isar-users@googlegroups.com
Cc: Claudius Heine <ch@denx.de>
Subject: [PATCH 3/3] image-postproc-extension: add removal of machine-id
Date: Tue, 28 May 2019 10:58:14 +0200 [thread overview]
Message-ID: <20190528085814.12967-4-claudius.heine.ext@siemens.com> (raw)
In-Reply-To: <20190528085814.12967-1-claudius.heine.ext@siemens.com>
From: Claudius Heine <ch@denx.de>
The machine-id(5) should contain a unique id of the machine, but since
this file is created by the systemd postinst script, every machine using
the same image would have the same id.
The file is removed in a postprocessing step and will be regenerated by
systemd on the first boot.
Signed-off-by: Claudius Heine <ch@denx.de>
---
meta/classes/image-postproc-extension.bbclass | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass
index 625ba7d..495eae6 100644
--- a/meta/classes/image-postproc-extension.bbclass
+++ b/meta/classes/image-postproc-extension.bbclass
@@ -26,8 +26,7 @@ update_etc_os_release() {
fi
}
-ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure image_postprocess_mark"
-
+ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_configure"
image_postprocess_configure() {
# Configure root filesystem
if [ -n "${DISTRO_CONFIG_SCRIPT}" ]; then
@@ -39,8 +38,16 @@ image_postprocess_configure() {
fi
}
+ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_mark"
+
image_postprocess_mark() {
BUILD_ID=$(get_build_id)
update_etc_os_release \
--build-id "${BUILD_ID}" --variant "${DESCRIPTION}"
}
+
+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'
+}
--
2.20.1
next prev parent reply other threads:[~2019-05-28 8:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-28 8:58 [PATCH 0/3] Filesystem mounting and machine-id fix claudius.heine.ext
2019-05-28 8:58 ` [PATCH 1/3] wks: added 'rw' to kernel arguments claudius.heine.ext
2019-05-28 17:29 ` Henning Schild
2019-05-29 6:38 ` Claudius Heine
2019-05-28 8:58 ` [PATCH 2/3] image.bbclass: remove fstab generation claudius.heine.ext
2019-05-28 17:34 ` Henning Schild
2019-05-29 6:47 ` Claudius Heine
2019-05-29 11:11 ` Henning Schild
2019-05-28 8:58 ` claudius.heine.ext [this message]
2019-05-28 17:44 ` [PATCH 3/3] image-postproc-extension: add removal of machine-id Henning Schild
2019-05-29 7:00 ` Claudius Heine
2019-05-29 11:06 ` Henning Schild
2019-05-28 19:51 ` Henning Schild
2019-05-29 7:00 ` Matthias Luescher
2019-05-29 7:06 ` Claudius Heine
2019-06-06 17:18 ` Maxim Yu. Osipov
2019-06-04 20:09 ` [PATCH 0/3] Filesystem mounting and machine-id fix Maxim Yu. Osipov
2019-06-05 6:45 ` Claudius Heine
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=20190528085814.12967-4-claudius.heine.ext@siemens.com \
--to=claudius.heine.ext@siemens.com \
--cc=ch@denx.de \
--cc=isar-users@googlegroups.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