CPIO Format not recognized: magic not found

1,117 views
Skip to first unread message

bau...@pm.me

unread,
Oct 26, 2018, 7:06:10 PM10/26/18
to swup...@googlegroups.com
Hello,

I'm using Swupdate v2017.4.0 in conjunction with the  meta-swupdate layer and I have no problems using this amazing tool to upgrade my system when using a 310MB CPIO *.swu file. However, I am unable to upgrade my embedded system when I simply add more packages to the swu file to the tune of 2.5GB. The extracted rootfs is 8.1 GB. This is when I receive an error in the log:

[NOTIFY] : SWUPDATE failed [0] ERROR core/cpio_utils.c : get_cpiohdr : 44 : CPIO Format not recognized: magic not found
[NOTIFY] : SWUPDATE failed [0] ERROR core/cpio_utils.c : extract_cpio_header : 305 : CPIO Header corrupted, cannot be parsed
[NOTIFY] : SWUPDATE failed [0] ERROR core/swupdate.c : install_from_file : 318 : failed to scan for pos '5132'!

I looked at a previous msg on the mailing list (https://groups.google.com/forum/#!topic/swupdate/ABFNVf9hYOo), but there was no feedback given if the proposed solution worked. I'm on a 32-bit system using a busybox implementation of cpio. Busybox v1.24.1 (2018-09-29). I have 2GB of RAM installed with two partitions each of 13GB of flash and I am using the "Installed-directly" option.

Thus, can swupdate work with larger swu files that are > 2GB?




Stefano Babic

unread,
Oct 27, 2018, 5:42:11 AM10/27/18
to bau...@pm.me, swup...@googlegroups.com
Hi,

On 27/10/2018 01:06, bauerjj via swupdate wrote:
> Hello,
>
> I'm using Swupdate v2017.4.0 in conjunction with the  meta-swupdate
> layer and I have no problems using this amazing tool to upgrade my
> system when using a 310MB CPIO *.swu file. However, I am unable to
> upgrade my embedded system when I simply add more packages to the swu
> file to the tune of 2.5GB. The extracted rootfs is 8.1 GB. This is when
> I receive an error in the log:
>
> [NOTIFY] : SWUPDATE failed [0] ERROR core/cpio_utils.c : get_cpiohdr :
> 44 : CPIO Format not recognized: magic not found
> [NOTIFY] : SWUPDATE failed [0] ERROR core/cpio_utils.c :
> extract_cpio_header : 305 : CPIO Header corrupted, cannot be parsed
> [NOTIFY] : SWUPDATE failed [0] ERROR core/swupdate.c : install_from_file
> : 318 : failed to scan for pos '5132'!
>
> I looked at a previous msg on the mailing list
> (https://groups.google.com/forum/#!topic/swupdate/ABFNVf9hYOo
> <https://groups.google.com/forum/#%21topic/swupdate/ABFNVf9hYOo>), but
> there was no feedback given if the proposed solution worked. I'm on a
> 32-bit system using a busybox implementation of cpio.

It does not matter. SWUpdate does not call external tools. The format of
the file is CPIO (CPIO header in the new ASCII), but SWUpdate decodes
itself the file.

Do you build with Yocto ? And if not, have you patched cpio as :

https://github.com/sbabic/meta-swupdate/tree/master/recipes-extended/cpio/files

> Busybox v1.24.1
> (2018-09-29). I have 2GB of RAM installed with two partitions each of
> 13GB of flash and I am using the "Installed-directly" option.
>

It does not help, it must be debugged to understand what is happening.

> Thus, can swupdate work with larger swu files that are > 2GB?

Yes, the limit is set by CPIO internal format and each artifact must be
less that 4 GB (32 bit extension).

You can also try to test with last SWUpdate (git version) to check if
the issue is solved. There was some sign issues in the extraction chain
that I solved after 2017.10. They can be the cause die to overflow of
some variables.

Best regards,
Stefano Babic

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Rahul Ranjan

unread,
Sep 2, 2023, 2:58:24 PM9/2/23
to swupdate
Hello Stefano,

I am also facing the the magic number issue

[TRACE] : SWUPDATE running :  [network_initializer] : Software update started
[ERROR] : SWUPDATE failed [0] ERROR cpio_utils.c : get_cpiohdr : 52 : CPIO Format not recognized: magic not found
[ERROR] : SWUPDATE failed [0] ERROR cpio_utils.c : extract_cpio_header : 736 : CPIO Header corrupted, cannot be parsed
[TRACE] : SWUPDATE running :  [network_initializer] : Note: Setting EFI Boot Guard's 'in_progress' environment variable cannot be di.
[TRACE] : SWUPDATE running :  [network_initializer] : Note: EFI Boot Guard environment transaction will not be auto-committed.
[WARN ] : SWUPDATE running :  [network_initializer] : EFI Boot Guard environment modifications will not be persisted.
[ERROR] : SWUPDATE failed [1] Image invalid or corrupted. Not installing ...
[TRACE] : SWUPDATE running :  [network_initializer] : Main thread sleep again !
[INFO ] : No SWUPDATE running :  Waiting for requests...

Do i Need to set the magic number to a specific value ?

Regards,
R.

Reply all
Reply to author
Forward
0 new messages