If _NR_CPUS_value isn't set or empty, prompt about using the current host's threads count.

This commit is contained in:
Tk-Glitch
2022-08-12 18:41:20 +02:00
parent 16919b3ce0
commit c4de67201c
2 changed files with 15 additions and 1 deletions

View File

@@ -1394,6 +1394,20 @@ CONFIG_DEBUG_INFO_BTF_MODULES=y\r
fi
fi
# NR_CPUS
if [ -z "$_NR_CPUS_value" ]; then
plain ""
plain "Set NR_CPUS value to the current host's threads count?"
plain "For best results, it should be equal to the maximum number of threads the target machine has."
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
scripts/config --set-val "$_NR_CPUS_value"
else
scripts/config --set-val "128"
fi
fi
# Community patches