aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@hivehome.com>2019-05-02 22:09:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-02 22:20:24 +0100
commita57678a076109c42fbdf7531e90ff4491b387d53 (patch)
tree83243d7f089be5fdcda21bfb1d5cc4fcfa7d4d08 /meta/classes/image.bbclass
parent86f5a2383692ac1ab01dce534c1a5c5f32ec4b35 (diff)
downloadopenembedded-core-contrib-a57678a076109c42fbdf7531e90ff4491b387d53.tar.gz
openembedded-core-contrib-a57678a076109c42fbdf7531e90ff4491b387d53.tar.bz2
openembedded-core-contrib-a57678a076109c42fbdf7531e90ff4491b387d53.zip
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. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass9
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 276d0d31f4..a23403c082 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 = ""