Bug 5837

Summary: Image creation command failure not detected
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Jonathan Liu <net147>
Component: deploymentAssignee: Laurentiu Palcu <laurentiu.palcu>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: Undecided    
Version: 1.6   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: No (bug/feature does not impact docs)

Description Jonathan Liu 2014-02-18 04:47:21 UTC
If any of the image creation commands fail, this does not result in a bitbake error. Before the switch to the new Python rootfs/image creation routines, if any of the image creation commands fail it would result in a bitbake error.
Comment 1 Laurentiu Palcu 2014-02-18 13:54:27 UTC
If any of the image creation scripts fail (exit code other than 0), the build is halted.

Unless you provide a provide a lot more details in the bug description, I'm closing this as invalid. Feel free to re-open after you provide a procedure to reproduce, commit you tested with, etc. Thanks.
Comment 2 Jonathan Liu 2014-02-18 13:58:44 UTC
It may check the the exit code of the script fails but the exit code of the script is the exit code of the last command executed.

If a command other than the last one fails, it just continues running so I am thinking it needs something like "set -e" at the start of the script.
Comment 3 Laurentiu Palcu 2014-02-18 15:54:21 UTC
All the image creation scripts have "set -e" at the start... So, in theory, any failed pipeline/command should exit. But, I'm suspecting the trap code here which is executed in case any command fails... I'll re-open this and give it another look.
Comment 4 Laurentiu Palcu 2014-02-19 13:09:55 UTC
Hi Jonathan,

I did a test today with latest master. In oe_mkext234fs(), from image_types.bbclass, I replaced

  dd if=/dev/zero of=...
to
  dd if=/dev/nothing of=...

and did a bitbake core-image-minimal. The build failed with:

ERROR: Error: The image creation script '/ssd/work/yp2/build/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/temp/create_image.ext3' returned 1:
WARNING: /ssd/work/yp2/build/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/temp/create_image.ext3:1 exit 1 from
  dd if=/dev/nothing of=/ssd/work/yp2/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64-20140219130439.rootfs.$fstype seek=$ROOTFS_SIZE count=0 bs=1k

ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /ssd/work/yp2/build/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/temp/log.do_rootfs.7021
ERROR: Task 6 (/ssd/work/yp2/poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1401 tasks of which 1400 didn't need to be rerun and 1 failed.

The behavior is the expected one. 'dd' command is not the last in the script... So, again, I'll close this issue as INVALID. Re-open it after you provide a valid scenario to reproduce it.