···137137 makeFlags = lib.optionals (stdenv.hostPlatform.linux-kernel ? makeFlags) stdenv.hostPlatform.linux-kernel.makeFlags
138138 ++ extraMakeFlags;
139139140140- prePatch = kernel.prePatch + ''
140140+ postPatch = kernel.postPatch + ''
141141 # Patch kconfig to print "###" after every question so that
142142 # generate-config.pl from the generic builder can answer them.
143143 sed -e '/fflush(stdout);/i\printf("###");' -i scripts/kconfig/conf.c
+4-9
pkgs/os-specific/linux/kernel/manual-config.nix
···105105 # Fixes determinism by normalizing metadata for the archive of kheaders
106106 ++ optional (lib.versionAtLeast version "5.2" && lib.versionOlder version "5.4") ./gen-kheaders-metadata.patch;
107107108108- prePatch = ''
108108+ postPatch = ''
109109 sed -i Makefile -e 's|= depmod|= ${buildPackages.kmod}/bin/depmod|'
110110111111 # fixup for pre-5.4 kernels using the $(cd $foo && /bin/pwd) pattern
···118118 # See also https://kernelnewbies.org/BuildId
119119 sed -i Makefile -e 's|--build-id=[^ ]*|--build-id=none|'
120120121121- # Some linux-hardened patches now remove certain files in the scripts directory, so we cannot
122122- # patch all scripts until after patches are applied.
123123- # However, scripts/ld-version.sh is still ran when generating a configfile for a kernel, so it needs
124124- # to be patched prior to patchPhase
125125- patchShebangs scripts/ld-version.sh
126126- '';
121121+ # Some linux-hardened patches now remove certain files in the scripts directory, so the file may not exist.
122122+ [[ -f scripts/ld-version.sh ]] && patchShebangs scripts/ld-version.sh
127123128128- postPatch = ''
129124 # Set randstruct seed to a deterministic but diversified value. Note:
130125 # we could have instead patched gen-random-seed.sh to take input from
131126 # the buildFlags, but that would require also patching the kernel's
···135130 if [ -f "$file" ]; then
136131 substituteInPlace "$file" \
137132 --replace NIXOS_RANDSTRUCT_SEED \
138138- $(echo ${randstructSeed}${src} ${configfile} | sha256sum | cut -d ' ' -f 1 | tr -d '\n')
133133+ $(echo ${randstructSeed}${src} ${placeholder "configfile"} | sha256sum | cut -d ' ' -f 1 | tr -d '\n')
139134 break
140135 fi
141136 done