[OE-core] systemd and /etc/machine-id

Nicolas Dechesne nicolas.dechesne at linaro.org
Sun Mar 5 09:40:17 UTC 2017


hi,

I am trying to understand why the systemd recipe creates an empty
/etc/machine-id file:

# Create machine-id

# 20:12 < mezcalero> koen: you have three options: a) run
systemd-machine-id-setup at install time, b) have / read-only and an empty
file there (for stateless) and c) boot with / writable
touch ${D}${sysconfdir}/machine-id

Having an empty machine-id file seems to prevent the "ConditionFirstBoot"
to be ever met, e.g. I have a service that tries to use it, and at first
boot i am seeing in systemctl status:

ConditionFirstBoot=yes was not met

However I also notice that /etc/machine-id is properly set during the first
boot (e.g. with a valid UID). I am not sure I understand our intent to
create an empty file. If I remove the empty file before flashing the board,
then my service which depends on ConditionFirstBoot is executed properly,
and becasue the systemd recipe also enables 'firstboot' by default (in
PACKAGECONFIG) then systemd-firstboot service is kicked as well, and ask
for hostname , TZ, .. (which isn't very convenient neither).

without understanding the entire history, I would tend to think that we
need the following changes to the systemd recipe:

1. remove the empty /etc/machine-id file
2. remove firstboot from default PACKAGECONFIG

any thoughts?

cheers
nico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170305/ee509b78/attachment-0002.html>


More information about the Openembedded-core mailing list