public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "T. Schaffner" <tobias.schaffner@siemens.com>
To: <isar-users@googlegroups.com>
Cc: <florian.bezdeka@siemens.com>, <quirin.gylstorff@siemens.com>,
	"Tobias Schaffner" <tobias.schaffner@siemens.com>
Subject: [PATCH 2/2] Warn if systemd-firstboot misses configurations
Date: Sat, 19 Nov 2022 19:20:31 +0100	[thread overview]
Message-ID: <20221119182031.2005807-3-tobias.schaffner@siemens.com> (raw)
In-Reply-To: <20221119182031.2005807-1-tobias.schaffner@siemens.com>

From: Tobias Schaffner <tobias.schaffner@siemens.com>

systemd-firstboot checks the existence of different system configurations
like locale or hostname. Debian packages may trust that these configurations
are in the location that systemd-firstboot enforced.

Warn the user in the image postproc step if systemd-firstboot misses any
configurations in the image.

Signed-off-by: Tobias Schaffner <tobias.schaffner@siemens.com>
---
 meta/classes/image-postproc-extension.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass
index 942b929..f7f762c 100644
--- a/meta/classes/image-postproc-extension.bbclass
+++ b/meta/classes/image-postproc-extension.bbclass
@@ -88,5 +88,10 @@ image_posprocess_disable_systemd_firstboot() {
 
     if dpkg --compare-versions "$SYSTEMD_VERSION" "ge" "251"; then
         sudo chroot '${ROOTFSDIR}' systemctl mask systemd-firstboot
+        if ! cmd_output=$(sudo chroot '${ROOTFSDIR}' systemd-firstboot \
+               --prompt --welcome=false </dev/null 2>/dev/null); then
+            bbwarn "Your image is not configured completely according to systemd-firstboot."
+            bbwarn "It prompted: \"${cmd_output}\""
+        fi
     fi
 }
-- 
2.34.1


  parent reply	other threads:[~2022-11-19 18:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-19 18:20 [PATCH 0/2] Mask systemd-firstboot T. Schaffner
2022-11-19 18:20 ` [PATCH 1/2] " T. Schaffner
2022-11-19 18:20 ` T. Schaffner [this message]
2022-11-22 10:04   ` [PATCH 2/2] Warn if systemd-firstboot misses configurations Anton Mikanovich
2022-11-22 10:24     ` Florian Bezdeka
2023-02-23 11:43       ` Uladzimir Bely
2023-02-24 11:36         ` Schaffner, Tobias
2023-02-27  4:39 ` [PATCH 0/2] Mask systemd-firstboot Uladzimir Bely
2023-02-27 12:23   ` Cedric Hombourger
2023-02-27 12:37     ` Jan Kiszka
2023-02-27 12:53       ` Uladzimir Bely
2023-02-27 12:55         ` Jan Kiszka

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=20221119182031.2005807-3-tobias.schaffner@siemens.com \
    --to=tobias.schaffner@siemens.com \
    --cc=florian.bezdeka@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=quirin.gylstorff@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