Skip to contentSkip to conversation

image_types: use COMPRESSIONTYPES variable for backward compatibility

PATCH In review Ed Bartosh 3 participants 3 messages Aug 19, 2016

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 image_types: use COMPRESSIONTYPES variable for backward compatibility

Recent renaming of COMPRESSIONTYPES variable can break recipes that still use it. Including value of COMPRESSIONTYPES variable into CONVERSIONTYPES should prevent this.

---
 meta/classes/image_types.bbclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta/classes/image_types.bbclass +7 -1
index 4d92866..2e852af 100644
@@ -316,7 +316,13 @@ IMAGE_TYPES = " \
     wic wic.gz wic.bz2 wic.lzma \
 "
 
-CONVERSIONTYPES = "gz bz2 lzma xz lz4 zip sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap"
+# Compression is a special case of conversion. The old variable
+# names are still supported for backward-compatibility. When defining
+# new compression or conversion commands, use CONVERSIONTYPES and
+# CONVERSION_CMD/DEPENDS.
+COMPRESSIONTYPES ?= ""
+
+CONVERSIONTYPES = "gz bz2 lzma xz lz4 zip sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap ${COMPRESSIONTYPES}"
 CONVERSION_CMD_lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
 CONVERSION_CMD_gz = "gzip -f -9 -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.gz"
 CONVERSION_CMD_bz2 = "pbzip2 -f -k ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
Signature · 1 line
2.6.6
#1 lore raw
Quoted 8 lines · Ed Bartosh

Recent renaming of COMPRESSIONTYPES variable can break recipes that still use it. Including value of COMPRESSIONTYPES variable into CONVERSIONTYPES should prevent this.

---
 meta/classes/image_types.bbclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Does this actually work? Won't COMPRESSION_CMD be unset in these cases so it would just trigger further failures?

Perhaps we should just error and tell the user if COMPRESSION_TYPES is set (in sanity.bbclass?).

Cheers,

Richard

#2 lore raw

Hi,

Quoted 10 lines · Richard Purdie
Quoted 8 lines · Ed Bartosh

Recent renaming of COMPRESSIONTYPES variable can break recipes that still use it. Including value of COMPRESSIONTYPES variable into CONVERSIONTYPES should prevent this.

---
 meta/classes/image_types.bbclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Quoted 6 lines

Does this actually work? Won't COMPRESSION_CMD be unset in these cases so it would just trigger further failures?

Perhaps we should just error and tell the user if COMPRESSION_TYPES is set (in sanity.bbclass?).

These lines were simply missing
from 9d68c024790850cab72ead1e3372a5fcec4ef7b0
(the commit message talks about these lines).

In Ostro we add a few custom conversions via COMPRESSIONTYPES_append and without
this patch those types are not recognized and we hit:

"No IMAGE_CMD defined for IMAGE_FSTYPES entry 'dsk.ova' - possibly invalid type name or missing support class"

(ova is one of our COMPRESSIONTYPES).

-- Mikko