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 1/2] Mask systemd-firstboot
Date: Sat, 19 Nov 2022 19:20:30 +0100	[thread overview]
Message-ID: <20221119182031.2005807-2-tobias.schaffner@siemens.com> (raw)
In-Reply-To: <20221119182031.2005807-1-tobias.schaffner@siemens.com>

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

systemd-firstboot asks the user interactively for missing system configurations
like locale or hostname.

Disable the service as we do not want to depend on user interaction on boot.

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

diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass
index 4a901cb..942b929 100644
--- a/meta/classes/image-postproc-extension.bbclass
+++ b/meta/classes/image-postproc-extension.bbclass
@@ -79,3 +79,14 @@ image_postprocess_sshd_key_regen() {
        exit 1
     fi
 }
+
+ROOTFS_POSTPROCESS_COMMAND =+ "image_posprocess_disable_systemd_firstboot"
+image_posprocess_disable_systemd_firstboot() {
+    SYSTEMD_VERSION=$(sudo chroot '${ROOTFSDIR}' dpkg-query \
+        --showformat='${source:Upstream-Version}' \
+        --show systemd || echo "0" )
+
+    if dpkg --compare-versions "$SYSTEMD_VERSION" "ge" "251"; then
+        sudo chroot '${ROOTFSDIR}' systemctl mask systemd-firstboot
+    fi
+}
-- 
2.34.1


  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] " T. Schaffner
2022-11-19 18:20 ` T. Schaffner [this message]
2022-11-19 18:20 ` [PATCH 2/2] Warn if systemd-firstboot misses configurations T. Schaffner
2022-11-22 10:04   ` 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-2-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