summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-17 11:16:45 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-19 17:24:47 +0000
commit05716dd7ee475ba6e4129243951cc8a661b53e46 (patch)
tree10b0b33fa070cd101f6ae2450bf53c94ddf5ba8e /meta/classes/image.bbclass
parent1c869a96b2b5f17e32a218ba323cd448497decd0 (diff)
downloadpoky-05716dd7ee475ba6e4129243951cc8a661b53e46.tar.gz
bootimg/image: Enhance bootimg to respect RM_OLD_IMAGE
Currently, iso and hddimg links don't respect RM_OLD_IMAGE. This updates them to use the common symlinks code so that they behave like the rest of the system. (From OE-Core rev: 6a05cb64dfafd531d50454ef7141ff0290d01ca9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass9
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index e85869da7b..58b75da76e 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -398,7 +398,7 @@ python () {
398 d.setVarFlag('do_image_%s' % t, 'fakeroot', '1') 398 d.setVarFlag('do_image_%s' % t, 'fakeroot', '1')
399 d.setVarFlag('do_image_%s' % t, 'prefuncs', debug + 'set_image_size') 399 d.setVarFlag('do_image_%s' % t, 'prefuncs', debug + 'set_image_size')
400 d.setVarFlag('do_image_%s' % t, 'postfuncs', 'create_symlinks') 400 d.setVarFlag('do_image_%s' % t, 'postfuncs', 'create_symlinks')
401 d.setVarFlag('do_image_%s' % t, 'subimages', subimages) 401 d.setVarFlag('do_image_%s' % t, 'subimages', ' '.join(subimages))
402 d.appendVarFlag('do_image_%s' % t, 'vardeps', ' '.join(vardeps)) 402 d.appendVarFlag('do_image_%s' % t, 'vardeps', ' '.join(vardeps))
403 d.appendVarFlag('do_image_%s' % t, 'vardepsexclude', 'DATETIME') 403 d.appendVarFlag('do_image_%s' % t, 'vardepsexclude', 'DATETIME')
404 404
@@ -461,15 +461,16 @@ python create_symlinks() {
461 link_name = d.getVar('IMAGE_LINK_NAME', True) 461 link_name = d.getVar('IMAGE_LINK_NAME', True)
462 manifest_name = d.getVar('IMAGE_MANIFEST', True) 462 manifest_name = d.getVar('IMAGE_MANIFEST', True)
463 taskname = d.getVar("BB_CURRENTTASK", True) 463 taskname = d.getVar("BB_CURRENTTASK", True)
464 subimages = d.getVarFlag("do_" + taskname, 'subimages', False) 464 subimages = (d.getVarFlag("do_" + taskname, 'subimages', False) or "").split()
465 imgsuffix = d.getVarFlag("do_" + taskname, 'imgsuffix', True) or ".rootfs."
465 os.chdir(deploy_dir) 466 os.chdir(deploy_dir)
466 467
467 if not link_name: 468 if not link_name:
468 return 469 return
469 for type in subimages: 470 for type in subimages:
470 if os.path.exists(img_name + ".rootfs." + type): 471 if os.path.exists(img_name + imgsuffix + type):
471 dst = deploy_dir + "/" + link_name + "." + type 472 dst = deploy_dir + "/" + link_name + "." + type
472 src = img_name + ".rootfs." + type 473 src = img_name + imgsuffix + type
473 bb.note("Creating symlink: %s -> %s" % (dst, src)) 474 bb.note("Creating symlink: %s -> %s" % (dst, src))
474 if os.path.islink(dst): 475 if os.path.islink(dst):
475 if d.getVar('RM_OLD_IMAGE', True) == "1" and \ 476 if d.getVar('RM_OLD_IMAGE', True) == "1" and \