Does adding 'stateless-rootfs' to IMAGE_FEATURES work for you?
meta/classes-recipe/image.bbclass:IMAGE_PREPROCESS_COMMAND:append = "
${@ 'systemd_preset_all systemd_disable_units' if
bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and not
bb.utils.contains('IMAGE_FEATURES', 'stateless-rootfs', True, False, d)
else ''} reproducible_final_image_task "
Regards,
Qi
On 2/18/24 17:43, dave.elek...@gmail.com wrote:
Hi!
In the systemd-systemctl there is a *systemctl* script used for some
configuration/settings for the systemd services (e.g. enabling services).
In this script if we call the *preset_all* command, it will create an
empty //etc/machine-id/ file. This is required on read-only //etc/
folder, otherwise the systemd will fail to boot. However on read-write
/etc folder this file is still created, which prevents systemd to
satisfy the ConditionFirstBoot condition. This is used in systemd
services, for example for systemd-firstboot, where you can configure
the root password, localization, hostname, etc.
The preset_all command is triggered from the /image.bbclass/ file. A
quick solution in my case was to add a task in my own layer, which
deletes the //etc/machine-id/ file, but I think it would be great, to
prevent others from the headache it can cause to investigate/fix this.
I attached the patch file about my proposed solution.
Waiting for you reply soon,
David
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#195861):
https://lists.openembedded.org/g/openembedded-core/message/195861
Mute This Topic: https://lists.openembedded.org/mt/104425254/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-