public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] wic: move out all files ending on "direct*"
@ 2021-04-08  8:05 Henning Schild
  2021-04-08  8:32 ` Jan Kiszka
  2021-04-16 14:21 ` Anton Mikanovich
  0 siblings, 2 replies; 5+ messages in thread
From: Henning Schild @ 2021-04-08  8:05 UTC (permalink / raw)
  To: isar-users; +Cc: Henning Schild

wic can compress images, in which case they would have a suffix
plus our new version of wic keeps individual partitions that might be
valuable to some, they also have a suffix we used to not move out

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/wic-img.bbclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index 59dcd2b7c124..76606f882e79 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -193,10 +193,11 @@ EOSUDO
               ${WIC_CREATE_EXTRA_ARGS}
 
     sudo chown -R $(stat -c "%U" ${LAYERDIR_core}) ${LAYERDIR_core} ${LAYERDIR_isar} ${SCRIPTSDIR} || true
-    WIC_DIRECT=$(ls -t -1 ${BUILDCHROOT_DIR}/$WICTMP/${IMAGE_FULLNAME}.wic/*.direct | head -1)
     sudo chown -R $(id -u):$(id -g) ${BUILDCHROOT_DIR}/${WICTMP}
-    mv -f ${WIC_DIRECT} ${WIC_IMAGE_FILE}
-    mv -f ${WIC_DIRECT}.bmap ${WIC_IMAGE_FILE}.bmap
+    find ${BUILDCHROOT_DIR}/${WICTMP} -type f -name "*.direct*" | while read f; do
+        suffix=$(basename $f | sed 's/\(.*\)\(\.direct\)\(.*\)/\3/')
+        mv -f ${f} ${WIC_IMAGE_FILE}${suffix}
+    done
     rm -rf ${BUILDCHROOT_DIR}/${WICTMP}
     rm -rf ${IMAGE_ROOTFS}/../pseudo
 }
-- 
2.26.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wic: move out all files ending on "direct*"
  2021-04-08  8:05 [PATCH] wic: move out all files ending on "direct*" Henning Schild
@ 2021-04-08  8:32 ` Jan Kiszka
  2021-04-08  8:44   ` Henning Schild
  2021-04-16 14:21 ` Anton Mikanovich
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2021-04-08  8:32 UTC (permalink / raw)
  To: [ext] Henning Schild, isar-users, Quirin Gylstorff

On 08.04.21 10:05, [ext] Henning Schild wrote:
> wic can compress images, in which case they would have a suffix
> plus our new version of wic keeps individual partitions that might be
> valuable to some, they also have a suffix we used to not move out
> 

I vaguely recall some partition extraction classes for SWUpdate
scenarios - room for improvements, Quirin? Or are we using that feature
already?

Jan

> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>  meta/classes/wic-img.bbclass | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
> index 59dcd2b7c124..76606f882e79 100644
> --- a/meta/classes/wic-img.bbclass
> +++ b/meta/classes/wic-img.bbclass
> @@ -193,10 +193,11 @@ EOSUDO
>                ${WIC_CREATE_EXTRA_ARGS}
>  
>      sudo chown -R $(stat -c "%U" ${LAYERDIR_core}) ${LAYERDIR_core} ${LAYERDIR_isar} ${SCRIPTSDIR} || true
> -    WIC_DIRECT=$(ls -t -1 ${BUILDCHROOT_DIR}/$WICTMP/${IMAGE_FULLNAME}.wic/*.direct | head -1)
>      sudo chown -R $(id -u):$(id -g) ${BUILDCHROOT_DIR}/${WICTMP}
> -    mv -f ${WIC_DIRECT} ${WIC_IMAGE_FILE}
> -    mv -f ${WIC_DIRECT}.bmap ${WIC_IMAGE_FILE}.bmap
> +    find ${BUILDCHROOT_DIR}/${WICTMP} -type f -name "*.direct*" | while read f; do
> +        suffix=$(basename $f | sed 's/\(.*\)\(\.direct\)\(.*\)/\3/')
> +        mv -f ${f} ${WIC_IMAGE_FILE}${suffix}
> +    done
>      rm -rf ${BUILDCHROOT_DIR}/${WICTMP}
>      rm -rf ${IMAGE_ROOTFS}/../pseudo
>  }
> 

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wic: move out all files ending on "direct*"
  2021-04-08  8:32 ` Jan Kiszka
@ 2021-04-08  8:44   ` Henning Schild
  2021-04-08  8:49     ` Jan Kiszka
  0 siblings, 1 reply; 5+ messages in thread
From: Henning Schild @ 2021-04-08  8:44 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: isar-users, Quirin Gylstorff

Am Thu, 8 Apr 2021 10:32:32 +0200
schrieb Jan Kiszka <jan.kiszka@siemens.com>:

> On 08.04.21 10:05, [ext] Henning Schild wrote:
> > wic can compress images, in which case they would have a suffix
> > plus our new version of wic keeps individual partitions that might
> > be valuable to some, they also have a suffix we used to not move out
> >   
> 
> I vaguely recall some partition extraction classes for SWUpdate
> scenarios - room for improvements, Quirin? Or are we using that
> feature already?

I know, with swupdate we often wanted those single partitions but did
not have them because wic did not keep them. Now wic seems to keep
them, which might make later extraction not needed anymore.

I have compression as a separate task in some layers, when i wanted to
finally upstream it i found that wic supports it already.
i.e. bz2 compression is really good to shrink artifacts in CI, and
https://www.balena.io/etcher/ can uncompress that. Which means Mac and
Windows users can flash with a mouse what comes out of CI.

Henning

> Jan
> 
> > Signed-off-by: Henning Schild <henning.schild@siemens.com>
> > ---
> >  meta/classes/wic-img.bbclass | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/meta/classes/wic-img.bbclass
> > b/meta/classes/wic-img.bbclass index 59dcd2b7c124..76606f882e79
> > 100644 --- a/meta/classes/wic-img.bbclass
> > +++ b/meta/classes/wic-img.bbclass
> > @@ -193,10 +193,11 @@ EOSUDO
> >                ${WIC_CREATE_EXTRA_ARGS}
> >  
> >      sudo chown -R $(stat -c "%U" ${LAYERDIR_core})
> > ${LAYERDIR_core} ${LAYERDIR_isar} ${SCRIPTSDIR} || true
> > -    WIC_DIRECT=$(ls -t -1
> > ${BUILDCHROOT_DIR}/$WICTMP/${IMAGE_FULLNAME}.wic/*.direct | head
> > -1) sudo chown -R $(id -u):$(id -g) ${BUILDCHROOT_DIR}/${WICTMP}
> > -    mv -f ${WIC_DIRECT} ${WIC_IMAGE_FILE}
> > -    mv -f ${WIC_DIRECT}.bmap ${WIC_IMAGE_FILE}.bmap
> > +    find ${BUILDCHROOT_DIR}/${WICTMP} -type f -name "*.direct*" |
> > while read f; do
> > +        suffix=$(basename $f | sed
> > 's/\(.*\)\(\.direct\)\(.*\)/\3/')
> > +        mv -f ${f} ${WIC_IMAGE_FILE}${suffix}
> > +    done
> >      rm -rf ${BUILDCHROOT_DIR}/${WICTMP}
> >      rm -rf ${IMAGE_ROOTFS}/../pseudo
> >  }
> >   
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wic: move out all files ending on "direct*"
  2021-04-08  8:44   ` Henning Schild
@ 2021-04-08  8:49     ` Jan Kiszka
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2021-04-08  8:49 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users, Quirin Gylstorff

On 08.04.21 10:44, Henning Schild wrote:
> Am Thu, 8 Apr 2021 10:32:32 +0200
> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> 
>> On 08.04.21 10:05, [ext] Henning Schild wrote:
>>> wic can compress images, in which case they would have a suffix
>>> plus our new version of wic keeps individual partitions that might
>>> be valuable to some, they also have a suffix we used to not move out
>>>   
>>
>> I vaguely recall some partition extraction classes for SWUpdate
>> scenarios - room for improvements, Quirin? Or are we using that
>> feature already?
> 
> I know, with swupdate we often wanted those single partitions but did
> not have them because wic did not keep them. Now wic seems to keep
> them, which might make later extraction not needed anymore.
> 
> I have compression as a separate task in some layers, when i wanted to
> finally upstream it i found that wic supports it already.
> i.e. bz2 compression is really good to shrink artifacts in CI, and
> https://www.balena.io/etcher/ can uncompress that. Which means Mac and
> Windows users can flash with a mouse what comes out of CI.

That's even greater to hear: I was recently asked for such a flashing
tool internally ("Does Isar have something like
https://www.raspberrypi.org/blog/raspberry-pi-imager-imaging-utility/?")
and also pointed to Etcher as one option. The smoother things work with
it, the better. Maybe worth to add a section to the user manual?

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wic: move out all files ending on "direct*"
  2021-04-08  8:05 [PATCH] wic: move out all files ending on "direct*" Henning Schild
  2021-04-08  8:32 ` Jan Kiszka
@ 2021-04-16 14:21 ` Anton Mikanovich
  1 sibling, 0 replies; 5+ messages in thread
From: Anton Mikanovich @ 2021-04-16 14:21 UTC (permalink / raw)
  To: Henning Schild, isar-users

08.04.2021 11:05, Henning Schild wrote:
> wic can compress images, in which case they would have a suffix
> plus our new version of wic keeps individual partitions that might be
> valuable to some, they also have a suffix we used to not move out
>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>

Applied to next, thanks.

-- 
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-19  8:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08  8:05 [PATCH] wic: move out all files ending on "direct*" Henning Schild
2021-04-08  8:32 ` Jan Kiszka
2021-04-08  8:44   ` Henning Schild
2021-04-08  8:49     ` Jan Kiszka
2021-04-16 14:21 ` Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox