Skip to content

Commit

Permalink
pxz: Add recipe and use it for xz image type
Browse files Browse the repository at this point in the history
pxz results in significant time saving when generating xz filetypes for
images due to parallelization support

a simple test on ubuntu build host with 16 CPUs

time xz -M 50% -f -k -c -e -9 --check=crc32 CX041AEI_PROD_default_20150610000105sdy-dbg.rootfs.cpio >CX041AEI_PROD_default_20150610000105sdy-dbg.rootfs.cpio.xz

real
23m42.299s
user 23m36.947s
sys 0m5.101s

time pxz -M 50% -f -k -c -e -9 --check=crc32 CX041AEI_PROD_default_20150610000105sdy-dbg.rootfs.cpio >CX041AEI_PROD_default_20150610000105sdy-dbg.rootfs.cpio.xz

real2m59.666s
user 24m38.529s
sys 0m10.056s

Signed-off-by: Khem Raj <raj.khem@gmail.com
  • Loading branch information
kraj committed Sep 20, 2015
1 parent db3d68f commit 360ced5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions meta/classes/image_types.bbclass
Expand Up @@ -233,13 +233,13 @@ COMPRESSIONTYPES = "gz bz2 lzma xz lz4 sum"
COMPRESS_CMD_lzma = "lzma -k -f -7 ${IMAGE_NAME}.rootfs.${type}"
COMPRESS_CMD_gz = "gzip -f -9 -c ${IMAGE_NAME}.rootfs.${type} > ${IMAGE_NAME}.rootfs.${type}.gz"
COMPRESS_CMD_bz2 = "pbzip2 -f -k ${IMAGE_NAME}.rootfs.${type}"
COMPRESS_CMD_xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_THREADS} --check=${XZ_INTEGRITY_CHECK} ${IMAGE_NAME}.rootfs.${type} > ${IMAGE_NAME}.rootfs.${type}.xz"
COMPRESS_CMD_xz = "pxz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_THREADS} --check=${XZ_INTEGRITY_CHECK} ${IMAGE_NAME}.rootfs.${type} > ${IMAGE_NAME}.rootfs.${type}.xz"
COMPRESS_CMD_lz4 = "lz4c -9 -c ${IMAGE_NAME}.rootfs.${type} > ${IMAGE_NAME}.rootfs.${type}.lz4"
COMPRESS_CMD_sum = "sumtool -i ${IMAGE_NAME}.rootfs.${type} -o ${IMAGE_NAME}.rootfs.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}"
COMPRESS_DEPENDS_lzma = "xz-native"
COMPRESS_DEPENDS_gz = ""
COMPRESS_DEPENDS_bz2 = "pbzip2-native"
COMPRESS_DEPENDS_xz = "xz-native"
COMPRESS_DEPENDS_xz = "pxz-native"
COMPRESS_DEPENDS_lz4 = "lz4-native"
COMPRESS_DEPENDS_sum = "mtd-utils-native"

Expand Down
31 changes: 31 additions & 0 deletions meta/recipes-extended/pxz/pxz_git.bb
@@ -0,0 +1,31 @@
# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)

SUMMARY = "Parallel LZMA compressor compatible with XZ"
DESCRIPTION = "Parallel XZ is a compression utility that takes advantage of running LZMA compression of different parts of an input file on multiple cores and processors simultaneously. Its primary goal is to utilize all resources to speed up compression time with minimal possible influence on compression ratio"
HOMEPAGE = "https://jnovy.fedorapeople.org/pxz/"
LICENSE = "GPL-2.0+"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SECTION = "console/utils"
DEPENDS = "xz"

SRCREV = "ae808463c2950edfdedb8fb49f95006db0a18667"
PV = "4.999.9beta+git${SRCPV}"
SRC_URI = "git://github.com/jnovy/pxz.git"

S = "${WORKDIR}/git"

CFLAGS_append = " -fopenmp -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
LDFLAGS_append = " -llzma"

do_compile () {
oe_runmake -C ${S}
}

do_install () {
oe_runmake -C ${S} DESTDIR=${D} INSTALL="install -p"
}

do_configure[noexec] = "1"

BBCLASSEXTEND = "native"

0 comments on commit 360ced5

Please sign in to comment.