public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: isar-users@googlegroups.com
Cc: henning.schild@siemens.com, jan.kiszka@siemens.com,
	ibr@ilbers.de, amikan@ilbers.de, adriaan.schmidt@siemens.com,
	Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v6 4/6] add option to control deploy of raw wic partitions
Date: Wed, 21 Sep 2022 09:33:46 +0200	[thread overview]
Message-ID: <20220921073348.169965-5-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20220921073348.169965-1-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             | 9 +++++++++
 meta-isar/conf/local.conf.sample    | 3 +++
 meta/classes/imagetypes_wic.bbclass | 9 +++++++++
 3 files changed, 21 insertions(+)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 621d110e..a5f5abee 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -419,3 +419,12 @@ 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
+
+We used to copy all temporary WIC files, like the partitions, into the deploy directory.
+That was intended actually only for compressed wic images where wic itself would do the compression.
+It was never intended to also deploy those partitions, so that will also not be done (automatically) anymore.
+To explicitly deploy the individual partition files (e.g. for swupdate), set `WIC_DEPLOY_PARTITIONS = "1"`.
+
+For compressed wic images `IMAGE_FSTYPES` should simply be extended with a compressed wic format, like "wic.xz".
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 81788faf..c0f3429a 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 += "\
@@ -208,6 +209,14 @@ generate_wic_image() {
     sudo chown -R $(id -u):$(id -g) ${BUILDCHROOT_DIR}/${WICTMP}
     mv -f ${WIC_DIRECT} ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.wic
     mv -f ${WIC_DIRECT}.bmap ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.bmap
+    # deploy partition files if requested (ending with .p<x>)
+    if [ "${WIC_DEPLOY_PARTITIONS}" -eq "1" ]; then
+        # locate *.direct.p<x> partition files
+        find ${BUILDCHROOT_DIR}/${WICTMP} -type f -regextype sed -regex ".*\.direct.*\.p[0-9]\{1,\}" | while read f; do
+            suffix=$(basename $f | sed 's/.*\.direct\(.*\)/\1/')
+            mv -f ${f} ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.wic${suffix}
+        done
+    fi
     rm -rf ${BUILDCHROOT_DIR}/${WICTMP}
     rm -rf ${IMAGE_ROOTFS}/../pseudo
 }
-- 
2.30.2


  parent reply	other threads:[~2022-09-21  7:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21  7:33 [PATCH v6 0/6] use xz and gzip on host (outside chroot) Felix Moessbauer
2022-09-21  7:33 ` [PATCH v6 1/6] do not crossbuild SDK for host-arch eq dist-arch Felix Moessbauer
2022-09-21  7:33 ` [PATCH v6 2/6] run imager in buildchroot-host on cross Felix Moessbauer
2022-09-21  7:33 ` [PATCH v6 3/6] Revert "wic: move out all files ending on "direct*"" Felix Moessbauer
2022-09-21  7:33 ` Felix Moessbauer [this message]
2022-09-21  7:33 ` [PATCH v6 5/6] add test for wic partition deploy logic Felix Moessbauer
2022-09-27  7:00   ` Anton Mikanovich
2022-09-21  7:33 ` [PATCH v6 6/6] add wic.xz image to qemuarm64-bookworm Felix Moessbauer
2022-09-21  8:23 ` [PATCH v6 0/6] use xz and gzip on host (outside chroot) Gylstorff Quirin

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=20220921073348.169965-5-felix.moessbauer@siemens.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