Skip to contentSkip to conversation

zstd: move recipe to oe-core from meta-oe

PATCH Superseded Stefan Agner 5 participants 10 messages Nov 8, 2019 – Nov 20, 2019 Zstd

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 zstd: move recipe to oe-core from meta-oe

From: Stefan Agner <[email protected]>

Zstd is a very fast compression algorithm and has gained quite some popularity recently. An upcoming patch allows to compress rootfs using Zstd. Moving Zstd to oe-core allows this new conversion formats to be automatically tested by the oe-selftest imagefeatures.ImageFeatures.test_image_fstypes test.

Furthermore there are three packages in oe-core which allow to enable Zstd support through packageconfig currently.

---
 meta/recipes-extended/zstd/zstd_1.4.4.bb | 35 ++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 meta/recipes-extended/zstd/zstd_1.4.4.bb
meta/recipes-extended/zstd/zstd_1.4.4.bb new file +35 -0
new file mode 100644
index 0000000000..eb201f4139
@@ -0,0 +1,35 @@
+SUMMARY = "Zstandard - Fast real-time compression algorithm"
+DESCRIPTION = "Zstandard is a fast lossless compression algorithm, targeting \
+real-time compression scenarios at zlib-level and better compression ratios. \
+It's backed by a very fast entropy stage, provided by Huff0 and FSE library."
+HOMEPAGE = "http://www.zstd.net/"
+SECTION = "console/utils"
+
+LICENSE = "BSD-3-Clause & GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c7f0b161edbe52f5f345a3d1311d0b32 \
+                    file://COPYING;md5=39bba7d2cf0ba1036f2a6e2be52fe3f0"
+
+SRC_URI = "git://github.com/facebook/zstd.git;nobranch=1"
+
+SRCREV = "10f0e6993f9d2f682da6d04aa2385b7d53cbb4ee"
+UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
+
+S = "${WORKDIR}/git"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lz4] = "HAVE_LZ4=1,HAVE_LZ4=0,lz4"
+PACKAGECONFIG[lzma] = "HAVE_LZMA=1,HAVE_LZMA=0,xz"
+PACKAGECONFIG[zlib] = "HAVE_ZLIB=1,HAVE_ZLIB=0,zlib"
+
+# See programs/README.md for how to use this
+ZSTD_LEGACY_SUPPORT ??= "4"
+
+do_compile () {
+    oe_runmake ${PACKAGECONFIG_CONFARGS} ZSTD_LEGACY_SUPPORT=${ZSTD_LEGACY_SUPPORT}
+}
+
+do_install () {
+    oe_runmake install 'DESTDIR=${D}'
+}
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 2/2 image_types: add Zstandard conversion support

From: Stefan Agner <[email protected]>

Add Zstandard (or just Zstd) compression support. This allows to create Zstd compressed tarballs by using tar.zst as IMAGE_FSTYPES.

---
 meta/classes/image_types.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
meta/classes/image_types.bbclass +6 -2
index 2eeffbb366..d29b9c5787 100644
@@ -59,6 +59,8 @@ XZ_INTEGRITY_CHECK ?= "crc32"
 
 ZIP_COMPRESSION_LEVEL ?= "-9"
 
+ZSTD_COMPRESSION_LEVEL ?= "-3"
+
 JFFS2_SUM_EXTRA_ARGS ?= ""
 IMAGE_CMD_jffs2 = "mkfs.jffs2 --root=${IMAGE_ROOTFS} --faketime --output=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.jffs2 ${EXTRA_IMAGECMD}"
 
@@ -269,7 +271,7 @@ IMAGE_TYPES = " \
     hddimg \
     squashfs squashfs-xz squashfs-lzo squashfs-lz4 \
     ubi ubifs multiubi \
-    tar tar.gz tar.bz2 tar.xz tar.lz4 \
+    tar tar.gz tar.bz2 tar.xz tar.lz4 tar.zst \
     cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \
     wic wic.gz wic.bz2 wic.lzma \
     container \
@@ -282,7 +284,7 @@ IMAGE_TYPES = " \
 # CONVERSION_CMD/DEPENDS.
 COMPRESSIONTYPES ?= ""
 
-CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap u-boot vmdk vdi qcow2 base64 ${COMPRESSIONTYPES}"
+CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip zst sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap u-boot vmdk vdi qcow2 base64 ${COMPRESSIONTYPES}"
 CONVERSION_CMD_lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
 CONVERSION_CMD_gz = "gzip -f -9 -n -c --rsyncable ${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}"
@@ -290,6 +292,7 @@ CONVERSION_CMD_xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_DEFAULTS} --check=
 CONVERSION_CMD_lz4 = "lz4 -9 -z -l ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4"
 CONVERSION_CMD_lzo = "lzop -9 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
 CONVERSION_CMD_zip = "zip ${ZIP_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zip ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
+CONVERSION_CMD_zst = "zstd -f -k -c ${ZSTD_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zst"
 CONVERSION_CMD_sum = "sumtool -i ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}"
 CONVERSION_CMD_md5sum = "md5sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.md5sum"
 CONVERSION_CMD_sha1sum = "sha1sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha1sum"
@@ -310,6 +313,7 @@ CONVERSION_DEPENDS_xz = "xz-native"
 CONVERSION_DEPENDS_lz4 = "lz4-native"
 CONVERSION_DEPENDS_lzo = "lzop-native"
 CONVERSION_DEPENDS_zip = "zip-native"
+CONVERSION_DEPENDS_zst = "zstd-native"
 CONVERSION_DEPENDS_sum = "mtd-utils-native"
 CONVERSION_DEPENDS_bmap = "bmap-tools-native"
 CONVERSION_DEPENDS_u-boot = "u-boot-tools-native"
Signature · 1 line
2.17.1
#2 lore raw
In reply to Stefan Agner
Quoted 10 lines · Stefan Agner

From: Stefan Agner <[email protected]>

Zstd is a very fast compression algorithm and has gained quite some popularity recently. An upcoming patch allows to compress rootfs using Zstd. Moving Zstd to oe-core allows this new conversion formats to be automatically tested by the oe-selftest imagefeatures.ImageFeatures.test_image_fstypes test.

Furthermore there are three packages in oe-core which allow to enable Zstd support through packageconfig currently.

Any update/thoughts on this?

--
Stefan

Quoted 50 lines
---
 meta/recipes-extended/zstd/zstd_1.4.4.bb | 35 ++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 meta/recipes-extended/zstd/zstd_1.4.4.bb
meta/recipes-extended/zstd/zstd_1.4.4.bb new file +28 -0
new file mode 100644
index 0000000000..eb201f4139
@@ -0,0 +1,35 @@
+SUMMARY = "Zstandard - Fast real-time compression algorithm"
+DESCRIPTION = "Zstandard is a fast lossless compression algorithm, targeting \
+real-time compression scenarios at zlib-level and better compression ratios. \
+It's backed by a very fast entropy stage, provided by Huff0 and FSE library."
+HOMEPAGE = "http://www.zstd.net/"
+SECTION = "console/utils"
+
+LICENSE = "BSD-3-Clause & GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c7f0b161edbe52f5f345a3d1311d0b32 \
+                    file://COPYING;md5=39bba7d2cf0ba1036f2a6e2be52fe3f0"
+
+SRC_URI = "git://github.com/facebook/zstd.git;nobranch=1"
+
+SRCREV = "10f0e6993f9d2f682da6d04aa2385b7d53cbb4ee"
+UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
+
+S = "${WORKDIR}/git"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lz4] = "HAVE_LZ4=1,HAVE_LZ4=0,lz4"
+PACKAGECONFIG[lzma] = "HAVE_LZMA=1,HAVE_LZMA=0,xz"
+PACKAGECONFIG[zlib] = "HAVE_ZLIB=1,HAVE_ZLIB=0,zlib"
+
+# See programs/README.md for how to use this
+ZSTD_LEGACY_SUPPORT ??= "4"
+
+do_compile () {
+    oe_runmake ${PACKAGECONFIG_CONFARGS}

ZSTD_LEGACY_SUPPORT=${ZSTD_LEGACY_SUPPORT}

meta/recipes-extended/zstd/zstd_1.4.4.bb new file +7 -0
+}
+
+do_install () {
+    oe_runmake install 'DESTDIR=${D}'
+}
+
+BBCLASSEXTEND = "native nativesdk"
#3 lore raw
Quoted 10 lines · Stefan Agner
Quoted 9 lines · Stefan Agner

