From 79e05fb16b1af292e50cc0c479809cc66b47b087 Mon Sep 17 00:00:00 2001 From: misuzu Date: Sun, 19 Jun 2022 14:00:16 +0300 Subject: [PATCH 1/3] linux-kernel: disable BTF on 32-bit platforms on kernels 5.15+ It fails to build with `Failed to parse base BTF 'vmlinux': -22` --- pkgs/os-specific/linux/kernel/common-config.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index d8084bbfcccf..649dc253b79d 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -41,7 +41,8 @@ let (whenBetween "5.2" "5.18" yes) ]; DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT = whenAtLeast "5.18" yes; - DEBUG_INFO_BTF = whenAtLeast "5.2" (option yes); + # Disabled on 32-bit platforms, fails to build on 5.15+ with `Failed to parse base BTF 'vmlinux': -22` + DEBUG_INFO_BTF = whenAtLeast "5.2" (option (if stdenv.hostPlatform.is32bit && (versionAtLeast version "5.15") then no else yes)); BPF_LSM = whenAtLeast "5.7" (option yes); DEBUG_KERNEL = yes; DEBUG_DEVRES = no; From b0e0bdb88037d98ba111c16459038e2e0257c0d9 Mon Sep 17 00:00:00 2001 From: misuzu Date: Sun, 19 Jun 2022 13:57:14 +0300 Subject: [PATCH 2/3] Revert "linux_5_15: mark as broken on i686" This reverts commit 836c6353cc33fd43e3c956040e77d050a4e6e727. Not broken anymore. --- pkgs/os-specific/linux/kernel/linux-5.15.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/linux-5.15.nix b/pkgs/os-specific/linux/kernel/linux-5.15.nix index 62aefff81f5a..225fe27a15f2 100644 --- a/pkgs/os-specific/linux/kernel/linux-5.15.nix +++ b/pkgs/os-specific/linux/kernel/linux-5.15.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, buildPackages, fetchurl, perl, buildLinux, nixosTests, modDirVersionArg ? null, ... } @ args: +{ lib, buildPackages, fetchurl, perl, buildLinux, nixosTests, modDirVersionArg ? null, ... } @ args: with lib; @@ -11,8 +11,6 @@ buildLinux (args // rec { # branchVersion needs to be x.y extraMeta.branch = versions.majorMinor version; - extraMeta.broken = stdenv.isi686; - src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; sha256 = "1700js21yimx8rz4bsglszry564l2ycmmcr36rdqspzbmlx5w8wb"; From e0c5c47aa89cf4d4e3b3c58c535b463b39785c3d Mon Sep 17 00:00:00 2001 From: misuzu Date: Sun, 19 Jun 2022 14:01:58 +0300 Subject: [PATCH 3/3] linuxPackages: use 5_15 kernel on 32-bit platforms It builds just fine with BTF disabled. --- pkgs/top-level/linux-kernels.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index 232843edf47a..6e9f5fd5fc09 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -571,7 +571,7 @@ in { }); packageAliases = { - linux_default = if stdenv.hostPlatform.is32bit then packages.linux_5_10 else packages.linux_5_15; + linux_default = packages.linux_5_15; # Update this when adding the newest kernel major version! linux_latest = packages.linux_5_18; linux_mptcp = packages.linux_mptcp_95;