public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: Felix Moessbauer <felix.moessbauer@siemens.com>
Cc: isar-users@googlegroups.com, adriaan.schmidt@siemens.com,
	jan.kiszka@siemens.com, ibr@ilbers.de, amikan@ilbers.de
Subject: Re: [PATCH v5 3/5] add option to control deploy of raw wic partitions
Date: Mon, 19 Sep 2022 14:03:13 +0200	[thread overview]
Message-ID: <20220919140313.5e6574e9@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20220919112035.830233-4-felix.moessbauer@siemens.com>

Am Mon, 19 Sep 2022 13:20:33 +0200
schrieb Felix Moessbauer <felix.moessbauer@siemens.com>:

> This patch adds the WIC_DEPLOY_PARTITIONS option to control
> if the raw partition files are deployed by wic.
> 
> We also set the default to not deploy to be closer to OE and to
> optimize for the average case.
> In addition, this significantly reduces the disk size required to
> run the CI.
> 
> An API changelog entry is added.
> 
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>  RECIPE-API-CHANGELOG.md             | 6 ++++++
>  meta-isar/conf/local.conf.sample    | 3 +++
>  meta/classes/imagetypes_wic.bbclass | 5 +++++
>  3 files changed, 14 insertions(+)
> 
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index 621d110e..0c34d9be 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -419,3 +419,9 @@ packages and will be lost after a given build
> session finishes. 
>  Any package build requirements for the rootfs should be satisfied in
> the Debian way via package dependencies.
> +
> +### Individual WIC partitions are no longer automatically deployed
> +
> +The individual wic partitions (e.g. *.wic.p1) are no longer
> automatically +copied into the `DEPLOY_DIR_IMAGE`.
> +To explicitly deploy these files (e.g. for swupdate), set
> `WIC_DEPLOY_PARTITIONS = "1"`. diff --git
> a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
> index ce7b58ee..57d06202 100644 --- a/meta-isar/conf/local.conf.sample
> +++ b/meta-isar/conf/local.conf.sample
> @@ -246,6 +246,9 @@ USER_isar[flags] += "clear-text-password"
>  # Uncomment the below line to debug WIC.
>  # WIC_CREATE_EXTRA_ARGS += "-D"
>  
> +# Uncomment this to also deploy each wic partition as separate file
> (e.g. for swupdate) +#WIC_DEPLOY_PARTITIONS = "1"
> +
>  # Uncomment this to use ccache for custom packages
>  #USE_CCACHE = "1"
>  # Uncomment and set own top level ccache directory to share between
> builds diff --git a/meta/classes/imagetypes_wic.bbclass
> b/meta/classes/imagetypes_wic.bbclass index 61a74d4a..ba8aa15c 100644
> --- a/meta/classes/imagetypes_wic.bbclass
> +++ b/meta/classes/imagetypes_wic.bbclass
> @@ -98,6 +98,7 @@ RECIPE_SYSROOT_NATIVE ?= "/"
>  BUILDCHROOT_DIR = "${BUILDCHROOT_TARGET_DIR}"
>  
>  WIC_CREATE_EXTRA_ARGS ?= ""
> +WIC_DEPLOY_PARTITIONS ?= "0"
>  
>  # taken from OE, do not touch directly
>  WICVARS += "\
> @@ -205,6 +206,10 @@ generate_wic_image() {
>  
>      sudo chown -R $(stat -c "%U" ${LAYERDIR_core}) ${LAYERDIR_core}
> ${LAYERDIR_isar} ${SCRIPTSDIR} || true sudo chown -R $(id -u):$(id
> -g) ${BUILDCHROOT_DIR}/${WICTMP}
> +    # only keep partitions if requested (ending with .p<x>)
> +    if [ "${WIC_DEPLOY_PARTITIONS}" -eq "0" ]; then
> +        find ${BUILDCHROOT_DIR}/${WICTMP} -type f -regextype sed
> -regex ".*\.direct.*\.p[0-9]\{1,\}" -delete

I just had a look at OE and they seem to do things differently. They
call wic with a -w "temporary workdir to use for intermediate files"
and later move only the ".direct" to DEPLOY/<image>.wic

So i would suggest to do that as well, and not delete valid files that
maybe a second run or another tool might end up missing. Say you
generate a .wic.xz and a .swu that swu will maybe need the partition
image where the .wic.xz itself would not deploy it.

Henning

> +    fi
>      find ${BUILDCHROOT_DIR}/${WICTMP} -type f -name "*.direct*" |
> while read f; do suffix=$(basename $f | sed
> 's/\(.*\)\(\.direct\)\(.*\)/\3/') mv -f ${f}
> "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.wic${suffix}"


  reply	other threads:[~2022-09-19 12:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 11:20 [PATCH v5 0/5] use xz and gzip on host (outside chroot) Felix Moessbauer
2022-09-19 11:20 ` [PATCH v5 1/5] do not crossbuild SDK for host-arch eq dist-arch Felix Moessbauer
2022-09-19 11:20 ` [PATCH v5 2/5] run imager in buildchroot-host on cross Felix Moessbauer
2022-09-19 11:20 ` [PATCH v5 3/5] add option to control deploy of raw wic partitions Felix Moessbauer
2022-09-19 12:03   ` Henning Schild [this message]
2022-09-19 12:22     ` Moessbauer, Felix
2022-09-20  7:55   ` Henning Schild
2022-09-20  8:39     ` Jan Kiszka
2022-09-20 12:23       ` Henning Schild
2022-09-20 10:49     ` Henning Schild
2022-09-19 11:20 ` [PATCH v5 4/5] add test for wic partition deploy logic Felix Moessbauer
2022-09-19 11:20 ` [PATCH v5 5/5] add wic.xz image to qemuarm64-bookworm 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=20220919140313.5e6574e9@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=adriaan.schmidt@siemens.com \
    --cc=amikan@ilbers.de \
    --cc=felix.moessbauer@siemens.com \
    --cc=ibr@ilbers.de \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@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