···137 makeFlags = lib.optionals (stdenv.hostPlatform.linux-kernel ? makeFlags) stdenv.hostPlatform.linux-kernel.makeFlags
138 ++ extraMakeFlags;
139140- prePatch = kernel.prePatch + ''
141 # Patch kconfig to print "###" after every question so that
142 # generate-config.pl from the generic builder can answer them.
143 sed -e '/fflush(stdout);/i\printf("###");' -i scripts/kconfig/conf.c
···137 makeFlags = lib.optionals (stdenv.hostPlatform.linux-kernel ? makeFlags) stdenv.hostPlatform.linux-kernel.makeFlags
138 ++ extraMakeFlags;
139140+ postPatch = kernel.postPatch + ''
141 # Patch kconfig to print "###" after every question so that
142 # generate-config.pl from the generic builder can answer them.
143 sed -e '/fflush(stdout);/i\printf("###");' -i scripts/kconfig/conf.c
+4-9
pkgs/os-specific/linux/kernel/manual-config.nix
···105 # Fixes determinism by normalizing metadata for the archive of kheaders
106 ++ optional (lib.versionAtLeast version "5.2" && lib.versionOlder version "5.4") ./gen-kheaders-metadata.patch;
107108- prePatch = ''
109 sed -i Makefile -e 's|= depmod|= ${buildPackages.kmod}/bin/depmod|'
110111 # fixup for pre-5.4 kernels using the $(cd $foo && /bin/pwd) pattern
···118 # See also https://kernelnewbies.org/BuildId
119 sed -i Makefile -e 's|--build-id=[^ ]*|--build-id=none|'
120121- # 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- '';
127128- postPatch = ''
129 # Set randstruct seed to a deterministic but diversified value. Note:
130 # we could have instead patched gen-random-seed.sh to take input from
131 # the buildFlags, but that would require also patching the kernel's
···135 if [ -f "$file" ]; then
136 substituteInPlace "$file" \
137 --replace NIXOS_RANDSTRUCT_SEED \
138- $(echo ${randstructSeed}${src} ${configfile} | sha256sum | cut -d ' ' -f 1 | tr -d '\n')
139 break
140 fi
141 done
···105 # Fixes determinism by normalizing metadata for the archive of kheaders
106 ++ optional (lib.versionAtLeast version "5.2" && lib.versionOlder version "5.4") ./gen-kheaders-metadata.patch;
107108+ postPatch = ''
109 sed -i Makefile -e 's|= depmod|= ${buildPackages.kmod}/bin/depmod|'
110111 # fixup for pre-5.4 kernels using the $(cd $foo && /bin/pwd) pattern
···118 # See also https://kernelnewbies.org/BuildId
119 sed -i Makefile -e 's|--build-id=[^ ]*|--build-id=none|'
120121+ # 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
00001230124 # Set randstruct seed to a deterministic but diversified value. Note:
125 # we could have instead patched gen-random-seed.sh to take input from
126 # the buildFlags, but that would require also patching the kernel's
···130 if [ -f "$file" ]; then
131 substituteInPlace "$file" \
132 --replace NIXOS_RANDSTRUCT_SEED \
133+ $(echo ${randstructSeed}${src} ${placeholder "configfile"} | sha256sum | cut -d ' ' -f 1 | tr -d '\n')
134 break
135 fi
136 done