summaryrefslogtreecommitdiff
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-03-24 14:26:31 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-03-24 14:26:34 +0000
commita5c403f0fc71f38c0669691da7f637303ea09a27 (patch)
tree4e761824cf91b66fd1d75065ed93516f94130224 /meta/classes/image.bbclass
parentf61df1f1e4a191ed3dd3d71aa78a479c615b14d1 (diff)
downloadopenembedded-core-a5c403f0fc71f38c0669691da7f637303ea09a27.tar.gz
openembedded-core-a5c403f0fc71f38c0669691da7f637303ea09a27.tar.bz2
openembedded-core-a5c403f0fc71f38c0669691da7f637303ea09a27.zip
bitbake.conf/image.bbclass: Move image type information into image_types.bbclass
Image generation code in .conf files is hard to read as it needs to be single line. By moving this to a separate class, multiline functions can be used instead improving readability. It also declutters bitbake.conf. There is no real functional change with this patch but it highlights the need for improvements in places such as the IMAGE_EXTRA_OPTION ext* specific variable which makes no sense. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass22
1 files changed, 1 insertions, 21 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index eb0d970a2c..aa842c78ca 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -64,27 +64,7 @@ def get_devtable_list(d):
str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable)
return str
-def get_imagecmds(d):
- cmds = "\n"
- old_overrides = bb.data.getVar('OVERRIDES', d, 0)
- for type in bb.data.getVar('IMAGE_FSTYPES', d, True).split():
- localdata = bb.data.createCopy(d)
- localdata.setVar('OVERRIDES', '%s:%s' % (type, old_overrides))
- bb.data.update_data(localdata)
- localdata.setVar('type', type)
- cmd = localdata.getVar("IMAGE_CMD_" + type, True)
- localdata.setVar('cmd', cmd)
- cmds += localdata.getVar("runimagecmd", True)
- return cmds
-
-runimagecmd () {
- # Image generation code for image type ${type}
- ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = $1 * ${IMAGE_OVERHEAD_FACTOR}; print (size > ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'`
- ${cmd}
- cd ${DEPLOY_DIR_IMAGE}/
- rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${type}
- ln -s ${IMAGE_NAME}.rootfs.${type} ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${type}
-}
+inherit image_types
IMAGE_POSTPROCESS_COMMAND ?= ""
MACHINE_POSTPROCESS_COMMAND ?= ""