From patchwork Thu Nov 10 12:44:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 13038756 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4572C4332F for ; Thu, 10 Nov 2022 12:45:10 +0000 (UTC) Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net [185.136.65.226]) by mx.groups.io with SMTP id smtpd.web11.6911.1668084308196319483 for ; Thu, 10 Nov 2022 04:45:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=Quirin.Gylstorff@siemens.com header.s=fm1 header.b=ZiYiwdQZ; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.226, mailfrom: fm-51332-202211101245053d29490b7c48a7e9f0-ggwyfn@rts-flowmailer.siemens.com) Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 202211101245053d29490b7c48a7e9f0 for ; Thu, 10 Nov 2022 13:45:05 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=Quirin.Gylstorff@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=b/QYV4UkerO761+B8jJS7feuEFj282lpPZfy/Dx9jAk=; b=ZiYiwdQZf4sWgK9XPWu9y9MrUMP7pC972YonwZ9S8wzN22AkS5GOR85kDZ+TtlrE1xKe0s wLMipcaThVAK5CPxTJ/DSZWaBNKTkmkmgT+GThQowmxyhhRrvQJojQvv+YzTMQ5XyblzlvcC 3nexOcww92Y1DkkPZNmtwliaqdGew=; From: Quirin Gylstorff To: cip-dev@lists.cip-project.org, jan.kiszka@siemens.com, felix.moessbauer@siemens.com, christian.storm@siemens.com Subject: [cip-dev][isar-cip-core][RFC 1/5] core/images/swupdate.inc: Move image_uuid to swupdate.inc Date: Thu, 10 Nov 2022 13:44:59 +0100 Message-Id: <20221110124503.274124-2-Quirin.Gylstorff@siemens.com> In-Reply-To: <20221110124503.274124-1-Quirin.Gylstorff@siemens.com> References: <20221110124503.274124-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 10 Nov 2022 12:45:10 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/9997 From: Quirin Gylstorff Prerequisite for the changes to check the uuid. Signed-off-by: Quirin Gylstorff --- kas/opt/ebg-swu.yml | 2 +- recipes-core/images/image-uuid.inc | 12 ------------ recipes-core/images/swupdate.inc | 1 + 3 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 recipes-core/images/image-uuid.inc diff --git a/kas/opt/ebg-swu.yml b/kas/opt/ebg-swu.yml index ce37c36..6aa411b 100644 --- a/kas/opt/ebg-swu.yml +++ b/kas/opt/ebg-swu.yml @@ -20,7 +20,7 @@ local_conf_header: SWUPDATE_BOOTLOADER = "efibootguard" IMAGE_INSTALL_remove = "u-boot-script" ebg_swu_image_options: | - CIP_IMAGE_OPTIONS_append = " efibootguard.inc image-uuid.inc" + CIP_IMAGE_OPTIONS_append = " efibootguard.inc" initramfs: | INITRAMFS_INSTALL_append = " initramfs-abrootfs-hook" firmware-binaries: | diff --git a/recipes-core/images/image-uuid.inc b/recipes-core/images/image-uuid.inc deleted file mode 100644 index 5e5a727..0000000 --- a/recipes-core/images/image-uuid.inc +++ /dev/null @@ -1,12 +0,0 @@ -# -# CIP Core, generic profile -# -# Copyright (c) Siemens AG, 2022 -# -# Authors: -# Jan Kiszka -# -# SPDX-License-Identifier: MIT -# - -inherit image_uuid diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc index edc41a0..6cf9bb1 100644 --- a/recipes-core/images/swupdate.inc +++ b/recipes-core/images/swupdate.inc @@ -9,6 +9,7 @@ # SPDX-License-Identifier: MIT # +inherit image_uuid inherit swupdate inherit read-only-rootfs From patchwork Thu Nov 10 12:45:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 13038755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F35E0C4167B for ; Thu, 10 Nov 2022 12:45:10 +0000 (UTC) Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by mx.groups.io with SMTP id smtpd.web10.6816.1668084308351436441 for ; Thu, 10 Nov 2022 04:45:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=Quirin.Gylstorff@siemens.com header.s=fm1 header.b=Tjilh0K4; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-51332-20221110124506c9a9d7feb2d2038547-olyany@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 20221110124506c9a9d7feb2d2038547 for ; Thu, 10 Nov 2022 13:45:06 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=Quirin.Gylstorff@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=cs/QbgjFWz0BZ/r3l4ewpdB79r4ZHrCP90UoqVYUTG0=; b=Tjilh0K4qkVYM1390lUbAAOBP7Zen6QrvdHmcGUN16SCPSU7VtiynXOepQFhF1SDCQbDK2 9iw0xf2Sqxr/C4Uh5gsSzvf/+/tJ57ST/e/jce9nsd2f5qP9xlCASXKFKW0T1QaoGHJfUKCD VMZWsFMwKFg7MAm/+q6u+d6uOCqk8=; From: Quirin Gylstorff To: cip-dev@lists.cip-project.org, jan.kiszka@siemens.com, felix.moessbauer@siemens.com, christian.storm@siemens.com Subject: [cip-dev][isar-cip-core][RFC 2/5] swupdate-handler-roundrobin: Increase revision Date: Thu, 10 Nov 2022 13:45:00 +0100 Message-Id: <20221110124503.274124-3-Quirin.Gylstorff@siemens.com> In-Reply-To: <20221110124503.274124-1-Quirin.Gylstorff@siemens.com> References: <20221110124503.274124-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 10 Nov 2022 12:45:10 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/9998 From: Quirin Gylstorff Signed-off-by: Quirin Gylstorff --- .../swupdate-handler-roundrobin_0.1.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb b/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb index 5801113..65cd652 100644 --- a/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb +++ b/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb @@ -13,7 +13,7 @@ inherit dpkg-raw PROVIDES = "swupdate-handlers" SRC_URI += "git://gitlab.com/cip-project/cip-sw-updates/swupdate-handler-roundrobin.git;protocol=https;destsuffix=swupdate-handler-roundrobin;name=swupdate-handler-roundrobin;nobranch=1" -SRCREV_swupdate-handler-roundrobin ?= "bf73f04b1eec0b8714d3a1b56bfcd1431c58ba10" +SRCREV_swupdate-handler-roundrobin ?= "fbc8d8a7e4ae8c381198cab81ae3fb13398a028e" SWUPDATE_LUASCRIPT = "swupdate-handler-roundrobin/swupdate_handlers_roundrobin.lua" From patchwork Thu Nov 10 12:45:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 13038753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7EF5C433FE for ; Thu, 10 Nov 2022 12:45:10 +0000 (UTC) Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net [185.136.64.228]) by mx.groups.io with SMTP id smtpd.web09.6908.1668084308965975399 for ; Thu, 10 Nov 2022 04:45:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=Quirin.Gylstorff@siemens.com header.s=fm1 header.b=m2Oj88FQ; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.228, mailfrom: fm-51332-2022111012450622e3a45e1f06f47227-hq9i7g@rts-flowmailer.siemens.com) Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 2022111012450622e3a45e1f06f47227 for ; Thu, 10 Nov 2022 13:45:06 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=Quirin.Gylstorff@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=gRE+dbT8JTLDs4DcYE/yFUvLGYoPZLZvE2njMrxs2ww=; b=m2Oj88FQYxgORCxaxbyYm/xHeoHPmvs40cWJQBeMB1gtkijSw/aKC0H+pQHz4jLOGFn1hE YB9ToBZj7xgdylU1oi5ysEnuayUkjHq1AXOyGUi3a8eQx1fP3J2k6yuDQ6hvzLbzQTGeNjag GzP9AM4EE63CL4vX1Fgx4uwUIXPdo=; From: Quirin Gylstorff To: cip-dev@lists.cip-project.org, jan.kiszka@siemens.com, felix.moessbauer@siemens.com, christian.storm@siemens.com Subject: [cip-dev][isar-cip-core][RFC 3/5] swupdate-handler-roundrobin: add uuidcheck patch Date: Thu, 10 Nov 2022 13:45:01 +0100 Message-Id: <20221110124503.274124-4-Quirin.Gylstorff@siemens.com> In-Reply-To: <20221110124503.274124-1-Quirin.Gylstorff@siemens.com> References: <20221110124503.274124-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 10 Nov 2022 12:45:10 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/10002 From: Quirin Gylstorff This patch adds a pre/post function to the swupdate-handler roundrobin to compare the uuid parameter from the sw-description with the uuid of the current system to avoid a updating with the same image and breaking the update cycle. Signed-off-by: Quirin Gylstorff --- ...-add-uuidcheck-to-roundrobin-handler.patch | 43 +++++++++++++++++++ .../swupdate-handler-roundrobin_0.1.bb | 3 ++ 2 files changed, 46 insertions(+) create mode 100644 recipes-core/swupdate-handler-roundrobin/files/0001-add-uuidcheck-to-roundrobin-handler.patch diff --git a/recipes-core/swupdate-handler-roundrobin/files/0001-add-uuidcheck-to-roundrobin-handler.patch b/recipes-core/swupdate-handler-roundrobin/files/0001-add-uuidcheck-to-roundrobin-handler.patch new file mode 100644 index 0000000..f2392f4 --- /dev/null +++ b/recipes-core/swupdate-handler-roundrobin/files/0001-add-uuidcheck-to-roundrobin-handler.patch @@ -0,0 +1,43 @@ +From f093a3a097e518ef9f74ff88eafa9259ba50626f Mon Sep 17 00:00:00 2001 +From: Quirin Gylstorff +Date: Tue, 8 Nov 2022 16:08:25 +0100 +Subject: [PATCH] add uuidcheck to roundrobin handler + +Signed-off-by: Quirin Gylstorff +--- + swupdate_handlers_roundrobin.lua | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/swupdate_handlers_roundrobin.lua b/swupdate_handlers_roundrobin.lua +index bf9c997..bb24fc7 100644 +--- a/swupdate_handlers_roundrobin.lua ++++ b/swupdate_handlers_roundrobin.lua +@@ -726,3 +726,25 @@ function pp_mmclock(when, device, image) + swupdate.info("%s: %s MMC device %s", logprefix, when == WHEN.PRE and "Unlocked" or "Locked", device) + return true + end ++ ++function pp_uuidcheck(when, uuid, image) ++ local filename = "/etc/os-release" ++ local filehandle = io.open(filename, "rb") ++ if not filehandle then ++ swupdate.error("%s: Cannot open file %s", logprefix, filename) ++ return false ++ end ++ osrelease = filehandle:read("*a") ++ filehandle:close() ++ image_uuid = string.match(osrelease, "IMAGE_UUID.*") ++ if not image_uuid then ++ swupdate.error("%s: Cannot find IMAGE_UUID in %s", logprefix, filename) ++ return false ++ end ++ swupdate.debug("%s: %s", logprefix, image_uuid, uuid) ++ if string.find(image_uuid, uuid, 1, true) then ++ swupdate.error("%s: Update already installed.", logprefix) ++ return false ++ end ++ return true ++end +-- +2.35.1 + diff --git a/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb b/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb index 65cd652..447a093 100644 --- a/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb +++ b/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb @@ -13,8 +13,11 @@ inherit dpkg-raw PROVIDES = "swupdate-handlers" SRC_URI += "git://gitlab.com/cip-project/cip-sw-updates/swupdate-handler-roundrobin.git;protocol=https;destsuffix=swupdate-handler-roundrobin;name=swupdate-handler-roundrobin;nobranch=1" +SRC_URI += "file://0001-add-uuidcheck-to-roundrobin-handler.patch" SRCREV_swupdate-handler-roundrobin ?= "fbc8d8a7e4ae8c381198cab81ae3fb13398a028e" +S="${WORKDIR}/${PN}" + SWUPDATE_LUASCRIPT = "swupdate-handler-roundrobin/swupdate_handlers_roundrobin.lua" SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG ?= "swupdate.handler.${SWUPDATE_BOOTLOADER}.ini" From patchwork Thu Nov 10 12:45:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 13038757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00481C4167D for ; Thu, 10 Nov 2022 12:45:10 +0000 (UTC) Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net [185.136.64.228]) by mx.groups.io with SMTP id smtpd.web11.6912.1668084308939076149 for ; Thu, 10 Nov 2022 04:45:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=Quirin.Gylstorff@siemens.com header.s=fm1 header.b=Q584MmiU; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.228, mailfrom: fm-51332-20221110124506362991bf24a67221bf-ym11d7@rts-flowmailer.siemens.com) Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20221110124506362991bf24a67221bf for ; Thu, 10 Nov 2022 13:45:07 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=Quirin.Gylstorff@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=1mm5WXKFNaJTQGCFp8i/RrWjeryAXdhjZYirGNYNww4=; b=Q584MmiU/xkGYLRcea+wTVyiDPQjGU0H7OJuqLObxWwj7UZp44iV0sOLkUJtERP9NFkFPG chIXMYiEyjldlTfd18X/lX7SzfsxAYQCuArFRg8KyVCGmUnlR26liPT0zqSN1RNy8HSSlZT/ QU2rpq0jxL/1VOJHDLUbvIo8CAUlc=; From: Quirin Gylstorff To: cip-dev@lists.cip-project.org, jan.kiszka@siemens.com, felix.moessbauer@siemens.com, christian.storm@siemens.com Subject: [cip-dev][isar-cip-core][RFC 4/5] image_uuid: read target_image_uuid Date: Thu, 10 Nov 2022 13:45:02 +0100 Message-Id: <20221110124503.274124-5-Quirin.Gylstorff@siemens.com> In-Reply-To: <20221110124503.274124-1-Quirin.Gylstorff@siemens.com> References: <20221110124503.274124-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 10 Nov 2022 12:45:10 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/9999 From: Quirin Gylstorff This writes the target_image_uuid to the Variable TARGET_IMAGE_UUID which can be used to validate a update against the root file system. Signed-off-by: Quirin Gylstorff --- classes/image_uuid.bbclass | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/classes/image_uuid.bbclass b/classes/image_uuid.bbclass index 277941b..3e2e3de 100644 --- a/classes/image_uuid.bbclass +++ b/classes/image_uuid.bbclass @@ -13,6 +13,8 @@ inherit rootfs inherit image +# Generate the uuid from BB_TASKHASH to ensure a new +# hash on each rebuild def generate_image_uuid(d): import uuid @@ -23,6 +25,23 @@ def generate_image_uuid(d): IMAGE_UUID ?= "${@generate_image_uuid(d)}" +def read_target_image_uuid(d): + import os.path + + deploy_dir = d.getVar("DEPLOY_DIR_IMAGE") + image_full_name = d.getVar("IMAGE_FULLNAME") + uuid_file = f"{deploy_dir}/{image_full_name}.uuid.env" + if not os.path.isfile(uuid_file): + return None + + target_image_uuid = None + with open(uuid_file, "r") as f: + uuid_file_content = f.read() + target_image_uuid = uuid_file_content.split('=')[1].strip(' \t\n\r').strip('\"') + return target_image_uuid + +TARGET_IMAGE_UUID = "${@read_target_image_uuid(d)}" + do_generate_image_uuid[vardeps] += "IMAGE_UUID" do_generate_image_uuid[depends] = "buildchroot-target:do_build" do_generate_image_uuid[dirs] = "${DEPLOY_DIR_IMAGE}" From patchwork Thu Nov 10 12:45:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 13038752 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6E67C43217 for ; Thu, 10 Nov 2022 12:45:10 +0000 (UTC) Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net [185.136.64.225]) by mx.groups.io with SMTP id smtpd.web10.6817.1668084309315125821 for ; Thu, 10 Nov 2022 04:45:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=Quirin.Gylstorff@siemens.com header.s=fm1 header.b=A8OxpVas; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.225, mailfrom: fm-51332-202211101245076551a2dc238d0e8b85-kgxgur@rts-flowmailer.siemens.com) Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 202211101245076551a2dc238d0e8b85 for ; Thu, 10 Nov 2022 13:45:07 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=Quirin.Gylstorff@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=s5GDnWBxhx2d8GmnNA16L7NvAuK8amJCp/1mCmqYc4U=; b=A8OxpVas9QzZqAUkoSSjRkgHjQOb/MmJDQdfKgxgL72w04RIUInalS1HDzvThPWLzYfHyw +mt+xhdV77EPVi3t/rebvBUIciudOXxiYOGilX76Nx1p6B+BDbKcaC/dP4c1hJXuQMawJlBL 8tLCbBGxXQ/u5c8gd72OHsMcy0azA=; From: Quirin Gylstorff To: cip-dev@lists.cip-project.org, jan.kiszka@siemens.com, felix.moessbauer@siemens.com, christian.storm@siemens.com Subject: [cip-dev][isar-cip-core][RFC 5/5] recipe-core/images: Integrate uuidcheck into sw-description Date: Thu, 10 Nov 2022 13:45:03 +0100 Message-Id: <20221110124503.274124-6-Quirin.Gylstorff@siemens.com> In-Reply-To: <20221110124503.274124-1-Quirin.Gylstorff@siemens.com> References: <20221110124503.274124-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 10 Nov 2022 12:45:10 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/10001 From: Quirin Gylstorff Signed-off-by: Quirin Gylstorff --- recipes-core/images/files/sw-description.tmpl | 1 + recipes-core/images/swupdate.inc | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes-core/images/files/sw-description.tmpl b/recipes-core/images/files/sw-description.tmpl index 1c0db02..a9a6069 100644 --- a/recipes-core/images/files/sw-description.tmpl +++ b/recipes-core/images/files/sw-description.tmpl @@ -20,6 +20,7 @@ software = filesystem = "ext4"; properties: { subtype = "image"; + uuidcheck = "${TARGET_IMAGE_UUID}"; }; sha256 = "${ROOTFS_PARTITION_NAME}-sha256"; }); diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc index 6cf9bb1..0ba3a0e 100644 --- a/recipes-core/images/swupdate.inc +++ b/recipes-core/images/swupdate.inc @@ -23,6 +23,9 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI += "file://sw-description.tmpl" TEMPLATE_FILES += "sw-description.tmpl" -TEMPLATE_VARS += "ROOTFS_PARTITION_NAME" +do_transform_template[vardeps] += "TARGET_IMAGE_UUID" +addtask do_transform_template before do_swupdate_binary after do_generate_image_uuid + +TEMPLATE_VARS += "ROOTFS_PARTITION_NAME TARGET_IMAGE_UUID" SWU_ADDITIONAL_FILES += "linux.efi ${ROOTFS_PARTITION_NAME}"