summaryrefslogtreecommitdiffstats
path: root/meta/classes/image_types.bbclass
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2013-05-07 06:09:31 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-21 00:18:42 +0100
commit0948a237ddfcd92dcc4a21e238a963568161f12d (patch)
tree4bbf53710fee7a0217e5a565879058d5b90acdd0 /meta/classes/image_types.bbclass
parent995c196f98bf3a85e73f4981cfeeacfb5b84330e (diff)
downloadpoky-0948a237ddfcd92dcc4a21e238a963568161f12d.tar.gz
image_types.bbclass: remove the old images
Remove the old image before the new one generated to save disk space when RM_OLD_IMAGE is set to 1, this is an easy way to keep the DEPLOY_DIR_IMAGE clean. [YOCTO #4391] (From OE-Core rev: b3e2e405c53d63bc71872d41f455507be833e7eb) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image_types.bbclass')
-rw-r--r--meta/classes/image_types.bbclass6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 94837ae0a8..38647cfbc7 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -51,7 +51,11 @@ def get_imagecmds(d):
51 types.remove("live") 51 types.remove("live")
52 52
53 if d.getVar('IMAGE_LINK_NAME', True): 53 if d.getVar('IMAGE_LINK_NAME', True):
54 cmds += "\trm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.*" 54 if d.getVar('RM_OLD_IMAGE', True) == "1":
55 # Remove the old image
56 cmds += "\trm -f `find ${DEPLOY_DIR_IMAGE} -maxdepth 1 -type l -name ${IMAGE_LINK_NAME}'.*' -exec readlink -f {} \;`"
57 # Remove the symlink
58 cmds += "\n\trm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.*"
55 59
56 for type in types: 60 for type in types:
57 ccmd = [] 61 ccmd = []