Bug 15378

Summary: systemd-systemctl-native.bb creates /etc/machine-id called from.image.bbclass
Product: [Build System, Metadata & Runtime] OE-Core Reporter: David <elek.david00096>
Component: Scripts and ToolsAssignee: David <elek.david00096>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: Medium+ CC: hongxu.jia, randy.macleod, ross.burton
Version: 4.0.20   
Target Milestone: 5.0 M3   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description David 2024-01-31 18:45:33 UTC
Hi!

When calling the [sysctl script](https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd-systemctl/systemctl) with preset-all command, it will create an empty /etc/machine-id file.

This is required on readonly filesystem to make the system bootable, but on read-write rootfs it prevents the systemd services to met with the *ConditionFirstBoot=yes* condition, unless implicitly deleted.

The function is called from the image.bbclass during rootfs creation.

David
Comment 1 Randy MacLeod 2024-02-01 15:45:31 UTC
David are you able to send a patch to the oe-core email list?
Comment 2 David 2024-02-05 16:41:42 UTC
(In reply to Randy MacLeod from comment #1)
> David are you able to send a patch to the oe-core email list?

Okay, I will create one.
Comment 3 David 2024-02-21 12:37:51 UTC
Created a patch and forwarded it, but based on the reply looks like there is no bug. An easier solution to this problem, was to add stateless-rootfs to IMAGE_FEATURES.

This ticket can be closed based on this.