Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] image.bbclass: fix systemd_preset_all
@ 2019-06-28  9:29 Chen Qi
  2019-06-28  9:29 ` [PATCH 1/1] " Chen Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Qi @ 2019-06-28  9:29 UTC (permalink / raw)
  To: openembedded-core

*** BLURB HERE ***
The following changes since commit bfe3012ea4b2c973bd6ca5fa1de1adf51e1a9da4:

  busybox: Fix typo in syslog initscript (2019-06-27 13:28:48 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/image-systemd
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/image-systemd

Chen Qi (1):
  image.bbclass: fix systemd_preset_all

 meta/classes/image.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] image.bbclass: fix systemd_preset_all
  2019-06-28  9:29 [PATCH 0/1] image.bbclass: fix systemd_preset_all Chen Qi
@ 2019-06-28  9:29 ` Chen Qi
  2019-06-28 12:31   ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Qi @ 2019-06-28  9:29 UTC (permalink / raw)
  To: openembedded-core

Check the existence of systemctl before invoking it. 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.
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@windriver.com>
---
 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..2115c6c 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 ${STAGING_DIR_NATIVE}${bindir}/systemctl ]; 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 = ""
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] image.bbclass: fix systemd_preset_all
  2019-06-28  9:29 ` [PATCH 1/1] " Chen Qi
@ 2019-06-28 12:31   ` Richard Purdie
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2019-06-28 12:31 UTC (permalink / raw)
  To: Chen Qi, openembedded-core

On Fri, 2019-06-28 at 17:29 +0800, Chen Qi wrote:
> Check the existence of systemctl before invoking it. 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.
> 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@windriver.com>
> ---
>  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..2115c6c 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 ${STAGING_DIR_NATIVE}${bindir}/systemctl ]; then
> +	systemctl --root="${IMAGE_ROOTFS}" --preset-mode=enable-only preset-all
> +    fi
>  }

Shouldn't we be checking something in the image rather than the
presence of a tool?

Cheers,

Richard





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-28 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-28  9:29 [PATCH 0/1] image.bbclass: fix systemd_preset_all Chen Qi
2019-06-28  9:29 ` [PATCH 1/1] " Chen Qi
2019-06-28 12:31   ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox