diff options
author | Niko Mauno <niko.mauno@vaisala.com> | 2023-10-21 15:51:14 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-26 15:29:35 +0100 |
commit | 849d29c8553711ed4619b60dd6ffc5020a98c8ce (patch) | |
tree | 8bb64af416ece37f9fa8fccf9c5428fc2d976d5b | |
parent | 6df9e7c895a9d4d773ae713f28888407fdf6dbdc (diff) | |
download | poky-849d29c8553711ed4619b60dd6ffc5020a98c8ce.tar.gz |
package_rpm: Allow compression mode override
Commit 4a4d5f78a6962dda5f63e9891825c80a8a87bf66 ("package_rpm: use zstd
instead of xz") changed the rpm package compressor from 'xz' to 'zstd'
which results in decompression failure with BusyBox-provided 'rpm2cpio'
applet and 'rpm' applet when given the '-i' (Install package) option:
rpm2cpio: no gzip/bzip2/xz magic
Introduce a variable which makes it possible to use a different
compression mode, making it possible to override the default value for
example like
RPMBUILD_COMPMODE = "${@'w6T%d.xzdio' % int(d.getVar('XZ_THREADS'))}"
to enable rpm decompression without including the full rpm package in
the resulting root filesystem.
(From OE-Core rev: a40d9258148e28cbee2168c93179cd4c1232fb62)
Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes-global/package_rpm.bbclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass index 246106ea4f..5d35962aff 100644 --- a/meta/classes-global/package_rpm.bbclass +++ b/meta/classes-global/package_rpm.bbclass | |||
@@ -10,6 +10,7 @@ IMAGE_PKGTYPE ?= "rpm" | |||
10 | 10 | ||
11 | RPM = "rpm" | 11 | RPM = "rpm" |
12 | RPMBUILD = "rpmbuild" | 12 | RPMBUILD = "rpmbuild" |
13 | RPMBUILD_COMPMODE ?= "${@'w19T%d.zstdio' % int(d.getVar('ZSTD_THREADS'))}" | ||
13 | 14 | ||
14 | PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms" | 15 | PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms" |
15 | 16 | ||
@@ -659,6 +660,7 @@ python do_package_rpm () { | |||
659 | 660 | ||
660 | # Setup the rpmbuild arguments... | 661 | # Setup the rpmbuild arguments... |
661 | rpmbuild = d.getVar('RPMBUILD') | 662 | rpmbuild = d.getVar('RPMBUILD') |
663 | rpmbuild_compmode = d.getVar('RPMBUILD_COMPMODE') | ||
662 | 664 | ||
663 | # Too many places in dnf stack assume that arch-independent packages are "noarch". | 665 | # Too many places in dnf stack assume that arch-independent packages are "noarch". |
664 | # Let's not fight against this. | 666 | # Let's not fight against this. |
@@ -682,8 +684,8 @@ python do_package_rpm () { | |||
682 | cmd = cmd + " --define '_use_internal_dependency_generator 0'" | 684 | cmd = cmd + " --define '_use_internal_dependency_generator 0'" |
683 | cmd = cmd + " --define '_binaries_in_noarch_packages_terminate_build 0'" | 685 | cmd = cmd + " --define '_binaries_in_noarch_packages_terminate_build 0'" |
684 | cmd = cmd + " --define '_build_id_links none'" | 686 | cmd = cmd + " --define '_build_id_links none'" |
685 | cmd = cmd + " --define '_binary_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS")) | 687 | cmd = cmd + " --define '_source_payload %s'" % rpmbuild_compmode |
686 | cmd = cmd + " --define '_source_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS")) | 688 | cmd = cmd + " --define '_binary_payload %s'" % rpmbuild_compmode |
687 | cmd = cmd + " --define 'clamp_mtime_to_source_date_epoch 1'" | 689 | cmd = cmd + " --define 'clamp_mtime_to_source_date_epoch 1'" |
688 | cmd = cmd + " --define 'use_source_date_epoch_as_buildtime 1'" | 690 | cmd = cmd + " --define 'use_source_date_epoch_as_buildtime 1'" |
689 | cmd = cmd + " --define '_buildhost reproducible'" | 691 | cmd = cmd + " --define '_buildhost reproducible'" |