From d6340f65d1a9ec0b942cd0860a28dbe4c18a91b2 Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Thu, 4 Apr 2024 14:38:52 +0200 Subject: [PATCH] [Boot] use zstd for module compression instead of xz Faster and avoids using XZ in such a critical area. --- boot.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/boot.nix b/boot.nix index 9d207e0..369a8fc 100644 --- a/boot.nix +++ b/boot.nix @@ -2,6 +2,18 @@ with lib; let customKernelPatches = { + zstd = { + name = "zstd"; + patch = null; + extraConfig = '' + MODULE_COMPRESS_XZ n + MODULE_COMPRESS_ZSTD y + ZSWAP_COMPRESSOR_DEFAULT_ZSTD y + FW_LOADER_COMPRESS_ZSTD y + ZRAM_DEF_COMP_ZSTD y + ''; + }; + enableX32ABI = { name = "enable-x32"; patch = null; @@ -262,6 +274,9 @@ in { # Required for many features, like rootluks TPM-unlock, etc. initrd.systemd.enable = true; + initrd.compressor = "zstd"; + initrd.compressorArgs = [ "-T0" "-9" ]; + kernelPackages = with myLib.debug; let baseKernel = cfg.kernel.package; @@ -318,6 +333,7 @@ in { ++ optional (cfg.patches.amdClusterId.enable && kernelVersionOlder "6.4") customKernelPatches.amdClusterId ++ optional (cfg.patches.zenLLCIdle.enable && kernelVersionOlder "6.5") customKernelPatches.backports.zenLLCIdle ++ optional (isXanmod cfg.kernel.package && config.aviallon.optimizations.enable) (customKernelPatches.optimizeForCPUArch config.aviallon.general.cpu.arch) + ++ optional config.aviallon.optimizations.enable customKernelPatches.zstd ; loader.grub.enable = cfg.useGrub;