summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd')
-rwxr-xr-xmeta/recipes-core/systemd/systemd-systemctl/systemctl9
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
index d7d4e0d29a..7fdaf8ce03 100755
--- a/meta/recipes-core/systemd/systemd-systemctl/systemctl
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -241,6 +241,15 @@ def preset_all(root):
if state == "enable" or state is None:
enable(root, service, location, services)
+ # 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.
+ (root / SYSCONFDIR / "machine-id").touch()
+
def mask(root, *services):
systemdir = root / SYSCONFDIR / "systemd" / "system"