image.bbclass: don't emit redundant IMAGE_CMD_xxx functions
PATCH 1/1 image.bbclass: don't emit redundant IMAGE_CMD_xxx functions
IMAGE_CMD_xxx commands are always inlined within do_image_xxx.
When IMAGE_CMD_xxx is defined as a function (e.g. IMAGE_CMD_btrfs, IMAGE_CMD_cpio, etc), a redundant copy of the function will be emitted by default. Remove IMAGE_CMD_xxx 'func' flags to prevent that.
Signed-off-by Andre McCurdy <[email protected]>
---
This has been tested and seems to work as expected, however I'm not 100% sure I fully understand the implications of localdata -vs- d or realt -vs- t in this code, so please review before merging.
meta/classes/image.bbclass | 4 ++++ 1 file changed, 4 insertions(+)
meta/classes/image.bbclass +4 -0
@@ -388,6 +388,10 @@ python () { bb.fatal("No IMAGE_CMD defined for IMAGE_FSTYPES entry '%s' - possibly invalid type name or missing support class" % t) cmds.append(localdata.expand("\tcd ${DEPLOY_DIR_IMAGE}")) + # Since a copy of IMAGE_CMD_xxx will be inlined within do_image_xxx, + # prevent a redundant copy of IMAGE_CMD_xxx being emitted as a function. + d.delVarFlag('IMAGE_CMD_' + realt, 'func') + rm_tmp_images = set() def gen_conversion_cmds(bt): for ctype in ctypes:
Signature · 1 line
1.9.1