diff --git a/kernel.spec b/kernel.spec index f68a171..7657eaa 100644 --- a/kernel.spec +++ b/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 <