public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Badrikesh Prusty' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: felix.moessbauer@siemens.com, jan.kiszka@siemens.com,
	gokhan.cetin@siemens.com, alexander.heinisch@siemens.com,
	Badrikesh Prusty <badrikesh.prusty@siemens.com>
Subject: [PATCH v5] image-postproc: gate systemd preset-all on masked unit state
Date: Wed, 29 Apr 2026 02:43:53 -0400	[thread overview]
Message-ID: <20260429064353.1372987-1-badrikesh.prusty@siemens.com> (raw)

Skip systemd preset-all during image postprocessing if masked unit files
are detected, to avoid non-fatal failures when presetting units that are
already masked.

Fixes: 72b88a12 ("classes/image-postproc: Enable systemd units based on systemd presets")

Signed-off-by: Badrikesh Prusty <badrikesh.prusty@siemens.com>
---
 meta/classes-recipe/rootfs.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass
index 8b502a50..ca847b30 100644
--- a/meta/classes-recipe/rootfs.bbclass
+++ b/meta/classes-recipe/rootfs.bbclass
@@ -574,7 +574,9 @@ image_postprocess_populate_systemd_preset() {
         --show systemd || echo "" )

     if (test "$SYSTEMD_INSTALLED" = "installed"); then
-        sudo chroot '${ROOTFSDIR}' systemctl preset-all --preset-mode="enable-only"
+        # Skip preset-all if any masked units exist
+        sudo chroot '${ROOTFSDIR}' systemctl list-unit-files --state=masked --no-legend | grep -q '^' \
+            || sudo chroot '${ROOTFSDIR}' systemctl preset-all --preset-mode="enable-only"
     fi
 }

--
2.47.3

-- 
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/20260429064353.1372987-1-badrikesh.prusty%40siemens.com.

             reply	other threads:[~2026-04-29  6:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  6:43 'Badrikesh Prusty' via isar-users [this message]
2026-04-29 10:41 ` 'Jan Kiszka' via isar-users

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=20260429064353.1372987-1-badrikesh.prusty@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=alexander.heinisch@siemens.com \
    --cc=badrikesh.prusty@siemens.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=gokhan.cetin@siemens.com \
    --cc=jan.kiszka@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