From: Niko Mauno <niko.ma...@vaisala.com> 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 In order to maintain compatibility with BusyBox introduce new variable which can be overridden like: RPM_COMPRESSION = "xz" to enable rpm decompression without including the full rpm package in the resulting root filesystem. Signed-off-by: Niko Mauno <niko.ma...@vaisala.com> --- meta/classes-global/package_rpm.bbclass | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass index 246106ea4f..da25b7682c 100644 --- a/meta/classes-global/package_rpm.bbclass +++ b/meta/classes-global/package_rpm.bbclass @@ -13,6 +13,9 @@ RPMBUILD = "rpmbuild" PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms" +# Override variable to use alternative 'xz' or 'none' compression +RPM_COMPRESSION ?= "zstd" + # Maintaining the perfile dependencies has significant overhead when writing the # packages. When set, this value merges them for efficiency. MERGEPERFILEDEPS = "1" @@ -659,6 +662,7 @@ python do_package_rpm () { # Setup the rpmbuild arguments... rpmbuild = d.getVar('RPMBUILD') + rpmcomp = d.getVar('RPM_COMPRESSION') # Too many places in dnf stack assume that arch-independent packages are "noarch". # Let's not fight against this. @@ -682,8 +686,16 @@ python do_package_rpm () { cmd = cmd + " --define '_use_internal_dependency_generator 0'" cmd = cmd + " --define '_binaries_in_noarch_packages_terminate_build 0'" cmd = cmd + " --define '_build_id_links none'" - cmd = cmd + " --define '_binary_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS")) - cmd = cmd + " --define '_source_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS")) + if rpmcomp == "zstd": + cmd = cmd + " --define '_binary_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS")) + cmd = cmd + " --define '_source_payload w19T%d.zstdio'" % int(d.getVar("ZSTD_THREADS")) + elif rpmcomp == 'xz': + cmd = cmd + " --define '_binary_payload w6T%d.xzdio'" % int(d.getVar("XZ_THREADS")) + cmd = cmd + " --define '_source_payload w6T%d.xzdio'" % int(d.getVar("XZ_THREADS")) + elif rpmcomp == 'none': + pass + else: + bb.fatal('unsupported rpm compression method: "%s"' % rpmcomp) cmd = cmd + " --define 'clamp_mtime_to_source_date_epoch 1'" cmd = cmd + " --define 'use_source_date_epoch_as_buildtime 1'" cmd = cmd + " --define '_buildhost reproducible'" -- 2.39.2
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#189523): https://lists.openembedded.org/g/openembedded-core/message/189523 Mute This Topic: https://lists.openembedded.org/mt/102080114/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-