<div dir="ltr"><div>Thanks for helping Mantas,</div><div><br></div>What I saw is:<div> - before first boot /etc/machine-id is empty (and I think that's expected)</div><div> - right after boot, /etc/machine-id isn't writable because the root fs is mounted as readonly from fstab</div><div> - after the /etc overlay is mounted /etc/machine-id should still be the one from the underlying filesystem and at this point is also writable, however it's still empty</div><div><br></div><div>During boot I see:</div><div><br></div><div>[ 3.577477] systemd[1]: Initializing machine ID from random generator.<br>[ 3.584284] systemd[1]: Installed transient /etc/machine-id file.<br></div><div><br></div><div>however /etc/machine-id shouldn't be writable at that point, what should I do? Make our overlay mount unit depend on whatever service is generating machine-id and make sure our mount happens before the generation of machine-id?</div><div><br></div><div>Thanks</div><div><br><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">--<div>Alessandro Tagliapietra</div></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 1, 2021 at 12:13 AM Mantas Mikulėnas <<a href="mailto:grawity@gmail.com">grawity@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Tue, Jun 1, 2021 at 10:07 AM Alessandro Tagliapietra <<a href="mailto:tagliapietra.alessandro@gmail.com" target="_blank">tagliapietra.alessandro@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello everyone,<div><br></div><div>I'm using yocto to create a custom linux image for a raspberry pi.</div>We have an "agent" that writes /etc/systemd/network/20-eth.network when the final user wants to have a static IP address and we remove the file when they switch back to DHCP.<div><br></div><div>After creating/deleting the file above we run `networkctl reload && networkctl reconfigure eth0`.</div><div>We mount the overlayfs with a custom .mount unit.</div><div><br></div><div>We've noticed that DHCP works fine if systemd-networkd starts before we mount the overlayfs but it doesn't if systemd-networkd is restarted/reconfigured after the folder is mounted or started after the overlay .mount unit.</div><div><br></div><div>Every interface DHCP fails with:</div><div><br></div><div>DHCPv6 CLIENT: Failed to set DUID-EN: No medium found<br>eth0: DHCP6 CLIENT: Failed to set DUID: No medium found</div></div></blockquote><div><br></div><div>My guess is that it's related to /etc/machine-id somehow becoming inaccessible, since networkd's DUID-EN (DUIDType=vendor) is based on that.</div></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr">Mantas Mikulėnas</div></div></div>
</blockquote></div>