From: Stefan Agner <[email protected]>

Zstd is a very fast compression algorithm and has gained quite some popularity recently. An upcoming patch allows to compress rootfs using Zstd. Moving Zstd to oe-core allows this new conversion formats
to be automatically tested by the oe-selftest imagefeatures.ImageFeatures.test_image_fstypes test.

Quoted 5 lines
Quoted 3 lines

Furthermore there are three packages in oe-core which allow to enable
Zstd support through packageconfig currently.

Any update/thoughts on this?

I've not made a final decision on whether to merge it fails selftests due to a lack of a maintainer:

2019-11-16 20:13:49,922 - oe-selftest - INFO - distrodata.Distrodata.test_maintainers (subunit.RemotedTestCase)
2019-11-16 20:13:49,922 - oe-selftest - INFO -  ... FAIL
2019-11-16 20:13:49,923 - oe-selftest - INFO - 2: 29/40 153/378 (109.44s) (distrodata.Distrodata.test_maintainers)
2019-11-16 20:13:49,923 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/selftest/cases/distrodata.py", line 84, in test_maintainers
    """ + "\n".join(['%s (%s)' % i for i in no_maintainer_list]))
  File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
    raise self.failureException(msg)

AssertionError:
The following recipes do not have a maintainer assigned to them. Please add an entry to meta/conf/distro/include/maintainers.inc file. zstd (/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/recipes-extended/zstd/zstd_1.4.4.bb)

To reproduce, run: "oe-selftest -r distrodata.Distrodata.test_maintainers"

Cheers,

Richard

#4 lore raw
Quoted 11 lines · Richard Purdie
Quoted 10 lines · Stefan Agner
Quoted 9 lines · Stefan Agner

From: Stefan Agner <[email protected]>

Zstd is a very fast compression algorithm and has gained quite some popularity recently. An upcoming patch allows to compress rootfs using Zstd. Moving Zstd to oe-core allows this new conversion formats
to be automatically tested by the oe-selftest imagefeatures.ImageFeatures.test_image_fstypes test.

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

Furthermore there are three packages in oe-core which allow to enable
Zstd support through packageconfig currently.

Any update/thoughts on this?

I've not made a final decision on whether to merge it fails selftests due to a lack of a maintainer:

Does a possible Poky LTS have any factor in deciding to add more packages to core?

- armin

Quoted 20 lines
2019-11-16 20:13:49,922 - oe-selftest - INFO - distrodata.Distrodata.test_maintainers (subunit.RemotedTestCase)
2019-11-16 20:13:49,922 - oe-selftest - INFO -  ... FAIL
2019-11-16 20:13:49,923 - oe-selftest - INFO - 2: 29/40 153/378 (109.44s) (distrodata.Distrodata.test_maintainers)
2019-11-16 20:13:49,923 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/selftest/cases/distrodata.py", line 84, in test_maintainers
    """ + "\n".join(['%s (%s)' % i for i in no_maintainer_list]))
  File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
    raise self.failureException(msg)

AssertionError:
The following recipes do not have a maintainer assigned to them. Please add an entry to meta/conf/distro/include/maintainers.inc file. zstd (/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/recipes-extended/zstd/zstd_1.4.4.bb)

To reproduce, run: "oe-selftest -r distrodata.Distrodata.test_maintainers"

Cheers,

Richard

#5 lore raw
Quoted 2 lines · On 18/11/2019 16:47, akuster808 wrote:

Does a possible Poky LTS have any factor in deciding to add more packages to core?

Even without the LTS there's a (relatively) long-term commitment to maintain recipes.

Personally, I'm happy with Zstd being in meta-oe for now, and possibly re-evaluating in the next cycle.

Ross

#6 lore raw
Quoted 9 lines · Ross Burton
Quoted 2 lines · On 18/11/2019 16:47, akuster808 wrote:

Does a possible Poky LTS have any factor in deciding to add more packages to core?

Even without the LTS there's a (relatively) long-term commitment to maintain recipes.

Personally, I'm happy with Zstd being in meta-oe for now, and possibly re-evaluating in the next cycle.

Not having it in oe-core would mean we would have to exclude it from build testing [1].

From what I can tell, that would be a first: Every other compression conversion is part of oe-core.

