aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/image.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
index a03b73e4c0..c9b9033132 100644
--- a/meta/lib/oe/image.py
+++ b/meta/lib/oe/image.py
@@ -192,7 +192,8 @@ class Image(ImageDepGraph):
if img.find(self.d.getVar('IMAGE_LINK_NAME', True)) == 0:
img = os.path.join(deploy_dir, img)
if os.path.islink(img):
- if self.d.getVar('RM_OLD_IMAGE', True) == "1":
+ if self.d.getVar('RM_OLD_IMAGE', True) == "1" and \
+ os.path.exists(os.path.realpath(img)):
os.remove(os.path.realpath(img))
os.remove(img)