From e68249a28b64fb920d9756d21a1ae89619b3f696 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Mon, 22 Jun 2026 16:04:57 +0200 Subject: [PATCH] limine: align concatenated initrd modules to 4 bytes The kernel's initramfs unpacker only accepts a raw cpio header at a 4-byte aligned offset, so multiple module_path entries need padding between them. Without this an uncompressed cpio after the main compressed initrd fails with "invalid magic at start of compressed archive". Patch merged upstream as Limine PR #599, remove on next release. --- pkgs/by-name/li/limine/package.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/by-name/li/limine/package.nix b/pkgs/by-name/li/limine/package.nix index 6296234c02df..2f1f8fe3e5f1 100644 --- a/pkgs/by-name/li/limine/package.nix +++ b/pkgs/by-name/li/limine/package.nix @@ -1,5 +1,6 @@ # Derivation containing the Limine host tool and the compiled bootloader { + fetchpatch, fetchurl, lib, llvmPackages, @@ -57,6 +58,16 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-8aUp2lzVClyje6WHMTOnuOclhLEn1zMf6U5VTl5gEvc="; }; + patches = [ + # Merged upstream in https://github.com/Limine-Bootloader/Limine/pull/599, + # remove on the next release. + (fetchpatch { + name = "align-linux-modules.patch"; + url = "https://github.com/Limine-Bootloader/Limine/commit/6635ae4ff2321f9a3c85116a57a00e3b6edc100b.patch"; + hash = "sha256-poAcZND5xwS8npHCytS9lwcQi9oCEcc4bR+6HKVXJ78="; + }) + ]; + enableParallelBuilding = true; hardeningDisable = lib.optionals missingZerocallusedregs [