* [PATCH v2] classes/image-postproc: Enable systemd units based on systemd presets
@ 2025-06-27 8:25 alexander.heinisch via isar-users
0 siblings, 0 replies; only message in thread
From: alexander.heinisch via isar-users @ 2025-06-27 8:25 UTC (permalink / raw)
To: isar-users, jan.kiszka; +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 were 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: Additional services are enabled only. Services already enabled
during the package installation won't be changed.
Opt-out: `ROOTFS_POSTPROCESS_COMMAND:remove = "image_postprocess_populate_systemd_preset"`
Signed-off-by: Alexander Heinisch <alexander.heinisch@siemens.com>
---
RECIPE-API-CHANGELOG.md | 18 ++++++++++++++++++
meta/classes/image-postproc-extension.bbclass | 5 +++++
2 files changed, 23 insertions(+)
diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 8468717d..fb9ad4f3 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -727,3 +727,21 @@ Changes in next
This was never documented and never had practical relevance. `oci-archive` is
the useful OCI image format that can be imported, e.g., by podman.
+
+### Populate systemd units based on presets during image postprocessing
+
+By default population of the presets is automatically done by systemd
+on first-boot.
+
+There were 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**: Additional services are enabled only. Services already enabled
+during the package installation won't be changed.
+
+Opt-out: `ROOTFS_POSTPROCESS_COMMAND:remove = "image_postprocess_populate_systemd_preset"`
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/20250627082502.74292-1-alexander.heinisch%40siemens.com.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-27 8:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-27 8:25 [PATCH v2] classes/image-postproc: Enable systemd units based on systemd presets alexander.heinisch 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