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 v2 4/5] swupdate: only check partition uuids on swupdate
Date: Fri, 10 Feb 2023 06:45:02 +0000	[thread overview]
Message-ID: <20230210064503.706699-5-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20230210064503.706699-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 451dee6..6e117bd 100644
--- a/classes/swupdate.bbclass
+++ b/classes/swupdate.bbclass
@@ -99,3 +99,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 20ed600..3ec7767 100644
--- a/recipes-core/images/swupdate.inc
+++ b/recipes-core/images/swupdate.inc
@@ -15,9 +15,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-10 12:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10  6:44 [isar-cip-core][PATCH v2 0/5] Rework image classes Felix Moessbauer
2023-02-10  6:44 ` [isar-cip-core][PATCH v2 1/5] register image classes via layer.conf Felix Moessbauer
2023-02-10  8:18   ` Gylstorff Quirin
2023-02-10  8:29     ` Moessbauer, Felix
2023-02-10  8:34       ` Gylstorff Quirin
2023-02-10  6:45 ` [isar-cip-core][PATCH v2 2/5] refactor: use imagetypes for swu generation Felix Moessbauer
2023-02-10  6:45 ` [isar-cip-core][PATCH v2 3/5] swu: directly image from squashfs rootfs Felix Moessbauer
2023-02-10  6:45 ` Felix Moessbauer [this message]
2023-02-10  6:45 ` [isar-cip-core][PATCH v2 5/5] refactor verity image creation Felix Moessbauer
2023-02-10  8:34 ` [isar-cip-core][PATCH v2 0/5] Rework image classes Schmidt, Adriaan

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=20230210064503.706699-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.