mirror of
https://abf.rosa.ru/djam/kernel-5.15.git
synced 2025-02-23 10:32:54 +00:00
Switch to zstd for faster decompression/startup
This commit is contained in:
parent
464c5c81a4
commit
846f0d6a2f
1 changed files with 19 additions and 14 deletions
33
kernel.spec
33
kernel.spec
|
@ -99,6 +99,12 @@
|
|||
# and it has not been adapted for kernel 5.10 (is not buildable)
|
||||
%bcond_with binary_shredder
|
||||
|
||||
# compress modules with zstd (zstd is good compression and fast decompression)
|
||||
%bcond_without compress_modules
|
||||
# Spend more resources on compression, but make resulting size less;
|
||||
# decompression speed will not be affected.
|
||||
%define zstd_cmd zstd -q --format=zstd --ultra -22
|
||||
|
||||
# Kernel flavour
|
||||
%if %{with nickel}
|
||||
%define flavour nickel
|
||||
|
@ -162,9 +168,6 @@
|
|||
%define build_cpupower 0
|
||||
%endif
|
||||
|
||||
|
||||
# compress modules with xz
|
||||
%define build_modxz 1
|
||||
# End of user definitions
|
||||
|
||||
# buildtime flags
|
||||
|
@ -173,19 +176,17 @@
|
|||
%{?_without_debug: %global build_debug 0}
|
||||
%{?_without_perf: %global build_perf 0}
|
||||
%{?_without_cpupower: %global build_cpupower 0}
|
||||
%{?_without_modxz: %global build_modxz 0}
|
||||
|
||||
%{?_with_doc: %global build_doc 1}
|
||||
%{?_with_devel: %global build_devel 1}
|
||||
%{?_with_debug: %global build_debug 1}
|
||||
%{?_with_perf: %global build_perf 1}
|
||||
%{?_with_cpupower: %global build_cpupower 1}
|
||||
%{?_with_modxz: %global build_modxz 1}
|
||||
|
||||
%if %{build_modxz}
|
||||
%define kmod_suffix .xz
|
||||
%if %{with compress_modules}
|
||||
%define kmod_suffix .zst
|
||||
%else
|
||||
%define kmod_suffix .gz
|
||||
%define kmod_suffix %{nil}
|
||||
%endif
|
||||
|
||||
%if !%{build_debug}
|
||||
|
@ -402,6 +403,10 @@ BuildRequires: kernel-source-rosa-test-suite
|
|||
BuildRequires: ccache
|
||||
%endif
|
||||
|
||||
%if %{with compress_modules}
|
||||
BuildRequires: zstd
|
||||
%endif
|
||||
|
||||
# might be useful too:
|
||||
Recommends: microcode
|
||||
|
||||
|
@ -1356,7 +1361,8 @@ popd
|
|||
install -d %{temp_boot}
|
||||
install -m 644 System.map %{temp_boot}/System.map-%{kver_full}
|
||||
install -m 644 .config %{temp_boot}/config-%{kver_full}
|
||||
xz -c Module.symvers > %{temp_boot}/symvers-%{kver_full}.xz
|
||||
%{zstd_cmd} Module.symvers
|
||||
install -m 644 Module.symvers.zst %{temp_boot}/symvers-%{kver_full}.zst
|
||||
|
||||
%ifarch %{armx}
|
||||
%make_build ARCH=arm64 V=1 INSTALL_DTBS_PATH=%{temp_boot}/dtb-%{kver_full} dtbs_install
|
||||
|
@ -1503,7 +1509,7 @@ kernel_files=../kernel_files.%{flavour}
|
|||
|
||||
cat > $kernel_files <<EOF
|
||||
%{_bootdir}/System.map-%{kver_full}
|
||||
%{_bootdir}/symvers-%{kver_full}.xz
|
||||
%{_bootdir}/symvers-%{kver_full}.zst
|
||||
%{_bootdir}/config-%{kver_full}
|
||||
%{_bootdir}/vmlinuz-%{kver_full}
|
||||
%ifarch %{armx}
|
||||
|
@ -1591,10 +1597,9 @@ fi
|
|||
rm -f %{certs_verify_tmp}
|
||||
|
||||
# compressing modules
|
||||
%if %{build_modxz}
|
||||
find %{target_modules} -name "*.ko" | %kxargs xz -6e
|
||||
%else
|
||||
find %{target_modules} -name "*.ko" | %kxargs gzip -9
|
||||
%if %{with compress_modules}
|
||||
# -T1 (one thread) because we run multiple zstd processes by xargs
|
||||
find %{target_modules} -name "*.ko" | %kxargs %{zstd_cmd} --rm -T1
|
||||
%endif
|
||||
|
||||
pushd %{target_modules}
|
||||
|
|
Loading…
Add table
Reference in a new issue