[oe-commits] Khem Raj : image_types.bbclass: Fix tar IMAGE_CMD to not change directories

git at git.openembedded.org git at git.openembedded.org
Tue Feb 18 08:39:41 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: 9a98b8bfe13b94d89a9e39cca821f26fdeaeffc3
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=9a98b8bfe13b94d89a9e39cca821f26fdeaeffc3

Author: Khem Raj <raj.khem at gmail.com>
Date:   Mon Feb 17 16:33:29 2014 -0800

image_types.bbclass: Fix tar IMAGE_CMD to not change directories

below commit

commit 9d9bca8785911e8ae06d507bbfb99d6a811f072e
Author: Jonathan Liu <net147 at gmail.com>
Date:   Mon Feb 17 21:46:28 2014 +1100

    lib/oe/image.py: fix working directory

    The working directory needs to be changed before the image creation
    commands instead of afterwards.

exposed an issue when generating tar images, where it would cd into
rootfs and then create the rootfs tarball and remain there since the
cmd to cd into deploy dir moved up the immediate following cmd like
tar.bz2 or tar.gz were still looking for tarball in current directory
which esentially was not deploy dir but IMAGE_ROOTFS instead

Signed-off-by: Khem Raj <raj.khem at gmail.com>

---

 meta/classes/image_types.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 0467abd..944e6db 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -64,7 +64,7 @@ IMAGE_CMD_btrfs () {
 
 IMAGE_CMD_squashfs = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs ${EXTRA_IMAGECMD} -noappend"
 IMAGE_CMD_squashfs-xz = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs-xz ${EXTRA_IMAGECMD} -noappend -comp xz"
-IMAGE_CMD_tar = "cd ${IMAGE_ROOTFS} && tar -cvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar ."
+IMAGE_CMD_tar = "tar -cvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar -C ${IMAGE_ROOTFS} ."
 
 CPIO_TOUCH_INIT () {
 	if [ ! -L ${IMAGE_ROOTFS}/init ]



More information about the Openembedded-commits mailing list