systemd-systemctl: Create machine-id with "uninitialized" text in it

Instead of creating empty /etc/machine-id file using touch, write
text "uninitialized" into it. Systemd requires "uninitialized" in
the /etc/machine-id file to trigger systemd-firstboot .

(From OE-Core rev: 263c852269027b1bd311e116021ac49d9001e1b0)

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Marek Vasut
2023-02-27 20:15:48 +01:00
committed by Richard Purdie
parent 9b8665bb96
commit 33d9b3a8ed

View File

@@ -302,7 +302,7 @@ def preset_all(root):
# For the stateless configuration, where /etc is generated at runtime
# (for example on a tmpfs), this script shouldn't run at all and we
# allow systemd to completely populate /etc.
(root / SYSCONFDIR / "machine-id").touch()
(root / SYSCONFDIR / "machine-id").write_text("uninitialized")
def main():