summaryrefslogtreecommitdiffstats
path: root/meta/classes/image-vm.bbclass
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2016-08-19 22:51:12 +1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-20 16:06:03 +0100
commit27c0e2f8395e98040473df9bcc1a8a8404294f76 (patch)
treefc03556489a0ff576d2d730dd2a38116ac1ce652 /meta/classes/image-vm.bbclass
parent9cabc180166005f6619ade5e735f48e32e384f7d (diff)
downloadpoky-27c0e2f8395e98040473df9bcc1a8a8404294f76.tar.gz
image-vm.bbclass: remove old images if RM_OLD_IMAGE is enabled
[YOCTO #10164] (From OE-Core rev: 3762b42233651832c5909d7a3e873365fc0a9756) Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image-vm.bbclass')
-rw-r--r--meta/classes/image-vm.bbclass13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/classes/image-vm.bbclass b/meta/classes/image-vm.bbclass
index 72f7b4b101..bf57e2c6c5 100644
--- a/meta/classes/image-vm.bbclass
+++ b/meta/classes/image-vm.bbclass
@@ -105,8 +105,12 @@ build_boot_dd() {
105 dd if=${ROOTFS} of=$IMAGE conv=notrunc seek=$OFFSET bs=512 105 dd if=${ROOTFS} of=$IMAGE conv=notrunc seek=$OFFSET bs=512
106 106
107 cd ${DEPLOY_DIR_IMAGE} 107 cd ${DEPLOY_DIR_IMAGE}
108 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect 108
109 ln -s ${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect 109 if [ "${RM_OLD_IMAGE}" = "1" ] && [ -L ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect ]; then
110 rm -f $(readlink -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect)
111 fi
112
113 ln -sf ${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect
110} 114}
111 115
112python do_bootdirectdisk() { 116python do_bootdirectdisk() {
@@ -142,6 +146,11 @@ DISK_SIGNATURE_GENERATED := "${@generate_disk_signature()}"
142run_qemu_img (){ 146run_qemu_img (){
143 type="$1" 147 type="$1"
144 qemu-img convert -O $type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.$type 148 qemu-img convert -O $type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.$type
149
150 if [ "${RM_OLD_IMAGE}" = "1" ] && [ -L ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type ]; then
151 rm -f $(readlink -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type)
152 fi
153
145 ln -sf ${IMAGE_NAME}.$type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type 154 ln -sf ${IMAGE_NAME}.$type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type
146} 155}
147create_vmdk_image () { 156create_vmdk_image () {