Skip to contentSkip to conversation

pbzip2: add initial recipe, pbzip2 v1.1.12

PATCH In review Andre McCurdy 2 participants 7 messages Jun 25, 2015 – Jun 27, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 pbzip2: add initial recipe, pbzip2 v1.1.12

---
 meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb
meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb new file +27 -0
new file mode 100644
index 0000000..fb70d0c
@@ -0,0 +1,27 @@
+SUMMARY = "PBZIP2 is a parallel implementation of bzip2"
+DESCRIPTION = "PBZIP2 is a parallel implementation of the bzip2 block-sorting \
+file compressor that uses pthreads and achieves near-linear speedup on SMP \
+machines. The output of this version is fully compatible with bzip2 v1.0.2 or \
+newer (ie: anything compressed with pbzip2 can be decompressed with bzip2)."
+HOMEPAGE = "http://compression.ca/pbzip2/"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4c4f2edec9679d5abef3514a816b54a4"
+
+DEPENDS = "bzip2"
+
+SRC_URI = "https://launchpad.net/${BPN}/1.1/${PV}/+download/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "91a4911b13305850423840eb0fa6f4f9"
+SRC_URI[sha256sum] = "573bb358a5a7d3bf5f42f881af324cedf960c786e8d66dd03d448ddd8a0166ee"
+
+do_configure[noexec] = "1"
+
+EXTRA_OEMAKE = "CXX='${CXX} ${CXXFLAGS}' LDFLAGS='${LDFLAGS}'"
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 pbzip2 ${D}${bindir}/
+}
+
+BBCLASSEXTEND = "native"
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/3 image_types.bbclass: use pbzip2 for images requiring bz2 compression

---
 meta/classes/image_types.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/image_types.bbclass +2 -2
index d86d108..9668bad 100644
@@ -162,13 +162,13 @@ IMAGE_TYPES = " \
 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 = "bzip2 -f -k ${IMAGE_NAME}.rootfs.${type}"
+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_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 = ""
+COMPRESS_DEPENDS_bz2 = "pbzip2-native"
 COMPRESS_DEPENDS_xz = "xz-native"
 COMPRESS_DEPENDS_lz4 = "lz4-native"
 COMPRESS_DEPENDS_sum = "mtd-utils-native"
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/3 populate_sdk_base.bbclass: use pbzip2 to compress SDK tarfiles

In reply to Andre McCurdy
---
 meta/classes/populate_sdk_base.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/classes/populate_sdk_base.bbclass +3 -3
index 781b279..a4a0193 100644
@@ -40,7 +40,7 @@ TOOLCHAIN_TARGET_TASK_ATTEMPTONLY ?= ""
 TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}"
 
 SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
-SDK_DEPENDS = "virtual/fakeroot-native"
+SDK_DEPENDS = "virtual/fakeroot-native pbzip2-native"
 
 # We want the MULTIARCH_TARGET_SYS to point to the TUNE_PKGARCH, not PACKAGE_ARCH as it
 # could be set to the MACHINE_ARCH
@@ -121,13 +121,13 @@ fakeroot create_sdk_files() {
 	sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
 }
 
