From: Zhihang Wei <wzh@ilbers.de>
To: Badrikesh Prusty <badrikesh.prusty@siemens.com>,
isar-users@googlegroups.com
Cc: felix.moessbauer@siemens.com
Subject: Re: [PATCH] image-postproc-extension: fix machine-id file being written empty
Date: Wed, 30 Sep 2026 12:43:17 +0200 [thread overview]
Message-ID: <67edb607-8b8a-4be9-b948-5e09e160e1e4@ilbers.de> (raw)
In-Reply-To: <20260923181306.43634-1-badrikesh.prusty@siemens.com>
Applied to next, thanks.
Zhihang
On 9/23/26 20:13, 'Badrikesh Prusty' via isar-users wrote:
> 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'
> }
>
--
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/67edb607-8b8a-4be9-b948-5e09e160e1e4%40ilbers.de.
prev parent reply other threads:[~2026-09-30 10:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 18:13 'Badrikesh Prusty' via isar-users
2026-09-23 18:41 ` 'MOESSBAUER, Felix' via isar-users
2026-09-30 10:43 ` Zhihang Wei [this message]
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=67edb607-8b8a-4be9-b948-5e09e160e1e4@ilbers.de \
--to=wzh@ilbers.de \
--cc=badrikesh.prusty@siemens.com \
--cc=felix.moessbauer@siemens.com \
--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