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