summaryrefslogtreecommitdiffstats
path: root/meta/classes/image_types.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-29 16:24:26 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-29 18:25:03 +0000
commit40b81c778bb8361d115c394ab110579a4b906ac3 (patch)
tree10baa4acfc94a3d79e91b8f090e9cbebbfd78f92 /meta/classes/image_types.bbclass
parent320558f494c618f53e0c773db3ea0109476e8359 (diff)
downloadpoky-40b81c778bb8361d115c394ab110579a4b906ac3.tar.gz
image_types: Correctness fixes
* Add a newline to improve the output formatting * Use set() to turn the list into a set of unique items to prevnt the same image code running twice (for e.g. IMAGE_FSTYPES = "tar.gz tar.bz2") * Support multiple compression extensions such as ".gz.u-boot" * Fix basetype/type typo and fix multiple image generation (From OE-Core rev: eacedb4f2afa98dbd2f5ea7a9f52e6ea952a72d2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image_types.bbclass')
-rw-r--r--meta/classes/image_types.bbclass9
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index a5f09fef42..5b48a09da4 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -11,11 +11,12 @@ def get_imagecmds(d):
11 for type in types: 11 for type in types:
12 for ctype in ctypes: 12 for ctype in ctypes:
13 if type.endswith("." + ctype): 13 if type.endswith("." + ctype):
14 basetype = type.rsplit(".", 1)[0] 14 basetype = type[:-len("." + ctype)]
15 types[types.index(type)] = basetype 15 types[types.index(type)] = basetype
16 if type not in cimages: 16 if basetype not in cimages:
17 cimages[basetype] = [] 17 cimages[basetype] = []
18 cimages[basetype].append(ctype) 18 cimages[basetype].append(ctype)
19 break
19 20
20 # Live images will be processed via inheriting bbclass and 21 # Live images will be processed via inheriting bbclass and
21 # does not get processed here. 22 # does not get processed here.
@@ -28,7 +29,7 @@ def get_imagecmds(d):
28 if d.getVar('IMAGE_LINK_NAME', True): 29 if d.getVar('IMAGE_LINK_NAME', True):
29 cmds += " rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.*" 30 cmds += " rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.*"
30 31
31 for type in types: 32 for type in set(types):
32 ccmd = [] 33 ccmd = []
33 subimages = [] 34 subimages = []
34 localdata = bb.data.createCopy(d) 35 localdata = bb.data.createCopy(d)
@@ -47,7 +48,7 @@ def get_imagecmds(d):
47 localdata.setVar('subimages', " ".join(subimages)) 48 localdata.setVar('subimages', " ".join(subimages))
48 cmd = localdata.getVar("IMAGE_CMD", True) 49 cmd = localdata.getVar("IMAGE_CMD", True)
49 localdata.setVar('cmd', cmd) 50 localdata.setVar('cmd', cmd)
50 cmds += localdata.getVar("runimagecmd", True) 51 cmds += "\n" + localdata.getVar("runimagecmd", True)
51 return cmds 52 return cmds
52 53
53runimagecmd () { 54runimagecmd () {