diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-03-24 12:23:10 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-03-24 12:34:04 +0000 |
commit | b94de9a24ae89b6f6cc177774722e4b0e70e0db8 (patch) | |
tree | 1a06ea75bc8ec5a6b7e6760eb2048c9c83e4911e /meta/classes | |
parent | 25a6e5f98cea5ee3f79ad0e444572997ae736e8f (diff) | |
download | poky-b94de9a24ae89b6f6cc177774722e4b0e70e0db8.tar.gz |
image.bbclass: Improve readability of the image generation code
The quoting in get_imagecmds() is hard to read. We can simplify the constuction
a little to make this easier to parse and reduce complexity slightly.
(From OE-Core rev: da5d038f955bf47155a0f217dba2f96e263bcad8)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/image.bbclass | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 2cc17e1721..2ff6a1d168 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -69,16 +69,22 @@ def get_imagecmds(d): | |||
69 | old_overrides = bb.data.getVar('OVERRIDES', d, 0) | 69 | old_overrides = bb.data.getVar('OVERRIDES', d, 0) |
70 | for type in bb.data.getVar('IMAGE_FSTYPES', d, True).split(): | 70 | for type in bb.data.getVar('IMAGE_FSTYPES', d, True).split(): |
71 | localdata = bb.data.createCopy(d) | 71 | localdata = bb.data.createCopy(d) |
72 | bb.data.setVar('OVERRIDES', '%s:%s' % (type, old_overrides), localdata) | 72 | localdata.setVar('OVERRIDES', '%s:%s' % (type, old_overrides)) |
73 | bb.data.update_data(localdata) | 73 | bb.data.update_data(localdata) |
74 | cmd = "\t#Code for image type " + type + "\n" | 74 | localdata.setVar('type', type) |
75 | cmd += "\t${IMAGE_CMD_" + type + "}\n" | 75 | cmd = localdata.getVar("IMAGE_CMD_" + type, True) |
76 | cmd += "\tcd ${DEPLOY_DIR_IMAGE}/\n" | 76 | localdata.setVar('cmd', cmd) |
77 | cmd += "\trm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}." + type + "\n" | 77 | cmds += localdata.getVar("runimagecmd", True) |
78 | cmd += "\tln -s ${IMAGE_NAME}.rootfs." + type + " ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}." + type + "\n\n" | ||
79 | cmds += bb.data.expand(cmd, localdata) | ||
80 | return cmds | 78 | return cmds |
81 | 79 | ||
80 | runimagecmd () { | ||
81 | # Image generation code for image type ${type} | ||
82 | ${cmd} | ||
83 | cd ${DEPLOY_DIR_IMAGE}/ | ||
84 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${type} | ||
85 | ln -s ${IMAGE_NAME}.rootfs.${type} ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${type} | ||
86 | } | ||
87 | |||
82 | IMAGE_POSTPROCESS_COMMAND ?= "" | 88 | IMAGE_POSTPROCESS_COMMAND ?= "" |
83 | MACHINE_POSTPROCESS_COMMAND ?= "" | 89 | MACHINE_POSTPROCESS_COMMAND ?= "" |
84 | ROOTFS_POSTPROCESS_COMMAND ?= "" | 90 | ROOTFS_POSTPROCESS_COMMAND ?= "" |