diff options
Diffstat (limited to 'meta/classes/image_types.bbclass')
-rw-r--r-- | meta/classes/image_types.bbclass | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass index e632fd111ca..8a5346e6bd2 100644 --- a/meta/classes/image_types.bbclass +++ b/meta/classes/image_types.bbclass @@ -9,10 +9,20 @@ IMAGE_NAME_SUFFIX ??= ".rootfs" # set this value to 2048 (2MiB alignment). IMAGE_ROOTFS_ALIGNMENT ?= "1" -def image_split_type(type, allctypes): +def image_split_type(type, allctypes, d): '''Returns (basetype, set of compression types in use).''' basetype = type compressiontypes = set() + + # Abort stripping the type further if "basetype" has a matching + # IMAGE_CMD or is a masked image type. For example, if there + # was a fictional IMAGE_CMD_ext4.xz which creates a compressed + # file directly, then we should use that instead of using + # IMAGE_CMD_ext4 + CONVERSION_CMD_xz. + if d.getVar('IMAGE_CMD_' + basetype, True) or \ + basetype in d.getVar('IMAGE_TYPES_MASKED', True).split(): + return (basetype, compressiontypes) + for ctype in allctypes: if type.endswith("." + ctype): basetype = type[:-len("." + ctype)] @@ -21,7 +31,7 @@ def image_split_type(type, allctypes): if basetype != type: # New base type itself might be generated by a conversion command. - basetype, newctypes = image_split_type(basetype, allctypes) + basetype, newctypes = image_split_type(basetype, allctypes, d) compressiontypes.update(newctypes) return (basetype, compressiontypes) @@ -38,7 +48,7 @@ def image_getdepends(d): deps = [] ctypes = set(d.getVar('CONVERSIONTYPES', True).split()) for type in (d.getVar('IMAGE_FSTYPES', True) or "").split(): - basetype, compressiontypes = image_split_type(type, ctypes) + basetype, compressiontypes = image_split_type(type, ctypes, d) for ctype in compressiontypes: adddep(d.getVar("CONVERSION_DEPENDS_%s" % ctype, True), deps) for typedepends in (d.getVar("IMAGE_TYPEDEP_%s" % basetype, True) or "").split(): |