public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Moessbauer, Felix (T CED INW-CN)" <felix.moessbauer@siemens.com>,
	"cip-dev@lists.cip-project.org" <cip-dev@lists.cip-project.org>
Cc: "Schmidt, Adriaan (T CED SES-DE)" <adriaan.schmidt@siemens.com>,
	"Gylstorff, Quirin (T CED SES-DE)" <quirin.gylstorff@siemens.com>
Subject: Re: [isar-cip-core][PATCH v4 2/8] refactor: use imagetypes for swu generation
Date: Tue, 14 Feb 2023 08:18:46 +0100	[thread overview]
Message-ID: <49e13754-7e50-7bd3-e2a0-c19f6bf31bfc@siemens.com> (raw)
In-Reply-To: <e06cb90bf0652ea1035149cbf8d30c7dcbaba314.camel@siemens.com>

On 14.02.23 03:10, Moessbauer, Felix (T CED INW-CN) wrote:
> On Mon, 2023-02-13 at 16:28 +0100, Jan Kiszka wrote:
>> On 12.02.23 09:27, Felix Moessbauer wrote:
>>> This patch reworks the implementation of the swupdate type.
>>> All generic aspects are moved from the swupdate.inc file into the
>>> swupdate class and made conditional on the swu type.
>>> The sw-description file is now referenced using the image-type
>>> infrastructure, which avoids manual additions to FILESEXTRAPATHS
>>> and
>>> accidental overwrites of SRC_URI. The templating logic is moved
>>> into the
>>> generic one provided by imagetypes.
>>>
>>> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
>>> ---
>>>  classes/swupdate.bbclass                      | 26 ++++++++++++---
>>> ----
>>>  kas/opt/swupdate.yml                          |  5 +---
>>>  .../images/{files => swu}/sw-description.tmpl |  0
>>>  recipes-core/images/swupdate.inc              | 15 -----------
>>>  4 files changed, 18 insertions(+), 28 deletions(-)
>>>  rename recipes-core/images/{files => swu}/sw-description.tmpl
>>> (100%)
>>>
>>> diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
>>> index 5eb4936..966f7c0 100644
>>> --- a/classes/swupdate.bbclass
>>> +++ b/classes/swupdate.bbclass
>>> @@ -8,23 +8,33 @@
>>>  #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>>  #
>>>  # SPDX-License-Identifier: MIT
>>> +ROOTFS_PARTITION_NAME ?= "${IMAGE_FULLNAME}.wic.p4.gz"
>>>
>>>  SWU_IMAGE_FILE ?= "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-
>>> ${MACHINE}.swu"
>>>  SWU_DESCRIPTION_FILE ?= "sw-description"
>>> -SWU_ADDITIONAL_FILES ?= ""
>>> +SWU_ADDITIONAL_FILES ?= "linux.efi ${ROOTFS_PARTITION_NAME}"
>>>  SWU_SIGNED ?= ""
>>>  SWU_SIGNATURE_EXT ?= "sig"
>>>  SWU_SIGNATURE_TYPE ?= "rsa"
>>>
>>>  BUILDCHROOT_IMAGE_FILE ?=
>>> "${PP_DEPLOY}/${@os.path.basename(d.getVar('SWU_IMAGE_FILE'))}"
>>>
>>> -IMAGER_INSTALL += "cpio"
>>> -IMAGER_INSTALL += "${@'openssl' if
>>> bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
>>> +IMAGE_TYPEDEP:wic += "squashfs"
>>> +IMAGE_TYPEDEP:swu = "wic"
>>> +IMAGER_INSTALL:swu += "cpio ${@'openssl' if
>>> bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
>>>
>>> -do_swupdate_binary[stamp-extra-info] = "${DISTRO}-${MACHINE}"
>>> -do_swupdate_binary[cleandirs] += "${WORKDIR}/swu"
>>> -do_swupdate_binary[network] = "${TASK_USE_SUDO}"
>>> -do_swupdate_binary() {
>>> +IMAGE_SRC_URI:swu = "file://${SWU_DESCRIPTION_FILE}.tmpl"
>>> +IMAGE_TEMPLATE_FILES:swu = "${SWU_DESCRIPTION_FILE}.tmpl"
>>> +IMAGE_TEMPLATE_VARS:swu = "ROOTFS_PARTITION_NAME TARGET_IMAGE_UUID
>>> ABROOTFS_PART_UUID_A ABROOTFS_PART_UUID_B"
>>> +
>>> +# This imagetype is neither machine nor distro specific. Hence, we
>>> cannot
>>> +# use paths in FILESOVERRIDES. Manual modifications of this
>>> variable are
>>> +# discouradged and hard to implement. Instead, we register this
>>> path explicitly
>>> +FILESEXTRAPATHS:prepend = "${LAYERDIR_cip-core}/recipes-
>>> core/images/swu:"
>>
>> This means downstream layers wanting to overload the sw-
>> description.tmpl
>> now need to register their own FILESEXTRAPATHS? That at least
>> requires
>> documentation. Or can we also drop LAYERDIR_cip-core here, and it
>> would
>> still work?
> 
> That is exactly as it always has been. But downstream layer have to add
> it only if they override the SWU_DESCRIPTION_FILE. IMHO this is
> reasonable. I highly vote for keeping it like that, as these kind of
> things bite us again and again with each bitbake update.
> 

If I write

[my-image.bb]
inherit swupdate

and place an own sw-description.tmpl in my own files/ folder, will that
be picked (as to be naturally expected) or the one from cip-core?

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux



  reply	other threads:[~2023-02-14  7:19 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 [this message]
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 ` [isar-cip-core][PATCH v4 4/8] swupdate: only check partition uuids on swupdate Felix Moessbauer
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=49e13754-7e50-7bd3-e2a0-c19f6bf31bfc@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=adriaan.schmidt@siemens.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=felix.moessbauer@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox