[oe-commits] [openembedded-core] 11/30: image_types.bbclass: ignore tar exit code 1

git at git.openembedded.org git at git.openembedded.org
Sun Jul 30 07:46:59 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 402b4cffbb4c58cfee93db18192f2b218ee0ae35
Author: Ed Bartosh <ed.bartosh at linux.intel.com>
AuthorDate: Fri Jul 28 12:29:22 2017 +0300

    image_types.bbclass: ignore tar exit code 1
    
    tar exists with 1 and produces warning "file changed as we read it"
    if content is changed while tar archives it. Even hardlinking content
    causes tar to fail this way as it changes file ctime.
    
    Other tasks running in parallel with do_image_tar may need to hardlink
    rootfs content in order to change it, e.g. do_image_wic does this to
    update etc/fstab.
    
    Ignored tar exit code 1 to be able to hardlink rootfs content while
    do_rootfs_tar is tarring it.
    
    [RP: Removed bashism]
    
    Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/image_types.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index cf946a6..ae4ed4f 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -119,7 +119,8 @@ IMAGE_CMD_squashfs-lzo = "mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAM
 # In practice, it turned out to be not needed when creating archives and
 # required when extracting, but it seems prudent to use it in both cases.
 IMAGE_CMD_TAR ?= "tar"
-IMAGE_CMD_tar = "${IMAGE_CMD_TAR} -cvf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.tar -C ${IMAGE_ROOTFS} ."
+# ignore return code 1 "file changed as we read it" as other tasks(e.g. do_image_wic) may be hardlinking rootfs
+IMAGE_CMD_tar = "${IMAGE_CMD_TAR} -cf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.tar -C ${IMAGE_ROOTFS} . || [ $? -eq 1 ]"
 
 do_image_cpio[cleandirs] += "${WORKDIR}/cpio_append"
 IMAGE_CMD_cpio () {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list