* [PATCH] classes/image-postproc: Enable systemd units based on systemd presets
@ 2025-06-26 10:34 alexander.heinisch via isar-users
2025-06-26 11:40 ` 'Jan Kiszka' via isar-users
0 siblings, 1 reply; 2+ messages in thread
From: alexander.heinisch via isar-users @ 2025-06-26 10:34 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Heinisch
From: Alexander Heinisch <alexander.heinisch@siemens.com>
By default population of the presets is automatically done by systemd
on first-boot.
There are several issues with that:
1. The rootfs we get as a build artifact does not reflect the actual
system running in the field.
2. For setups without writeable /etc this fails. With that addition
it happens already at build time. Note we are only enabling additional
services, so services enabled during the package installation won't be
changed.
Signed-off-by: Alexander Heinisch <alexander.heinisch@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 991bac4c..269b86c0 100644
--- a/meta/classes/image-postproc-extension.bbclass
+++ b/meta/classes/image-postproc-extension.bbclass
@@ -95,3 +95,8 @@ image_posprocess_disable_systemd_firstboot() {
fi
fi
}
+
+ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_populate_systemd_preset"
+image_postprocess_populate_systemd_preset() {
+ sudo chroot '${ROOTFSDIR}' systemctl preset-all --preset-mode="enable-only"
+}
--
2.39.5
--
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/20250626103450.713318-1-alexander.heinisch%40siemens.com.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] classes/image-postproc: Enable systemd units based on systemd presets
2025-06-26 10:34 [PATCH] classes/image-postproc: Enable systemd units based on systemd presets alexander.heinisch via isar-users
@ 2025-06-26 11:40 ` 'Jan Kiszka' via isar-users
0 siblings, 0 replies; 2+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-06-26 11:40 UTC (permalink / raw)
To: alexander.heinisch, isar-users
On 26.06.25 12:34, alexander.heinisch via isar-users wrote:
> From: Alexander Heinisch <alexander.heinisch@siemens.com>
>
> By default population of the presets is automatically done by systemd
> on first-boot.
> There are several issues with that:
> 1. The rootfs we get as a build artifact does not reflect the actual
> system running in the field.
> 2. For setups without writeable /etc this fails. With that addition
You likely want to start a new line or even paragraph after that last
sentence.
> it happens already at build time. Note we are only enabling additional
> services, so services enabled during the package installation won't be
> changed.
IOW, you only expect good things from this change, and there is no
reason to make this extension opt-in? Opt'ing out should be doable via
ROOTFS_POSTPROCESS_COMMAND:remove - if needed at all. Still, this is
some change we may want to consider documenting in RECIPES-API-CHANGELOG.
>
> Signed-off-by: Alexander Heinisch <alexander.heinisch@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 991bac4c..269b86c0 100644
> --- a/meta/classes/image-postproc-extension.bbclass
> +++ b/meta/classes/image-postproc-extension.bbclass
> @@ -95,3 +95,8 @@ image_posprocess_disable_systemd_firstboot() {
> fi
> fi
> }
> +
> +ROOTFS_POSTPROCESS_COMMAND =+ "image_postprocess_populate_systemd_preset"
> +image_postprocess_populate_systemd_preset() {
> + sudo chroot '${ROOTFSDIR}' systemctl preset-all --preset-mode="enable-only"
> +}
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
--
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/f8ecf24d-7ff5-447c-80c1-df6de2d59562%40siemens.com.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-26 11:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-26 10:34 [PATCH] classes/image-postproc: Enable systemd units based on systemd presets alexander.heinisch via isar-users
2025-06-26 11:40 ` 'Jan Kiszka' via isar-users
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox