From e9a1ba099fb3bf722fdc1bb8ddc1998ff0ec830a Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Thu, 14 Oct 2021 16:27:54 -0700 Subject: [PATCH] linuxPackages_5_10_hardened: fix patching conflict with patchShebang --- pkgs/os-specific/linux/kernel/manual-config.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index d9a959c50bc9..421b234b6341 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -126,7 +126,11 @@ let # See also https://kernelnewbies.org/BuildId sed -i Makefile -e 's|--build-id=[^ ]*|--build-id=none|' - patchShebangs scripts + # Some linux-hardened patches now remove certain files in the scripts directory, so we cannot + # patch all scripts until after patches are applied. + # However, scripts/ld-version.sh is still ran when generating a configfile for a kernel, so it needs + # to be patched prior to patchPhase + patchShebangs scripts/ld-version.sh ''; postPatch = '' @@ -140,6 +144,8 @@ let --replace NIXOS_RANDSTRUCT_SEED \ $(echo ${randstructSeed}${src} ${configfile} | sha256sum | cut -d ' ' -f 1 | tr -d '\n') fi + + patchShebangs scripts ''; configurePhase = ''