fail to create cpio image for large rootfs (>2GB)

Description

While building agl-demo-platform-crosssdk, error log is:

ERROR: agl-demo-platform-crosssdk-1.0-r0 do_image_cpio: Function failed: do_image_cpio (log file is located at /xdt/build/m3ulcb/tmp/work/m3ulcb-agl-linux/agl-demo-platform-crosssdk/1.0-r0/temp/log.do_image_cpio.33258) ERROR: Logfile of failure stored in: /xdt/build/m3ulcb/tmp/work/m3ulcb-agl-linux/agl-demo-platform-crosssdk/1.0-r0/temp/log.do_image_cpio.33258 Log data follows: | DEBUG: Executing python function set_image_size | DEBUG: Python function set_image_size finished | DEBUG: Executing shell function do_image_cpio | 4537251 blocks | cpio: cannot seek on output: Invalid argument | WARNING: exit code 1 from a shell command. | ERROR: Function failed: do_image_cpio (log file is located at /xdt/build/m3ulcb/tmp/work/m3ulcb-agl-linux/agl-demo-platform-crosssdk/1.0-r0/temp/log.do_image_cpio.33258) ERROR: Task (/xdt/meta/meta-agl-demo/recipes-platform/images/agl-demo-platform-crosssdk.bb:do_image_cpio) failed with exit code '1' NOTE: Tasks Summary: Attempted 10857 tasks of which 10856 didn't need to be rerun and 1 failed.

Rootfs dir in ...../tmp/work/m3ulcb-agl-linux/agl-demo-platform-crosssdk/1.0-r0/rootfs takes 2.5GB.

Script do_image_cpio fails at second cpio call:

  • first call will create a cpio archive which seems correct (2.5GB)

  • second call fails when trying to append'./init' to the big archive

Strace shows something like this before failure:

37365 lseek(3, 18446744071737656320, SEEK_SET) = -1 EINVAL (Invalid argument)

First conclusion: cpio doesn't support seeking at the end of an archive with size >2GB ...

cpio version is 2.11, built- as native tool (hosttools). Using cpio 2.11 from Debian 8 leads to the exact same error.

Environment

Build for M3 with EEL.RC1 + Chromium preinstalled inside image. cpio version 2.11 from hosttools dir (native)

Activity

Jan-Simon Moeller 
November 6, 2017 at 8:51 PM

CPIO was probably there for ramdisk-only "core-image-*" . This does not apply to AGL at all as CPIO does not support the XATTR we need for smack.

https://gerrit.automotivelinux.org/gerrit/#/c/11713/

 

 

Stephane Desneux 
November 6, 2017 at 2:10 PM
(edited)

Agreed: I think that unneeded files are installed in the current EE.RC1 image for M3 (and maybe other machines as well):

# du -ms -c usr/* 0 usr/aarch64-agl-linux 25 usr/AGL 109 usr/bin 1 usr/dbspace 0 usr/games 238 usr/include 466 usr/lib 4 usr/libexec 0 usr/local 16 usr/sbin 203 usr/share 774 usr/src 1830 total

We see that /usr takes ~1.8GB so adding Chromium make us reach the 2GB limit.

Notably, the 774 MB in /usr/src are questionable slightly smiling face Same for /usr/include where boost takes more than 200MB...

Harunobu Kurokawa 
November 6, 2017 at 1:45 PM

Hi

I'll ask internally the reason about "cpio". But the issue we should resolved is the reason why 2.5GB over.

Stephane Desneux 
November 6, 2017 at 1:22 PM

It seems that the cpio.gz images is added by Gen3 BSP for unknown reason:

see meta-renesas-rcar-gen3/meta-rcar-gen3/conf/machine/*.conf

Adding in watchers.

BTW, it's strange because creating an archive bigger than 2GB is not an issue. Only appending to it slightly smiling face

Jan-Simon Moeller 
November 6, 2017 at 1:13 PM

Cpio has a limit of 2G . Why is cpio.gz in at all. It is not in the default list.

Fixed

Details

Assignee

Reporter

Fix versions

Labels

Components

Priority

Created November 6, 2017 at 12:23 PM
Updated December 1, 2017 at 10:00 PM
Resolved November 6, 2017 at 8:51 PM

Flag notifications