[gnome-continuous-yocto/gnomeostree-3.28-rocko: 1987/8267] image-vm.bbclass: remove old images if RM_OLD_IMAGE is enabled
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 1987/8267] image-vm.bbclass: remove old images if RM_OLD_IMAGE is enabled
- Date: Sat, 16 Dec 2017 22:35:51 +0000 (UTC)
commit 27c0e2f8395e98040473df9bcc1a8a8404294f76
Author: Jonathan Liu <net147 gmail com>
Date: Fri Aug 19 22:51:12 2016 +1000
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>
meta/classes/image-vm.bbclass | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/meta/classes/image-vm.bbclass b/meta/classes/image-vm.bbclass
index 72f7b4b..bf57e2c 100644
--- a/meta/classes/image-vm.bbclass
+++ b/meta/classes/image-vm.bbclass
@@ -105,8 +105,12 @@ build_boot_dd() {
dd if=${ROOTFS} of=$IMAGE conv=notrunc seek=$OFFSET bs=512
cd ${DEPLOY_DIR_IMAGE}
- rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect
- ln -s ${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect
+
+ if [ "${RM_OLD_IMAGE}" = "1" ] && [ -L ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect ]; then
+ rm -f $(readlink -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect)
+ fi
+
+ ln -sf ${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect
}
python do_bootdirectdisk() {
@@ -142,6 +146,11 @@ DISK_SIGNATURE_GENERATED := "${@generate_disk_signature()}"
run_qemu_img (){
type="$1"
qemu-img convert -O $type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect
${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.$type
+
+ if [ "${RM_OLD_IMAGE}" = "1" ] && [ -L ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type ]; then
+ rm -f $(readlink -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type)
+ fi
+
ln -sf ${IMAGE_NAME}.$type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type
}
create_vmdk_image () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]