summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-07-29 17:58:52 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-18 09:27:53 +0100
commitff3a455ee84b91e797052760c8d4618109b54c63 (patch)
tree50314a0d569d832601d87a5a72495e82ff132b03 /meta
parent10e44fe6fb9f0676dfd4ef10f79eceac61011874 (diff)
downloadpoky-ff3a455ee84b91e797052760c8d4618109b54c63.tar.gz
image.bbclass: rename COMPRESS(ION) to CONVERSION
With the enhanced functionality, the term "compression" is no longer accurate, because the mechanism also gets used for conversion operations that do not actually compress data. It is possible to remove this naming problem in a backward-compatible manner by including COMPRESSIONTYPES in CONVERSIONTYPES and checking for the old COMPRESS_CMD/DEPENDS as fallbacks. [YOCTO #9346] (From OE-Core rev: 9d68c024790850cab72ead1e3372a5fcec4ef7b0) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/image.bbclass9
-rw-r--r--meta/classes/image_types.bbclass50
-rw-r--r--meta/classes/image_types_uboot.bbclass18
3 files changed, 39 insertions, 38 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index af789f4588..c06dee2f0c 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -118,7 +118,7 @@ def rootfs_variables(d):
118 'IMAGE_ROOTFS_MAXSIZE','IMAGE_NAME','IMAGE_LINK_NAME','IMAGE_MANIFEST','DEPLOY_DIR_IMAGE','RM_OLD_IMAGE','IMAGE_FSTYPES','IMAGE_INSTALL_COMPLEMENTARY','IMAGE_LINGUAS', 118 'IMAGE_ROOTFS_MAXSIZE','IMAGE_NAME','IMAGE_LINK_NAME','IMAGE_MANIFEST','DEPLOY_DIR_IMAGE','RM_OLD_IMAGE','IMAGE_FSTYPES','IMAGE_INSTALL_COMPLEMENTARY','IMAGE_LINGUAS',
119 'MULTILIBRE_ALLOW_REP','MULTILIB_TEMP_ROOTFS','MULTILIB_VARIANTS','MULTILIBS','ALL_MULTILIB_PACKAGE_ARCHS','MULTILIB_GLOBAL_VARIANTS','BAD_RECOMMENDATIONS','NO_RECOMMENDATIONS', 119 'MULTILIBRE_ALLOW_REP','MULTILIB_TEMP_ROOTFS','MULTILIB_VARIANTS','MULTILIBS','ALL_MULTILIB_PACKAGE_ARCHS','MULTILIB_GLOBAL_VARIANTS','BAD_RECOMMENDATIONS','NO_RECOMMENDATIONS',
120 'PACKAGE_ARCHS','PACKAGE_CLASSES','TARGET_VENDOR','TARGET_ARCH','TARGET_OS','OVERRIDES','BBEXTENDVARIANT','FEED_DEPLOYDIR_BASE_URI','INTERCEPT_DIR','USE_DEVFS', 120 'PACKAGE_ARCHS','PACKAGE_CLASSES','TARGET_VENDOR','TARGET_ARCH','TARGET_OS','OVERRIDES','BBEXTENDVARIANT','FEED_DEPLOYDIR_BASE_URI','INTERCEPT_DIR','USE_DEVFS',
121 'COMPRESSIONTYPES', 'IMAGE_GEN_DEBUGFS', 'ROOTFS_RO_UNNEEDED'] 121 'CONVERSIONTYPES', 'IMAGE_GEN_DEBUGFS', 'ROOTFS_RO_UNNEEDED']
122 variables.extend(rootfs_command_variables(d)) 122 variables.extend(rootfs_command_variables(d))
123 variables.extend(variable_depends(d)) 123 variables.extend(variable_depends(d))
124 return " ".join(variables) 124 return " ".join(variables)
@@ -343,7 +343,7 @@ python setup_debugfs () {
343 343
344python () { 344python () {
345 vardeps = set() 345 vardeps = set()
346 # We allow COMPRESSIONTYPES to have duplicates. That avoids breaking 346 # We allow CONVERSIONTYPES to have duplicates. That avoids breaking
347 # derived distros when OE-core or some other layer independently adds 347 # derived distros when OE-core or some other layer independently adds
348 # the same type. There is still only one command for each type, but 348 # the same type. There is still only one command for each type, but
349 # presumably the commands will do the same when the type is the same, 349 # presumably the commands will do the same when the type is the same,
@@ -351,7 +351,7 @@ python () {
351 # 351 #
352 # Without de-duplication, gen_conversion_cmds() below 352 # Without de-duplication, gen_conversion_cmds() below
353 # would create the same compression command multiple times. 353 # would create the same compression command multiple times.
354 ctypes = set(d.getVar('COMPRESSIONTYPES', True).split()) 354 ctypes = set(d.getVar('CONVERSIONTYPES', True).split())
355 old_overrides = d.getVar('OVERRIDES', 0) 355 old_overrides = d.getVar('OVERRIDES', 0)
356 356
357 def _image_base_type(type): 357 def _image_base_type(type):
@@ -456,9 +456,10 @@ python () {
456 # Create input image first. 456 # Create input image first.
457 gen_conversion_cmds(type) 457 gen_conversion_cmds(type)
458 localdata.setVar('type', type) 458 localdata.setVar('type', type)
459 cmd = "\t" + localdata.getVar("COMPRESS_CMD_" + ctype, True) 459 cmd = "\t" + (localdata.getVar("CONVERSION_CMD_" + ctype, True) or localdata.getVar("COMPRESS_CMD_" + ctype, True))
460 if cmd not in cmds: 460 if cmd not in cmds:
461 cmds.append(cmd) 461 cmds.append(cmd)
462 vardeps.add('CONVERSION_CMD_' + ctype)
462 vardeps.add('COMPRESS_CMD_' + ctype) 463 vardeps.add('COMPRESS_CMD_' + ctype)
463 subimage = type + "." + ctype 464 subimage = type + "." + ctype
464 if subimage not in subimages: 465 if subimage not in subimages:
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 2b97397a51..4d928667e8 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -29,7 +29,7 @@ def imagetypes_getdepends(d):
29 for typedepends in (d.getVar("IMAGE_TYPEDEP_%s" % basetype, True) or "").split(): 29 for typedepends in (d.getVar("IMAGE_TYPEDEP_%s" % basetype, True) or "").split():
30 adddep(d.getVar('IMAGE_DEPENDS_%s' % typedepends, True) , deps) 30 adddep(d.getVar('IMAGE_DEPENDS_%s' % typedepends, True) , deps)
31 for ctype in resttypes: 31 for ctype in resttypes:
32 adddep(d.getVar("COMPRESS_DEPENDS_%s" % ctype, True), deps) 32 adddep(d.getVar("CONVERSION_DEPENDS_%s" % ctype, True), deps)
33 33
34 # Sort the set so that ordering is consistant 34 # Sort the set so that ordering is consistant
35 return " ".join(sorted(deps)) 35 return " ".join(sorted(deps))
@@ -214,7 +214,7 @@ IMAGE_CMD_wic () {
214IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES" 214IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES"
215 215
216# Rebuild when the wks file or vars in WICVARS change 216# Rebuild when the wks file or vars in WICVARS change
217USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${COMPRESSIONTYPES}'.split()), '1', '', d)}" 217USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${CONVERSIONTYPES}'.split()), '1', '', d)}"
218WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}" 218WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
219do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}" 219do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
220 220
@@ -316,29 +316,29 @@ IMAGE_TYPES = " \
316 wic wic.gz wic.bz2 wic.lzma \ 316 wic wic.gz wic.bz2 wic.lzma \
317" 317"
318 318
319COMPRESSIONTYPES = "gz bz2 lzma xz lz4 zip sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap" 319CONVERSIONTYPES = "gz bz2 lzma xz lz4 zip sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap"
320COMPRESS_CMD_lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" 320CONVERSION_CMD_lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
321COMPRESS_CMD_gz = "gzip -f -9 -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.gz" 321CONVERSION_CMD_gz = "gzip -f -9 -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.gz"
322COMPRESS_CMD_bz2 = "pbzip2 -f -k ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" 322CONVERSION_CMD_bz2 = "pbzip2 -f -k ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
323COMPRESS_CMD_xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_THREADS} --check=${XZ_INTEGRITY_CHECK} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.xz" 323CONVERSION_CMD_xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_THREADS} --check=${XZ_INTEGRITY_CHECK} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.xz"
324COMPRESS_CMD_lz4 = "lz4c -9 -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4" 324CONVERSION_CMD_lz4 = "lz4c -9 -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4"
325COMPRESS_CMD_zip = "zip ${ZIP_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zip ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" 325CONVERSION_CMD_zip = "zip ${ZIP_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zip ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
326COMPRESS_CMD_sum = "sumtool -i ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}" 326CONVERSION_CMD_sum = "sumtool -i ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}"
327COMPRESS_CMD_md5sum = "md5sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.md5sum" 327CONVERSION_CMD_md5sum = "md5sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.md5sum"
328COMPRESS_CMD_sha1sum = "sha1sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha1sum" 328CONVERSION_CMD_sha1sum = "sha1sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha1sum"
329COMPRESS_CMD_sha224sum = "sha224sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha224sum" 329CONVERSION_CMD_sha224sum = "sha224sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha224sum"
330COMPRESS_CMD_sha256sum = "sha256sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha256sum" 330CONVERSION_CMD_sha256sum = "sha256sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha256sum"
331COMPRESS_CMD_sha384sum = "sha384sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha384sum" 331CONVERSION_CMD_sha384sum = "sha384sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha384sum"
332COMPRESS_CMD_sha512sum = "sha512sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha512sum" 332CONVERSION_CMD_sha512sum = "sha512sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha512sum"
333COMPRESS_CMD_bmap = "bmaptool create ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.bmap" 333CONVERSION_CMD_bmap = "bmaptool create ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.bmap"
334COMPRESS_DEPENDS_lzma = "xz-native" 334CONVERSION_DEPENDS_lzma = "xz-native"
335COMPRESS_DEPENDS_gz = "" 335CONVERSION_DEPENDS_gz = ""
336COMPRESS_DEPENDS_bz2 = "pbzip2-native" 336CONVERSION_DEPENDS_bz2 = "pbzip2-native"
337COMPRESS_DEPENDS_xz = "xz-native" 337CONVERSION_DEPENDS_xz = "xz-native"
338COMPRESS_DEPENDS_lz4 = "lz4-native" 338CONVERSION_DEPENDS_lz4 = "lz4-native"
339COMPRESS_DEPENDS_zip = "zip-native" 339CONVERSION_DEPENDS_zip = "zip-native"
340COMPRESS_DEPENDS_sum = "mtd-utils-native" 340CONVERSION_DEPENDS_sum = "mtd-utils-native"
341COMPRESS_DEPENDS_bmap = "bmap-tools-native" 341CONVERSION_DEPENDS_bmap = "bmap-tools-native"
342 342
343RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4" 343RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4"
344RUNNABLE_MACHINE_PATTERNS ?= "qemu" 344RUNNABLE_MACHINE_PATTERNS ?= "qemu"
diff --git a/meta/classes/image_types_uboot.bbclass b/meta/classes/image_types_uboot.bbclass
index 19e4aa2e47..f72d9b25ec 100644
--- a/meta/classes/image_types_uboot.bbclass
+++ b/meta/classes/image_types_uboot.bbclass
@@ -8,19 +8,19 @@ oe_mkimage () {
8 fi 8 fi
9} 9}
10 10
11COMPRESSIONTYPES += "gz.u-boot bz2.u-boot lzma.u-boot u-boot" 11CONVERSIONTYPES += "gz.u-boot bz2.u-boot lzma.u-boot u-boot"
12 12
13COMPRESS_DEPENDS_u-boot = "u-boot-mkimage-native" 13CONVERSION_DEPENDS_u-boot = "u-boot-mkimage-native"
14COMPRESS_CMD_u-boot = "oe_mkimage ${IMAGE_NAME}.rootfs.${type} none" 14CONVERSION_CMD_u-boot = "oe_mkimage ${IMAGE_NAME}.rootfs.${type} none"
15 15
16COMPRESS_DEPENDS_gz.u-boot = "u-boot-mkimage-native" 16CONVERSION_DEPENDS_gz.u-boot = "u-boot-mkimage-native"
17COMPRESS_CMD_gz.u-boot = "${COMPRESS_CMD_gz}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.gz gzip clean" 17CONVERSION_CMD_gz.u-boot = "${CONVERSION_CMD_gz}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.gz gzip clean"
18 18
19COMPRESS_DEPENDS_bz2.u-boot = "u-boot-mkimage-native" 19CONVERSION_DEPENDS_bz2.u-boot = "u-boot-mkimage-native"
20COMPRESS_CMD_bz2.u-boot = "${COMPRESS_CMD_bz2}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.bz2 bzip2 clean" 20CONVERSION_CMD_bz2.u-boot = "${CONVERSION_CMD_bz2}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.bz2 bzip2 clean"
21 21
22COMPRESS_DEPENDS_lzma.u-boot = "u-boot-mkimage-native" 22CONVERSION_DEPENDS_lzma.u-boot = "u-boot-mkimage-native"
23COMPRESS_CMD_lzma.u-boot = "${COMPRESS_CMD_lzma}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.lzma lzma clean" 23CONVERSION_CMD_lzma.u-boot = "${CONVERSION_CMD_lzma}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.lzma lzma clean"
24 24
25IMAGE_TYPES += "ext2.u-boot ext2.gz.u-boot ext2.bz2.u-boot ext2.lzma.u-boot ext3.gz.u-boot ext4.gz.u-boot cpio.gz.u-boot" 25IMAGE_TYPES += "ext2.u-boot ext2.gz.u-boot ext2.bz2.u-boot ext2.lzma.u-boot ext3.gz.u-boot ext4.gz.u-boot cpio.gz.u-boot"
26 26