-SDKTAROPTS = "--owner=root --group=root -j"
+SDKTAROPTS = "--owner=root --group=root"
 
 fakeroot tar_sdk() {
 	# Package it up
 	mkdir -p ${SDK_DEPLOY}
 	cd ${SDK_OUTPUT}/${SDKPATH}
-	tar ${SDKTAROPTS} -c --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
+	tar ${SDKTAROPTS} -cf - . | pbzip2 > ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2
 }
 
 fakeroot create_shar() {
Signature · 1 line
1.9.1
#3 lore raw
In reply to Andre McCurdy
Quoted 13 lines · Andre McCurdy
---
 meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb
meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb new file +1 -0
new file mode 100644
index 0000000..fb70d0c
@@ -0,0 +1,27 @@
+SUMMARY = "PBZIP2 is a parallel implementation of bzip2"

meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb line 11

Quoted 10 lines
meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb new file +10 -0
+DESCRIPTION = "PBZIP2 is a parallel implementation of the bzip2 block-sorting \
+file compressor that uses pthreads and achieves near-linear speedup on SMP \
+machines. The output of this version is fully compatible with bzip2 v1.0.2 or \
+newer (ie: anything compressed with pbzip2 can be decompressed with bzip2)."
+HOMEPAGE = "http://compression.ca/pbzip2/"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4c4f2edec9679d5abef3514a816b54a4"
+
+DEPENDS = "bzip2"

http://errors.yoctoproject.org/Errors/Details/12617/

probably as bzip2-native is in ASSUME_PROVIDED at a guess and the bzip2 headers weren't installed :/.

We might have to force this to build bzip2-native, the only issue with that is installing bzip2 itself into the sysroot will cause a race like we've had with tar and gzip :(. We might have to teach it to install the libs but not the binaries in the native case (and do a PROVIDES += "bzip2-replacement-native" or something so we can depend on the right thing.

Cheers,

Richard

#4 lore raw
Quoted 30 lines · Richard Purdie
Quoted 13 lines · Andre McCurdy
---
 meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb
meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb new file +1 -0
new file mode 100644
index 0000000..fb70d0c
@@ -0,0 +1,27 @@
+SUMMARY = "PBZIP2 is a parallel implementation of bzip2"

meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb line 11

Quoted 10 lines
meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb new file +10 -0
+DESCRIPTION = "PBZIP2 is a parallel implementation of the bzip2 block-sorting \
+file compressor that uses pthreads and achieves near-linear speedup on SMP \
+machines. The output of this version is fully compatible with bzip2 v1.0.2 or \
+newer (ie: anything compressed with pbzip2 can be decompressed with bzip2)."
+HOMEPAGE = "http://compression.ca/pbzip2/"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4c4f2edec9679d5abef3514a816b54a4"
+
+DEPENDS = "bzip2"

http://errors.yoctoproject.org/Errors/Details/12617/

probably as bzip2-native is in ASSUME_PROVIDED at a guess and the bzip2 headers weren't installed :/.

Quoted 6 lines

We might have to force this to build bzip2-native, the only issue with that is installing bzip2 itself into the sysroot will cause a race like we've had with tar and gzip :(. We might have to teach it to install the libs but not the binaries in the native case (and do a PROVIDES += "bzip2-replacement-native" or something so we can depend on the right thing.

Turns out we've been here before. We can fix this with:

DEPENDS_append_class-native = " bzip2-replacement-native"

I'll send out a patch.

Cheers,

Richard

#5 lore raw
Quoted 38 lines · Richard Purdie
Quoted 30 lines · Richard Purdie
Quoted 13 lines · Andre McCurdy
---
 meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb
meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb new file +1 -0
new file mode 100644
index 0000000..fb70d0c
@@ -0,0 +1,27 @@
+SUMMARY = "PBZIP2 is a parallel implementation of bzip2"

meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb line 11

Quoted 10 lines
meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb new file +10 -0
+DESCRIPTION = "PBZIP2 is a parallel implementation of the bzip2 block-sorting \
+file compressor that uses pthreads and achieves near-linear speedup on SMP \
+machines. The output of this version is fully compatible with bzip2 v1.0.2 or \
+newer (ie: anything compressed with pbzip2 can be decompressed with bzip2)."
+HOMEPAGE = "http://compression.ca/pbzip2/"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4c4f2edec9679d5abef3514a816b54a4"
+
+DEPENDS = "bzip2"

http://errors.yoctoproject.org/Errors/Details/12617/

probably as bzip2-native is in ASSUME_PROVIDED at a guess and the bzip2 headers weren't installed :/.

Quoted 6 lines

We might have to force this to build bzip2-native, the only issue with that is installing bzip2 itself into the sysroot will cause a race like we've had with tar and gzip :(. We might have to teach it to install the libs but not the binaries in the native case (and do a PROVIDES += "bzip2-replacement-native" or something so we can depend on the right thing.

Quoted 5 lines

Turns out we've been here before. We can fix this with:

DEPENDS_append_class-native = " bzip2-replacement-native"

I'll send out a patch.

Thanks.

I'm wondering why I haven't seen an issue though - no build errors here and I don't have any bzip2 headers on the host.

Quoted 5 lines

Cheers,

Richard

#6 lore raw
Quoted 42 lines · Andre McCurdy
Quoted 40 lines · Richard Purdie
Quoted 30 lines · Richard Purdie
Quoted 13 lines · Andre McCurdy
---
 meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb
meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb new file +1 -0
new file mode 100644
index 0000000..fb70d0c
@@ -0,0 +1,27 @@
+SUMMARY = "PBZIP2 is a parallel implementation of bzip2"

meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb line 11

Quoted 10 lines
meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb new file +10 -0
+DESCRIPTION = "PBZIP2 is a parallel implementation of the bzip2 block-sorting \
+file compressor that uses pthreads and achieves near-linear speedup on SMP \
+machines. The output of this version is fully compatible with bzip2 v1.0.2 or \
+newer (ie: anything compressed with pbzip2 can be decompressed with bzip2)."
+HOMEPAGE = "http://compression.ca/pbzip2/"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4c4f2edec9679d5abef3514a816b54a4"
+
+DEPENDS = "bzip2"

http://errors.yoctoproject.org/Errors/Details/12617/

probably as bzip2-native is in ASSUME_PROVIDED at a guess and the bzip2 headers weren't installed :/.

Quoted 6 lines

We might have to force this to build bzip2-native, the only issue with that is installing bzip2 itself into the sysroot will cause a race like we've had with tar and gzip :(. We might have to teach it to install the libs but not the binaries in the native case (and do a PROVIDES += "bzip2-replacement-native" or something so we can depend on the right thing.

Turns out we've been here before. We can fix this with:

Quoted 8 lines
Quoted 3 lines

DEPENDS_append_class-native = " bzip2-replacement-native"

I'll send out a patch.

Thanks.

I'm wondering why I haven't seen an issue though - no build errors here and I don't have any bzip2 headers on the host.

Something else must have built bzip2-replacement-native then and it was just luck. If you cleansstate bzip2-replacement-native and pbzip2-native, then just built the latter you should see it.

Cheers,

Richard