From: "'Badrikesh Prusty' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: felix.moessbauer@siemens.com,
Badrikesh Prusty <badrikesh.prusty@siemens.com>
Subject: [PATCH] image-postproc-extension: fix machine-id file being written empty
Date: Wed, 23 Sep 2026 14:13:06 -0400 [thread overview]
Message-ID: <20260923181306.43634-1-badrikesh.prusty@siemens.com> (raw)
The pipe operation was lost when passing data to run_in_chroot because
run_privileged_heredoc consumes stdin for the heredoc script, resulting
in an empty /etc/machine-id file.
Move the pipe operation inside the chroot environment to fix it. This
ensures /etc/machine-id is properly written with either "uninitialized"
(systemd >= 247) or empty string (systemd < 247).
Fixes: 14acf490 ("introduce wrappers for privileged execution")
Signed-off-by: Badrikesh Prusty <badrikesh.prusty@siemens.com>
---
meta/classes-recipe/image-postproc-extension.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes-recipe/image-postproc-extension.bbclass b/meta/classes-recipe/image-postproc-extension.bbclass
index 59128c2a..9e37a65b 100644
--- a/meta/classes-recipe/image-postproc-extension.bbclass
+++ b/meta/classes-recipe/image-postproc-extension.bbclass
@@ -63,7 +63,7 @@ image_postprocess_machine_id() {
if dpkg --compare-versions "$SYSTEMD_VERSION" "lt" "247"; then
MACHINE_ID=""
fi
- echo "$MACHINE_ID" | run_in_chroot ${IMAGE_ROOTFS} tee /etc/machine-id
+ run_in_chroot ${IMAGE_ROOTFS} sh -c "echo $MACHINE_ID | tee /etc/machine-id"
run_privileged rm -f '${IMAGE_ROOTFS}/var/lib/dbus/machine-id'
}
--
2.39.5
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260923181306.43634-1-badrikesh.prusty%40siemens.com.
next reply other threads:[~2026-09-23 18:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 18:13 'Badrikesh Prusty' via isar-users [this message]
2026-09-23 18:41 ` 'MOESSBAUER, Felix' via isar-users
2026-09-30 10:43 ` Zhihang Wei
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=20260923181306.43634-1-badrikesh.prusty@siemens.com \
--to=isar-users@googlegroups.com \
--cc=badrikesh.prusty@siemens.com \
--cc=felix.moessbauer@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