[PATCH] package_rpm: use zstd instead of xz
DORMANTno replies
From: Alexander Kanavin <hidden>
Date: 2021-10-04 09:22:56
Subsystem:
the rest · Maintainer:
Linus Torvalds
zstd has similar time and space performance in compression but is vastly faster in decompression, which benefits rootfs creation (especially when installing very large packages) and on-target package installation. Also, ensure ZSTD_THREADS doesn't change sstate checksums. The detailed explanation is in the commit making similar change for XZ_THREADS. Signed-off-by: Alexander Kanavin <redacted> --- meta/classes/package_rpm.bbclass | 4 ++-- meta/conf/bitbake.conf | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 1c62d8283b..e738806fd7 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass@@ -684,8 +684,8 @@ 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 w6T%d.xzdio'" % int(d.getVar("XZ_THREADS")) - cmd = cmd + " --define '_source_payload w6T%d.xzdio'" % int(d.getVar("XZ_THREADS")) + 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")) 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'"
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index e25d632dc1..1ae377750b 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf@@ -815,6 +815,10 @@ XZ_THREADS[vardepvalue] = "1" XZ_DEFAULTS ?= "--memlimit=${XZ_MEMLIMIT} --threads=${XZ_THREADS}" XZ_DEFAULTS[vardepsexclude] += "XZ_MEMLIMIT XZ_THREADS" +# Default parallelism for zstd +ZSTD_THREADS ?= "${@oe.utils.cpu_count(at_least=2)}" +ZSTD_THREADS[vardepvalue] = "1" + # Limit the number of threads that OpenMP libraries will use. Otherwise they # may fallback to using all CPUs export OMP_NUM_THREADS = "${BB_NUMBER_THREADS}"
--
2.31.1