diff mbox series

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

Message ID 20230315101104.4460-1-Qi.Chen@windriver.com
State Accepted, archived
Commit a2ac09c32acfc2e076a7778447919d97553d38a2
Headers show
Series Revert "systemd-systemctl: Create machine-id with "uninitialized" text in it" | expand

Commit Message

ChenQi March 15, 2023, 10:11 a.m. UTC
This reverts commit 33d9b3a8ed186c2d212acb83f715367912010e7f.

The reverted patch was forcing systemd to do preset-all at boot time (first boot)
in a function that simuilates 'preset-all' at rootfs time. This is not right.

To force a first boot, just do not run this function, as said in the comment:
"""
    # If we populate the systemd links we also create /etc/machine-id, which
    # allows systemd to boot with the filesystem read-only before generating
    # a real value and then committing it back.
    #
    # 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.
"""

For example, removing 'systemd_preset_all;' from IMAGE_PREPROCESS_COMMAND in some
distro conf file will achieve the same effect of the original patch.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/systemd/systemd-systemctl/systemctl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
index 45b29671ee..cddae75a06 100755
--- a/meta/recipes-core/systemd/systemd-systemctl/systemctl
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -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").write_text("uninitialized")
+    (root / SYSCONFDIR / "machine-id").touch()
 
 
 def main():