Properly set nproc default for NR_CPUS prompt

This commit is contained in:
Tk-Glitch
2022-08-12 19:05:53 +02:00
parent fc970e6367
commit f8a1d4e500

View File

@@ -1402,7 +1402,10 @@ CONFIG_DEBUG_INFO_BTF_MODULES=y\r
plain "If you want to use the resulting kernel on a machine with more threads, you can hit enter or answer N to use a default of 128."
read -rp "`echo $' > N/y : '`" CONDITION_nrcpus;
fi
if [[ "$CONDITION_nrcpus" =~ [yY] ]] || [ -n "$_NR_CPUS_value" ]; then
if [[ "$CONDITION_nrcpus" =~ [yY] ]]; then
_NR_CPUS_value="$(nproc)"
fi
if [ -n "$_NR_CPUS_value" ]; then
scripts/config --set-val "$_NR_CPUS_value"
else
scripts/config --set-val "128"