image-postproc: Revert of gate systemd preset-all on masked unit state (321185dc)

Message ID 20260806123136.550407-1-alexander.heinisch@siemens.com
State New
Headers show
Series image-postproc: Revert of gate systemd preset-all on masked unit state (321185dc) | expand

Commit Message

alexander.heinisch Aug. 6, 2026, 12:31 p.m. UTC
From: Alexander Heinisch <alexander.heinisch@siemens.com>

Proposed fix in the previous patch 321185dc3ec8be8f2b3a547caf225cebdbd5edf9
tried to resolve an issue caused by a conflict of a preset, explicitly enabling
a masked target, but was fighting symptoms, instead of fixing the root cause.

Proper solution in cases where units are masked is to explicitly disable those in
the system-presets if they were explicitly enabled before. If a masked unit is not
explicitly set to be enabled in the preset no action is needed.

See discussion at: https://groups.google.com/g/isar-users/c/wojTiSSPfG4

Signed-off-by: Alexander Heinisch <alexander.heinisch@siemens.com>
---
 meta/classes-recipe/rootfs.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch

diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass
index bdb9ea7a..2f80ac07 100644
--- a/meta/classes-recipe/rootfs.bbclass
+++ b/meta/classes-recipe/rootfs.bbclass
@@ -605,8 +605,7 @@  image_postprocess_populate_systemd_preset() {
         SYSTEMD_INSTALLED=$(dpkg-query --showformat='${db:Status-Status}' --show systemd 2>/dev/null)
 
         if [ "${SYSTEMD_INSTALLED}" = "installed" ]; then
-            systemctl list-unit-files --state=masked --no-legend | grep -q '^' \
-                || systemctl preset-all --preset-mode="enable-only"
+            systemctl preset-all --preset-mode="enable-only"
         fi
 EOSH
 }