From 7a3f21c1e453a57b5bbd5135bac2bfce7dc37d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 3 Apr 2021 10:46:30 +0200 Subject: [PATCH] linux: don't compress by ZSTD on 32-bit It doesn't build on i686 and I don't consider it worth deep investigation. I tried a VM test, too (nixosTests.knot). --- pkgs/os-specific/linux/kernel/common-config.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index c90dbd73f2f..777a91241bb 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -680,7 +680,14 @@ let DEBUG_MEMORY_INIT = option yes; }); - misc = { + misc = let + # Use zstd for kernel compression if 64-bit and newer than 5.9, otherwise xz. + # i686 issues: https://github.com/NixOS/nixpkgs/pull/117961#issuecomment-812106375 + useZstd = stdenv.buildPlatform.is64bit && versionAtLeast version "5.9"; + in { + KERNEL_XZ = mkIf (!useZstd) yes; + KERNEL_ZSTD = mkIf useZstd yes; + HID_BATTERY_STRENGTH = yes; # enabled by default in x86_64 but not arm64, so we do that here HIDRAW = yes; @@ -696,10 +703,6 @@ let MODULE_COMPRESS = yes; MODULE_COMPRESS_XZ = yes; - # use zstd for kernel compression if newer than 5.9, else xz. - KERNEL_XZ = whenOlder "5.9" yes; - KERNEL_ZSTD = whenAtLeast "5.9" yes; - SYSVIPC = yes; # System-V IPC AIO = yes; # POSIX asynchronous I/O