From 8af007811087416a98826d138d6e654941d9716c Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Thu, 6 Feb 2025 13:40:33 +0100 Subject: [PATCH] resin-mounts: only run non-encrypted mount if partition exists When signed images are used without opting in secure boot, we don't want the encrypted mount service to run and fail as there is no encrypted boot partition. This commit adds a condition to the encrypted boot mount service to only run if the encrypted boot partition exists, similarly to what is already done for EFI builds. Change-type: patch Signed-off-by: Alex Gonzalez --- meta-balena-common/recipes-support/resin-mounts/resin-mounts.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta-balena-common/recipes-support/resin-mounts/resin-mounts.bb b/meta-balena-common/recipes-support/resin-mounts/resin-mounts.bb index 00e0233bea..98d459950e 100644 --- a/meta-balena-common/recipes-support/resin-mounts/resin-mounts.bb +++ b/meta-balena-common/recipes-support/resin-mounts/resin-mounts.bb @@ -66,6 +66,8 @@ do_install:prepend () { sed -i -e "s/@@BALENA_NONENC_BOOT_LABEL@@/${BALENA_NONENC_BOOT_LABEL}/g" "${D}${systemd_unitdir}/system/${BALENA_NONENC_BOOT_LABEL}.service" if ${@bb.utils.contains('MACHINE_FEATURES','efi','true','false',d)}; then sed -i '/^\[Unit\]/a ConditionPathIsSymbolicLink=/mnt/boot/EFI' "${D}${systemd_unitdir}/system/${BALENA_NONENC_BOOT_LABEL}.service" + else + sed -i "/^\[Unit\]/a ConditionPathExists=/dev/disk/by-state/${BALENA_NONENC_BOOT_LABEL}" "${D}${systemd_unitdir}/system/${BALENA_NONENC_BOOT_LABEL}.service" fi fi for service in ${SYSTEMD_SERVICE:resin-mounts}; do