From 3707e5708e1e6566c568bcf2755135864945577b Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 22 Jan 2024 13:35:21 +0100 Subject: [PATCH] Disable EFI in the kernel and use normal stdenv In order to build the kernel without compressed instructions we need to disable EFI support. We also need to leave the kernel to figure the proper -march and -mabi flags, as otherwise it fails to build. Using the option "CONFIG_RISCV_ISA_C n" disables the use of compressed instructions. --- overlay.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/overlay.nix b/overlay.nix index 6578708..628a773 100644 --- a/overlay.nix +++ b/overlay.nix @@ -51,6 +51,9 @@ final: prev: }); linuxPackagesCustom = prev.linuxPackagesFor (prev.linux.override { + # Don't use a compiler without compressed instructions, let the kernel + # configure the -march and -mabi arguments. + stdenv = prev.stdenv; structuredExtraConfig = with prev.lib.kernel; { KEXEC = yes; SERIAL_8250_DW = yes; @@ -82,6 +85,8 @@ final: prev: PCI_HOST_GENERIC = yes; RISCV_ISA_C = no; + NONPORTABLE = yes; + EFI = no; }; }); }