summaryrefslogtreecommitdiffstats
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-25 16:34:23 +0000
commited41be01dce170e4e8f9532f4aaa635204278dd7 (patch)
tree71d9884afefd1c0a3ca101737d9821d5b88f7922 /meta/classes/image.bbclass
parentf8539239bc473279cc475b07c22e1e96514c6d2f (diff)
downloadpoky-ed41be01dce170e4e8f9532f4aaa635204278dd7.tar.gz
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. (From OE-Core rev: a5c403f0fc71f38c0669691da7f637303ea09a27) 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):
64 str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable) 64 str += " %s" % bb.which(bb.data.getVar('BBPATH', d, 1), devtable)
65 return str 65 return str
66 66
67def get_imagecmds(d): 67inherit image_types
68 cmds = "\n"
69 old_overrides = bb.data.getVar('OVERRIDES', d, 0)
70 for type in bb.data.getVar('IMAGE_FSTYPES', d, True).split():
71 localdata = bb.data.createCopy(d)
72 localdata.setVar('OVERRIDES', '%s:%s' % (type, old_overrides))
73 bb.data.update_data(localdata)
74 localdata.setVar('type', type)
75 cmd = localdata.getVar("IMAGE_CMD_" + type, True)
76 localdata.setVar('cmd', cmd)
77 cmds += localdata.getVar("runimagecmd", True)
78 return cmds
79
80runimagecmd () {
81 # Image generation code for image type ${type}
82 ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = $1 * ${IMAGE_OVERHEAD_FACTOR}; print (size > ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'`
83 ${cmd}
84 cd ${DEPLOY_DIR_IMAGE}/
85 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${type}
86 ln -s ${IMAGE_NAME}.rootfs.${type} ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${type}
87}
88 68
89IMAGE_POSTPROCESS_COMMAND ?= "" 69IMAGE_POSTPROCESS_COMMAND ?= ""
90MACHINE_POSTPROCESS_COMMAND ?= "" 70MACHINE_POSTPROCESS_COMMAND ?= ""