diff options
-rw-r--r-- | meta/classes/image.bbclass | 9 | ||||
-rwxr-xr-x | meta/recipes-core/systemd/systemd-systemctl/systemctl | 9 |
2 files changed, 13 insertions, 5 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index a23403c082..d2b2fb979e 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -33,7 +33,7 @@ INHIBIT_DEFAULT_DEPS = "1" | |||
33 | # IMAGE_FEATURES may contain any available package group | 33 | # IMAGE_FEATURES may contain any available package group |
34 | IMAGE_FEATURES ?= "" | 34 | IMAGE_FEATURES ?= "" |
35 | IMAGE_FEATURES[type] = "list" | 35 | IMAGE_FEATURES[type] = "list" |
36 | IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs empty-root-password allow-empty-password allow-root-login post-install-logging" | 36 | IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs stateless-rootfs empty-root-password allow-empty-password allow-root-login post-install-logging" |
37 | 37 | ||
38 | # Generate companion debugfs? | 38 | # Generate companion debugfs? |
39 | IMAGE_GEN_DEBUGFS ?= "0" | 39 | IMAGE_GEN_DEBUGFS ?= "0" |
@@ -665,12 +665,11 @@ reproducible_final_image_task () { | |||
665 | fi | 665 | fi |
666 | } | 666 | } |
667 | 667 | ||
668 | IMAGE_EXTRADEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}" | ||
669 | |||
670 | systemd_preset_all () { | 668 | systemd_preset_all () { |
671 | systemctl --root="${IMAGE_ROOTFS}" --preset-mode=enable-only preset-all | 669 | systemctl --root="${IMAGE_ROOTFS}" --preset-mode=enable-only preset-all |
672 | } | 670 | } |
673 | 671 | ||
674 | IMAGE_PREPROCESS_COMMAND_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd_preset_all;', '', d)} reproducible_final_image_task; " | 672 | IMAGE_EXTRADEPENDS += "${@ 'systemd-systemctl-native' if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and not bb.utils.contains('IMAGE_FEATURES', 'stateless-rootfs', True, False, d) else ''}" |
673 | IMAGE_PREPROCESS_COMMAND_append = " ${@ 'systemd_preset_all;' if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and not bb.utils.contains('IMAGE_FEATURES', 'stateless-rootfs', True, False, d) else ''} reproducible_final_image_task; " | ||
675 | 674 | ||
676 | CVE_PRODUCT = "" | 675 | CVE_PRODUCT = "" |
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): | |||
241 | if state == "enable" or state is None: | 241 | if state == "enable" or state is None: |
242 | enable(root, service, location, services) | 242 | enable(root, service, location, services) |
243 | 243 | ||
244 | # If we populate the systemd links we also create /etc/machine-id, which | ||
245 | # allows systemd to boot with the filesystem read-only before generating | ||
246 | # a real value and then committing it back. | ||
247 | # | ||
248 | # For the stateless configuration, where /etc is generated at runtime | ||
249 | # (for example on a tmpfs), this script shouldn't run at all and we | ||
250 | # allow systemd to completely populate /etc. | ||
251 | (root / SYSCONFDIR / "machine-id").touch() | ||
252 | |||
244 | 253 | ||
245 | def mask(root, *services): | 254 | def mask(root, *services): |
246 | systemdir = root / SYSCONFDIR / "systemd" / "system" | 255 | systemdir = root / SYSCONFDIR / "systemd" / "system" |