From: "Moessbauer, Felix" <felix.moessbauer@siemens.com>
To: "Schild, Henning" <henning.schild@siemens.com>
Cc: "isar-users@googlegroups.com" <isar-users@googlegroups.com>,
"Schmidt, Adriaan" <adriaan.schmidt@siemens.com>,
"jan.kiszka@siemens.com" <jan.kiszka@siemens.com>,
"ibr@ilbers.de" <ibr@ilbers.de>,
"amikan@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 12:22:08 +0000 [thread overview]
Message-ID: <AM9PR10MB4869342FC211B323FB9C7620894D9@AM9PR10MB4869.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20220919140313.5e6574e9@md1za8fc.ad001.siemens.net>
> -----Original Message-----
> From: Schild, Henning (T CED SES-DE) <henning.schild@siemens.com>
> Sent: Monday, September 19, 2022 2:03 PM
> To: Moessbauer, Felix (T CED SES-DE) <felix.moessbauer@siemens.com>
> Cc: isar-users@googlegroups.com; Schmidt, Adriaan (T CED SES-DE)
> <adriaan.schmidt@siemens.com>; Kiszka, Jan (T CED)
> <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
>
> 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
I had a very careful look at the OE wic script as well and the only difference is that they do not copy any temporary files (like the partitions) to the deploy dir.
That's why they don't do this "find" but simply "move" the .direct file [1].
There had been proposed patches to change that (also from Siemens), but they never have been accepted.
The added "-w $tmp_wic" is indeed a divergence, but that is independent of the added / changed logic in this series.
In the end, the OE data in $tmp_wic is never re-used again.
>
> 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.
If you look carefully at the following lines after the "find", you will see that the
WICTMP is deleted anyways. And in between, there is no extension point where any other tool could integrate and read the temporary files.
By that, I assume that my approach is correct and reliable.
[1] https://git.openembedded.org/openembedded-core/tree/meta/classes/image_types_wic.bbclass?id=958ee0eede859bdba659e3343856b1c226207854#n68
Felix
>
> 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}"
next prev parent reply other threads:[~2022-09-19 12:22 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
2022-09-19 12:22 ` Moessbauer, Felix [this message]
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=AM9PR10MB4869342FC211B323FB9C7620894D9@AM9PR10MB4869.EURPRD10.PROD.OUTLOOK.COM \
--to=felix.moessbauer@siemens.com \
--cc=adriaan.schmidt@siemens.com \
--cc=amikan@ilbers.de \
--cc=henning.schild@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