This patch moves the partition uuid check into a task to only execute
the logic in case an swu image is built. Previously this was checked at
parse time, leading to errors when not setting these variables and
building an image without swupdate support from an layer that also
provides images with swupdate support.
Signed-off-by: Felix Moessbauer <felix.moessbauer@...>
---
classes/swupdate.bbclass | 8 ++++++++
recipes-core/images/swupdate.inc | 6 ------
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
index bb648c2..2a497fb 100644
--- a/classes/swupdate.bbclass
+++ b/classes/swupdate.bbclass
@@ -104,3 +104,11 @@ IMAGE_CMD:swu() {
fi
done | cpio -ovL -H crc > "${BUILDCHROOT_IMAGE_FILE}"'
}
+
+python do_check_swu_partition_uuids() {
+ for u in ['A', 'B']:
+ if not d.getVar('ABROOTFS_PART_UUID_' + u):
+ bb.fatal('ABROOTFS_PART_UUID_' + u + ' not set')
+}
+
+addtask check_swu_partition_uuids before do_image_swu
diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc
index f4f5c42..08867cd 100644
--- a/recipes-core/images/swupdate.inc
+++ b/recipes-core/images/swupdate.inc
@@ -14,9 +14,3 @@ inherit read-only-rootfs
IMAGE_INSTALL += " swupdate"
IMAGE_INSTALL += " swupdate-handler-roundrobin"
-
-python() {
- for u in ['A', 'B']:
- if not d.getVar('ABROOTFS_PART_UUID_' + u):
- bb.fatal('ABROOTFS_PART_UUID_' + u + ' not set')
-}
--
2.34.1