summaryrefslogtreecommitdiffstats
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
parent1c869a96b2b5f17e32a218ba323cd448497decd0 (diff)
downloadopenembedded-core-contrib-05716dd7ee475ba6e4129243951cc8a661b53e46.tar.gz
openembedded-core-contrib-05716dd7ee475ba6e4129243951cc8a661b53e46.tar.bz2
openembedded-core-contrib-05716dd7ee475ba6e4129243951cc8a661b53e46.zip
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>
-rw-r--r--meta/classes/bootimg.bbclass11
-rw-r--r--meta/classes/image.bbclass9
2 files changed, 8 insertions, 12 deletions
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index ec9d0b7d52..ed9afb92f6 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -172,10 +172,6 @@ build_iso() {
fi
isohybrid $isohybrid_args ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso
-
- cd ${DEPLOY_DIR_IMAGE}
- rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
- ln -s ${IMAGE_NAME}.iso ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
}
build_fat_img() {
@@ -280,10 +276,6 @@ build_hddimg() {
fi
chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
-
- cd ${DEPLOY_DIR_IMAGE}
- rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
- ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
fi
}
@@ -294,7 +286,10 @@ python do_bootimg() {
bb.build.exec_func('build_efi_cfg', d)
bb.build.exec_func('build_hddimg', d)
bb.build.exec_func('build_iso', d)
+ bb.build.exec_func('create_symlinks', d)
}
+do_bootimg[subimages] = "hddimg iso"
+do_bootimg[imgsuffix] = "."
IMAGE_TYPEDEP_iso = "ext4"
IMAGE_TYPEDEP_hddimg = "ext4"
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 () {
d.setVarFlag('do_image_%s' % t, 'fakeroot', '1')
d.setVarFlag('do_image_%s' % t, 'prefuncs', debug + 'set_image_size')
d.setVarFlag('do_image_%s' % t, 'postfuncs', 'create_symlinks')
- d.setVarFlag('do_image_%s' % t, 'subimages', subimages)
+ d.setVarFlag('do_image_%s' % t, 'subimages', ' '.join(subimages))
d.appendVarFlag('do_image_%s' % t, 'vardeps', ' '.join(vardeps))
d.appendVarFlag('do_image_%s' % t, 'vardepsexclude', 'DATETIME')
@@ -461,15 +461,16 @@ python create_symlinks() {
link_name = d.getVar('IMAGE_LINK_NAME', True)
manifest_name = d.getVar('IMAGE_MANIFEST', True)
taskname = d.getVar("BB_CURRENTTASK", True)
- subimages = d.getVarFlag("do_" + taskname, 'subimages', False)
+ subimages = (d.getVarFlag("do_" + taskname, 'subimages', False) or "").split()
+ imgsuffix = d.getVarFlag("do_" + taskname, 'imgsuffix', True) or ".rootfs."
os.chdir(deploy_dir)
if not link_name:
return
for type in subimages:
- if os.path.exists(img_name + ".rootfs." + type):
+ if os.path.exists(img_name + imgsuffix + type):
dst = deploy_dir + "/" + link_name + "." + type
- src = img_name + ".rootfs." + type
+ src = img_name + imgsuffix + type
bb.note("Creating symlink: %s -> %s" % (dst, src))
if os.path.islink(dst):
if d.getVar('RM_OLD_IMAGE', True) == "1" and \