Skip to contentSkip to conversation

Patch: package_rpm.bbclass: set algorithm and level of compression

PATCH Kévin THIERRY 1 participant 1 message Oct 10, 2014

lore
Share & tools
lore
#0 lore raw

Hi,

I made a small patch to globally modify algorithm and level of compression for rpm packaging. Being able to modify those parameters allows to either reduce the rpm packages creation time or reduce the rpm packages size (0001-package_rpm.bbclass-set-algorithm-and-level-of-compr.patch).

I also made a patchfor yocto-docs to document the two new variables (0001-ref-manual-Add-RPM_BIN_PAYLOAD-RPM_SRC_PAYLOAD-varia.patch).

If something is wrong/missing, I'll be happy to make the necessary changes.

Best regards,
Kevin THIERRY

From 8e32ab1a381e3a31c81369c226cce40d37b119c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20THIERRY?= <[email protected]>
Date: Thu, 9 Oct 2014 17:17:20 +0200
Subject: [PATCH] package_rpm.bbclass: set algorithm and level of compression
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add the possibility to chose the algorithm and level of compression to be used by rpmbuid to create the RPM packages. Such an option is useful to either reduce RPM packages creation time or reduce RPM packages size.

Usage:
RPM_BIN_PAYLOAD = "w9.gzdio"

---
 meta/classes/package_rpm.bbclass | 6 ++++++
 1 file changed, 6 insertions(+)
meta/classes/package_rpm.bbclass +6 -0
index 92ddf7a..18fd979 100644
@@ -676,6 +676,8 @@ python do_package_rpm () {
     targetvendor = d.getVar('HOST_VENDOR', True)
     package_arch = (d.getVar('PACKAGE_ARCH', True) or "").replace("-", "_")
     sdkpkgsuffix = (d.getVar('SDKPKGSUFFIX', True) or "nativesdk").replace("-", "_")
+    src_payload = d.getVar('RPM_SRC_PAYLOAD', True)
+    bin_payload = d.getVar('RPM_BIN_PAYLOAD', True)
     if package_arch not in "all any noarch".split() and not package_arch.endswith(sdkpkgsuffix):
         ml_prefix = (d.getVar('MLPREFIX', True) or "").replace("-", "_")
         d.setVar('PACKAGE_ARCH_EXTEND', ml_prefix + package_arch)
@@ -703,6 +705,10 @@ python do_package_rpm () {
     cmd = cmd + " --define 'debug_package %{nil}'"
     cmd = cmd + " --define '_rpmfc_magic_path " + magicfile + "'"
     cmd = cmd + " --define '_tmppath " + workdir + "'"
+    if src_payload:
+        cmd = cmd + " --define '_source_payload " + src_payload + "'"
+    if bin_payload:
+        cmd = cmd + " --define '_binary_payload " + bin_payload + "'"
     if d.getVarFlag('ARCHIVER_MODE', 'srpm', True) == '1' and bb.data.inherits_class('archiver', d):
         cmd = cmd + " --define '_sourcedir " + d.getVar('ARCHIVER_OUTDIR', True) + "'"
         cmdsrpm = cmd + " --define '_srcrpmdir " + d.getVar('ARCHIVER_OUTDIR', True) + "'"
Signature · 1 line
1.8.1.4

From c28a483a3ca30ed0d1ab0b702908137806318558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20THIERRY?= <[email protected]>
Date: Thu, 9 Oct 2014 17:09:09 +0200
Subject: [PATCH] ref-manual: Add RPM_BIN_PAYLOAD, RPM_SRC_PAYLOAD variables
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 documentation/ref-manual/ref-variables.xml | 45 ++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
documentation/ref-manual/ref-variables.xml +45 -0

51 lines not on this page · raw message

Signature · 1 line
1.8.1.4