From: Alex Kiernan Date: Thu, 2 May 2019 21:09:44 +0000 (+0100) Subject: image: call systemctl preset-all for images X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=665fd0ae236e2bd57075ce01a920ab6be61527d3;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git image: call systemctl preset-all for images Rather than rely on systemd's default invocation of preset-all at runtime, we pre-populate the symlink tree as part of of the image. This is done late so any overrides of presets during rootfs construction should already have happened. Whilst we don't strictly need this for the read-write root case, it avoids boot time churn; for read-only root we have to do it here. (From OE-Core rev: a57678a076109c42fbdf7531e90ff4491b387d53) Signed-off-by: Alex Kiernan Signed-off-by: Richard Purdie --- diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 276d0d31f4a..a23403c0827 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -664,6 +664,13 @@ reproducible_final_image_task () { find ${IMAGE_ROOTFS} -exec touch -h --date=@$REPRODUCIBLE_TIMESTAMP_ROOTFS {} \; fi } -IMAGE_PREPROCESS_COMMAND_append = " reproducible_final_image_task; " + +IMAGE_EXTRADEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}" + +systemd_preset_all () { + systemctl --root="${IMAGE_ROOTFS}" --preset-mode=enable-only preset-all +} + +IMAGE_PREPROCESS_COMMAND_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd_preset_all;', '', d)} reproducible_final_image_task; " CVE_PRODUCT = ""