[oe-commits] [openembedded-core] 08/12: image.bbclass: fix systemd_preset_all

git at git.openembedded.org git at git.openembedded.org
Mon Jul 1 12:53:16 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 81ee2280881a19f73775b6151929d5dade4f768f
Author: Chen Qi <Qi.Chen at windriver.com>
AuthorDate: Mon Jul 1 12:15:33 2019 +0800

    image.bbclass: fix systemd_preset_all
    
    Check the existence of systemd before using systemctl to preset units.
    This is because even if 'systemd' is in DISTRO_FEATURES, it's possible
    that systemd is not even installed. e.g. container-test-image in
    meta-selftest layer.
    
    As systemd DEPENDS on systemd-systemctl-native, the existence of systemd
    also ensures the existence of systemd-systemctl-native.
    
    This would fix the following test case when using systemd as the init
    manager.
    
      containerimage.ContainerImageTests.test_expected_files
    
    Also remove the IMAGE_EXTRADEPENDS setting, as nothing references this
    variable.
    
    Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/image.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index d2b2fb9..7daa97e 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -666,10 +666,11 @@ reproducible_final_image_task () {
 }
 
 systemd_preset_all () {
-    systemctl --root="${IMAGE_ROOTFS}" --preset-mode=enable-only preset-all
+    if [ -e ${IMAGE_ROOTFS}${root_prefix}/lib/systemd/systemd ]; then
+	systemctl --root="${IMAGE_ROOTFS}" --preset-mode=enable-only preset-all
+    fi
 }
 
-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 ''}"
 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; "
 
 CVE_PRODUCT = ""

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list