All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: cip-dev@lists.cip-project.org
Cc: adriaan.schmidt@siemens.com, jan.kiszka@siemens.com,
	quirin.gylstorff@siemens.com,
	Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [isar-cip-core][PATCH v4 4/8] swupdate: only check partition uuids on swupdate
Date: Sun, 12 Feb 2023 08:27:54 +0000	[thread overview]
Message-ID: <20230212082758.1166262-5-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20230212082758.1166262-1-felix.moessbauer@siemens.com>

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@siemens.com>
---
 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 50a15e1..931ac30 100644
--- a/classes/swupdate.bbclass
+++ b/classes/swupdate.bbclass
@@ -103,3 +103,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



  parent reply	other threads:[~2023-02-12 22:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-12  8:27 [isar-cip-core][PATCH v4 0/8] Rework image classes Felix Moessbauer
2023-02-12  8:27 ` [isar-cip-core][PATCH v4 1/8] register image classes via layer.conf Felix Moessbauer
2023-02-13 14:51   ` Jan Kiszka
2023-02-13 15:18     ` Moessbauer, Felix
2023-02-13 15:20       ` Jan Kiszka
2023-02-12  8:27 ` [isar-cip-core][PATCH v4 2/8] refactor: use imagetypes for swu generation Felix Moessbauer
2023-02-13 15:28   ` Jan Kiszka
2023-02-14  2:10     ` Moessbauer, Felix
2023-02-14  7:18       ` Jan Kiszka
2023-02-15  9:24         ` Moessbauer, Felix
2023-02-12  8:27 ` [isar-cip-core][PATCH v4 3/8] swu: directly image from squashfs rootfs Felix Moessbauer
2023-02-12  8:27 ` Felix Moessbauer [this message]
2023-02-12  8:27 ` [isar-cip-core][PATCH v4 5/8] make sw-description spec compliant Felix Moessbauer
2023-02-12  8:27 ` [isar-cip-core][PATCH v4 6/8] swu: replace custom image compression Felix Moessbauer
2023-02-12  8:27 ` [isar-cip-core][PATCH v4 7/8] prefix swu related variables with SWU Felix Moessbauer
2023-02-12  8:27 ` [isar-cip-core][PATCH v4 8/8] refactor verity image creation Felix Moessbauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230212082758.1166262-5-felix.moessbauer@siemens.com \
    --to=felix.moessbauer@siemens.com \
    --cc=adriaan.schmidt@siemens.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=jan.kiszka@siemens.com \
    --cc=quirin.gylstorff@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.