[PATCH v3 0/1] image-postproc: ignore systemd preset failures

12 views
Skip to first unread message

Badrikesh Prusty

unread,
Feb 18, 2026, 11:44:16 PM (8 days ago) Feb 18
to isar-...@googlegroups.com, gokhan...@siemens.com, alexander...@siemens.com, Badrikesh Prusty
changes in v3:
* Do not disable pre-population of enabled systemd services during build,
as this is the correct default behavior. Downstream layers can disable
it if needed.
* Ignore failures from systemd preset only.

changes in v2:
* Disable populate-systemd-preset at build time by default due to service
failures observed on some systems.

Badrikesh Prusty (1):
image-postproc: ignore systemd preset failures

meta/classes-recipe/rootfs.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--
2.39.5

Badrikesh Prusty

unread,
Feb 18, 2026, 11:44:18 PM (8 days ago) Feb 18
to isar-...@googlegroups.com, gokhan...@siemens.com, alexander...@siemens.com, Badrikesh Prusty
Add '|| true' to systemd preset invocation during image postprocessing
to tolerate failures caused by already-masked units.

Signed-off-by: Badrikesh Prusty <badrikes...@siemens.com>
---
meta/classes-recipe/rootfs.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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

if (test "$SYSTEMD_INSTALLED" = "installed"); then
- sudo chroot '${ROOTFSDIR}' systemctl preset-all --preset-mode="enable-only"
+ sudo chroot '${ROOTFSDIR}' systemctl preset-all --preset-mode="enable-only" || true
fi
}

--
2.39.5

MOESSBAUER, Felix

unread,
Feb 19, 2026, 8:36:16 AM (8 days ago) Feb 19
to Prusty, Badrikesh, isar-...@googlegroups.com, Heinisch, Alexander, Cetin, Gokhan
On Wed, 2026-02-18 at 23:44 -0500, 'Badrikesh Prusty' via isar-users
wrote:
This is still too coarse. Currently the presetting fails on bullseye
targets with the following error "Failed to preset: Invalid argument.".

While I did not check the root-cause, I'm pretty sure this is a
different error which would be hidden by || true.

Felix

--
Siemens AG
Linux Expert Center
Friedrich-Ludwig-Bauer-Str. 3
85748 Garching, Germany

Prusty, Badrikesh

unread,
Feb 19, 2026, 10:27:04 AM (8 days ago) Feb 19
to MOESSBAUER, Felix, isar-...@googlegroups.com, Heinisch, Alexander, Cetin, Gokhan

Hi,

I guess the error of invalid argument is due to invalid preset configs
in /usr/lib/systemd/system-preset/ or the preset files missing in
system-preset/ directory. With my initial check the `preset-all` and
`preset-mode` flags are available since systemd v215.

For masked service failures, I tested this on my systems locally with a
newer version of systemd as well. The command also fails with exit code
1 when running the preset on Debian Trixie and Forky. I’m not sure how
the builds for Trixie continues despite these failures.

Logs:
```
> systemctl --version
systemd 259 (259-1)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +SYSVINIT +LIBARCHIVE
547G ~
> sudo systemctl preset-all --preset-mode="enable-only"
Failed to preset all units: Unit /etc/systemd/system/hibernate.target is masked
547G ~
> echo $?
1

> systemctl --version
systemd 257 (257.9-1~deb13u1)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +SYSVINIT +LIBARCHIVE
847E ~
> sudo systemctl preset-all --preset-mode="enable-only"
Failed to preset all units: Unit /etc/systemd/system/sleep.target is masked
847E ~
> echo $?
1
```

________________________________________
From: Moessbauer, Felix (FT RPD CED OES-DE) <felix.mo...@siemens.com>
Sent: 19 February 2026 19:06
To: Prusty, Badrikesh (FT FDS CES LX PBU 2); isar-...@googlegroups.com
Cc: Heinisch, Alexander (FT RPD CED SES-AT); Çetin, Gökhan (FT D EU TR C&E)
Subject: Re: [PATCH v3 1/1] image-postproc: ignore systemd preset failures

Jan Kiszka

unread,
Feb 19, 2026, 12:52:29 PM (7 days ago) Feb 19
to Badrikesh Prusty, isar-...@googlegroups.com, gokhan...@siemens.com, alexander...@siemens.com
Is this series aiming at these new warnings of Isar?

DEBUG: Executing shell function image_postprocess_disable_systemd_firstboot
/proc/ is not mounted. This is not a supported mode of operation. Please fix
your invocation environment to mount /proc/ and /sys/ properly. Proceeding anyway.
Your mileage may vary.
Created symlink '/etc/systemd/system/systemd-firstboot.service' → '/dev/null'.
WARNING: Your image is not configured completely according to systemd-firstboot.
WARNING: It prompted: ""
DEBUG: Shell function image_postprocess_disable_systemd_firstboot finished

Jan

--
Siemens AG, Foundational Technologies
Linux Expert Center

Jan Kiszka

unread,
Feb 19, 2026, 2:10:31 PM (7 days ago) Feb 19
to Badrikesh Prusty, isar-...@googlegroups.com, Felix Moessbauer, gokhan...@siemens.com, alexander...@siemens.com
Hmm, no. This seems to be another to-do for Felix' rootless patches. I
was running them, and this warning is gone when going back to vanilla Isar.

MOESSBAUER, Felix

unread,
Feb 20, 2026, 3:21:04 AM (7 days ago) Feb 20
to Prusty, Badrikesh, isar-...@googlegroups.com, Kiszka, Jan, Heinisch, Alexander, Cetin, Gokhan
Good catch. We need /proc and /sys mounted, which we currently not do
in this task.

Felix

>
> Jan
>
> --
> Siemens AG, Foundational Technologies
> Linux Expert Center

Reply all
Reply to author
Forward
0 new messages