[OE-core] [PATCH 1/1] image.bbclass: fix systemd_preset_all

Richard Purdie richard.purdie at linuxfoundation.org
Fri Jun 28 12:31:04 UTC 2019


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 at 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





More information about the Openembedded-core mailing list