From 4e02bb4922790cc9c4446ffc972b731394a14bdb Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 14 Jul 2022 12:11:55 +0300 Subject: [PATCH] linux: enable MODULE_ALLOW_BTF_MISMATCH Right now it looks like the BTFs are not reproducible between different builds of the same kernel, and the kernel will refuse to load modules if the BTF doesn't match. This can cause some interesting side effects when Nix uses different substituters for different parts of the kernel. This is far from ideal, and we _really_ should figure out how to actually make the BTF building consistently reproducible, but that seems more complicated, so maybe we should do this to get affected systems booting. See also: https://lore.kernel.org/bpf/YfK18x%2FXrYL4Vw8o@syu-laptop/ , where the openSUSE people ran into similar issues. --- pkgs/os-specific/linux/kernel/common-config.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 1962b5ba5aa2..708d63ed4cb5 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -45,6 +45,10 @@ let # aarch64 defconfig since 5.13 DEBUG_INFO_REDUCED = whenAtLeast "5.13" (option no); DEBUG_INFO_BTF = whenAtLeast "5.2" (option yes); + # Allow loading modules with mismatched BTFs + # FIXME: figure out how to actually make BTFs reproducible instead + # See https://github.com/NixOS/nixpkgs/pull/181456 for details. + MODULE_ALLOW_BTF_MISMATCH = whenAtLeast "5.18" (option yes); BPF_LSM = whenAtLeast "5.7" (option yes); DEBUG_KERNEL = yes; DEBUG_DEVRES = no;