From 4a4d5f78a6962dda5f63e9891825c80a8a87bf66 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Mon, 4 Oct 2021 11:22:48 +0200 Subject: package_rpm: use zstd instead of xz 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. (From OE-Core rev: e72c0b94554a9bc293844ec2bddb0c04ea19791d) Signed-off-by: Alexander Kanavin Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- 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 f3ff5b776b..030d29b097 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -816,6 +816,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}" -- cgit v1.2.3-54-g00ecf