classes-recipe: Consolidate machine-id handling

Whenever Systemd is used as an init manager, it requires a machine-id
file to be present / initialized / or have the RW rootfs. This change
does not introduce a new functionality, but rather merges everything we
do with machine-id in one place.

(From OE-Core rev: 890b81cdfadc427189eff4bbd2c24e32eb286126)

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Vyacheslav Yurkov
2025-03-01 22:27:53 +01:00
committed by Richard Purdie
parent 03b8e2ec1e
commit 2fe7f46e17
2 changed files with 19 additions and 15 deletions

View File

@@ -699,13 +699,6 @@ reproducible_final_image_task () {
find ${IMAGE_ROOTFS} -print0 | xargs -0 touch -h --date=@$REPRODUCIBLE_TIMESTAMP_ROOTFS
}
systemd_preset_all () {
if [ -e ${IMAGE_ROOTFS}${root_prefix}/lib/systemd/systemd ]; then
systemctl --root="${IMAGE_ROOTFS}" --preset-mode=enable-only preset-all
systemctl --root="${IMAGE_ROOTFS}" --global --preset-mode=enable-only preset-all
fi
}
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 "
IMAGE_PREPROCESS_COMMAND:append = " reproducible_final_image_task "
CVE_PRODUCT = ""