kernel: move prePatch to postPatch to not mess with patches

+5 -10
+1 -1
pkgs/os-specific/linux/kernel/generic.nix
··· 137 137 makeFlags = lib.optionals (stdenv.hostPlatform.linux-kernel ? makeFlags) stdenv.hostPlatform.linux-kernel.makeFlags 138 138 ++ extraMakeFlags; 139 139 140 - prePatch = kernel.prePatch + '' 140 + postPatch = kernel.postPatch + '' 141 141 # Patch kconfig to print "###" after every question so that 142 142 # generate-config.pl from the generic builder can answer them. 143 143 sed -e '/fflush(stdout);/i\printf("###");' -i scripts/kconfig/conf.c
+4 -9
pkgs/os-specific/linux/kernel/manual-config.nix
··· 105 105 # Fixes determinism by normalizing metadata for the archive of kheaders 106 106 ++ optional (lib.versionAtLeast version "5.2" && lib.versionOlder version "5.4") ./gen-kheaders-metadata.patch; 107 107 108 - prePatch = '' 108 + postPatch = '' 109 109 sed -i Makefile -e 's|= depmod|= ${buildPackages.kmod}/bin/depmod|' 110 110 111 111 # fixup for pre-5.4 kernels using the $(cd $foo && /bin/pwd) pattern ··· 118 118 # See also https://kernelnewbies.org/BuildId 119 119 sed -i Makefile -e 's|--build-id=[^ ]*|--build-id=none|' 120 120 121 - # Some linux-hardened patches now remove certain files in the scripts directory, so we cannot 122 - # patch all scripts until after patches are applied. 123 - # However, scripts/ld-version.sh is still ran when generating a configfile for a kernel, so it needs 124 - # to be patched prior to patchPhase 125 - patchShebangs scripts/ld-version.sh 126 - ''; 121 + # Some linux-hardened patches now remove certain files in the scripts directory, so the file may not exist. 122 + [[ -f scripts/ld-version.sh ]] && patchShebangs scripts/ld-version.sh 127 123 128 - postPatch = '' 129 124 # Set randstruct seed to a deterministic but diversified value. Note: 130 125 # we could have instead patched gen-random-seed.sh to take input from 131 126 # the buildFlags, but that would require also patching the kernel's ··· 135 130 if [ -f "$file" ]; then 136 131 substituteInPlace "$file" \ 137 132 --replace NIXOS_RANDSTRUCT_SEED \ 138 - $(echo ${randstructSeed}${src} ${configfile} | sha256sum | cut -d ' ' -f 1 | tr -d '\n') 133 + $(echo ${randstructSeed}${src} ${placeholder "configfile"} | sha256sum | cut -d ' ' -f 1 | tr -d '\n') 139 134 break 140 135 fi 141 136 done