public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'MOESSBAUER, Felix' via isar-users" <isar-users@googlegroups.com>
To: "Heinisch, Alexander" <alexander.heinisch@siemens.com>,
	"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "Kiszka, Jan" <jan.kiszka@siemens.com>
Subject: Re: [PATCH v2] classes/image-postproc: Enable systemd units based on systemd presets
Date: Wed, 17 Sep 2025 08:51:34 +0000	[thread overview]
Message-ID: <d139cbaa71ae732a46407e4c8c47d5a7e55a788b.camel@siemens.com> (raw)
In-Reply-To: <20250917082426.48335-1-alexander.heinisch@siemens.com>

On Wed, 2025-09-17 at 10:24 +0200, alexander.heinisch@siemens.com
wrote:
> 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"`

Hi,

please make it a rootfs feature (e.g. populate-systemd-preset) and
enable it in the image.bbclass. Apart from that, the change is fine.

Best regards,
Felix

> 
> 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 92e7811c..6c48b823 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -741,3 +741,21 @@ By setting `MS_TPM_20_REF_DIR` in an optee-ftpm recipe, it is now possible to
>  use the new optee_ftpm code base from the OP-TEE project. That variable has to
>  point to a subdir in `WORKDIR` which contains the unpacked ms-tpm-20-ref source
>  code.
> +
> +### 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

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

-- 
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/d139cbaa71ae732a46407e4c8c47d5a7e55a788b.camel%40siemens.com.

  reply	other threads:[~2025-09-17  8:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17  8:24 alexander.heinisch via isar-users
2025-09-17  8:51 ` 'MOESSBAUER, Felix' via isar-users [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-06-27  8:25 alexander.heinisch via isar-users
2025-07-14 11:17 ` 'MOESSBAUER, Felix' via isar-users
2025-07-14 15:44   ` 'Heinisch, Alexander' 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=d139cbaa71ae732a46407e4c8c47d5a7e55a788b.camel@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=alexander.heinisch@siemens.com \
    --cc=felix.moessbauer@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