It had quite some adoption lately, e.g. Fedora 31 uses zstd by default to compress their rpm packages [2].

IMHO, this are good arguments for adding it to oe-core now.

[1]
http://lists.openembedded.org/pipermail/openembedded-core/2019-November/288882.html
[2]
https://fedoraproject.org/wiki/Changes/Switch_RPMs_to_zstd_compression

--
Stefan

#7 lore raw
In reply to Richard Purdie

[adding Alex, he maintained the recipe in meta-oe so far]

Quoted 11 lines · Richard Purdie
Quoted 10 lines · Stefan Agner
Quoted 9 lines · Stefan Agner

From: Stefan Agner <[email protected]>

Zstd is a very fast compression algorithm and has gained quite some popularity recently. An upcoming patch allows to compress rootfs using Zstd. Moving Zstd to oe-core allows this new conversion formats
to be automatically tested by the oe-selftest imagefeatures.ImageFeatures.test_image_fstypes test.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Furthermore there are three packages in oe-core which allow to enable
Zstd support through packageconfig currently.

Any update/thoughts on this?

I've not made a final decision on whether to merge it fails selftests due to a lack of a maintainer:

Alex, would you be OK with you listed as maintainer?

--
Stefan

Quoted 26 lines
2019-11-16 20:13:49,922 - oe-selftest - INFO -
distrodata.Distrodata.test_maintainers (subunit.RemotedTestCase)
2019-11-16 20:13:49,922 - oe-selftest - INFO -  ... FAIL
2019-11-16 20:13:49,923 - oe-selftest - INFO - 2: 29/40 153/378
(109.44s) (distrodata.Distrodata.test_maintainers)
2019-11-16 20:13:49,923 - oe-selftest - INFO -

testtools.testresult.real._StringException: Traceback (most recent
call last):
File
"/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/selftest/cases/distrodata.py", line 84, in test_maintainers

    """ + "\n".join(['%s (%s)' % i for i in no_maintainer_list]))

File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
raise self.failureException(msg)
AssertionError:
The following recipes do not have a maintainer assigned to them.
Please add an entry to meta/conf/distro/include/maintainers.inc file.
zstd (/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/recipes-extended/zstd/zstd_1.4.4.bb)

To reproduce, run: "oe-selftest -r distrodata.Distrodata.test_maintainers"

Cheers,

Richard

#8 lore raw
Quoted 19 lines · Stefan Agner

[adding Alex, he maintained the recipe in meta-oe so far]

Quoted 15 lines · Richard Purdie
Quoted 14 lines · Stefan Agner
Quoted 12 lines · Stefan Agner

From: Stefan Agner <[email protected]>

Zstd is a very fast compression algorithm and has gained quite some popularity recently. An upcoming patch allows to compress rootfs using Zstd. Moving Zstd to oe-core allows this new conversion formats
to be automatically tested by the oe-selftest imagefeatures.ImageFeatures.test_image_fstypes test.

Furthermore there are three packages in oe-core which allow to enable
Zstd support through packageconfig currently.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Any update/thoughts on this?

I've not made a final decision on whether to merge it fails selftests due to a lack of a maintainer:

Alex, would you be OK with you listed as maintainer?

I'm fine with that - it's very low overhead.

Signature · 1 line
Alex Kiernan
#9 lore raw
Quoted 22 lines · Alex Kiernan
Quoted 21 lines · Stefan Agner

[adding Alex, he maintained the recipe in meta-oe so far]

Quoted 17 lines · Richard Purdie
Quoted 15 lines · Stefan Agner
Quoted 9 lines · Stefan Agner

From: Stefan Agner <[email protected]>

Zstd is a very fast compression algorithm and has gained quite some popularity recently. An upcoming patch allows to compress rootfs using Zstd. Moving Zstd to oe-core allows this new conversion formats
to be automatically tested by the oe-selftest imagefeatures.ImageFeatures.test_image_fstypes test.

Quoted 3 lines

Furthermore there are three packages in oe-core which allow to enable
Zstd support through packageconfig currently.

Any update/thoughts on this?

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I've not made a final decision on whether to merge it fails selftests due to a lack of a maintainer:

Alex, would you be OK with you listed as maintainer?

I'm fine with that - it's very low overhead.

Thanks Alex, will send a v4 with you as maintainer.

--
Stefan