From 064e5484bb6db9322fb9fbcc14cfc01bf790e5b7 Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Tue, 30 Mar 2021 16:26:31 +0200 Subject: [PATCH] Add support for MNATIVE_INTEL and MNATIVE_AMD config options in graysky's cpu opts patchset and default to prompt --- customization.cfg | 5 +++-- linux-tkg-config/prepare | 30 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/customization.cfg b/customization.cfg index ce8da65..5113c5b 100644 --- a/customization.cfg +++ b/customization.cfg @@ -137,12 +137,13 @@ _zenify="true" # compiler optimization level - 1. Optimize for performance (-O2); 2. Optimize harder (-O3); 3. Optimize for size (-Os) - Kernel default is "1" _compileroptlevel="1" -# CPU compiler optimizations - Defaults to generic optimizations if left empty +# CPU compiler optimizations - Defaults to prompt at kernel config if left empty # AMD CPUs : "k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver" "steamroller" "excavator" "zen" "zen2" # Intel CPUs : "mpsc"(P4 & older Netburst based Xeon) "atom" "core2" "nehalem" "westmere" "silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake" "skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake" "cooperlake" "tigerlake" # Other options : # - "generic" (to share the package between machines with different CPUs) -# - "native" (use compiler autodetection and will prompt for P6_NOPS - Selecting your arch manually in the list above is recommended instead of this option) +# - "native_amd" (use compiler autodetection - Selecting your arch manually in the list above is recommended instead of this option) +# - "native_intel" (use compiler autodetection and will prompt for P6_NOPS - Selecting your arch manually in the list above is recommended instead of this option) _processor_opt="" # MuQSS only - Make IRQ threading compulsory (FORCE_IRQ_THREADING) - Default is "false" diff --git a/linux-tkg-config/prepare b/linux-tkg-config/prepare index 20d9183..c41ede6 100644 --- a/linux-tkg-config/prepare +++ b/linux-tkg-config/prepare @@ -648,33 +648,33 @@ CONFIG_DEBUG_INFO_BTF_MODULES=y\n # cpu opt - if [ -n "$_processor_opt" ] && [ "$_processor_opt" != "native" ]; then + if [ -n "$_processor_opt" ] && [[ "$_processor_opt" != native* ]]; then echo "# CONFIG_MNATIVE is not set" >> ./.config + echo "# CONFIG_MNATIVE_AMD is not set" >> ./.config + echo "# CONFIG_MNATIVE_INTEL is not set" >> ./.config fi if [ -n "$_processor_opt" ] && [ "$_processor_opt" != "generic" ]; then sed -i -e 's/CONFIG_GENERIC_CPU=y/# CONFIG_GENERIC_CPU is not set/' ./.config fi - if [ "$_processor_opt" = "native" ]; then - echo "CONFIG_MNATIVE=y" >> ./.config - fi - _cpu_marchs=("k8" "k8sse3" "k10" "barcelona" "bobcat" "jaguar" "bulldozer" "piledriver") _cpu_marchs+=("steamroller" "excavator" "zen" "zen2" "mpsc" "atom" "core2" "nehalem" "westmere") _cpu_marchs+=("silvermont" "sandybridge" "ivybridge" "haswell" "broadwell" "skylake") _cpu_marchs+=("skylakex" "cannonlake" "icelake" "goldmont" "goldmontplus" "cascadelake") - _cpu_marchs+=("cooperlake" "tigerlake") + _cpu_marchs+=("cooperlake" "tigerlake" "native" "native_amd" "native_intel") - for _march in "${_cpu_marchs[@]}" - do - _march_upper=`echo ${_march} | tr '[:lower:]' '[:upper:]'` - if [ "$_processor_opt" = "$_march" ]; then - echo "CONFIG_M${_march_upper}=y/" >> ./.config - else - echo "# CONFIG_M${_march_upper} is not set" >> ./.config - fi - done + if [ ! -z "$_processor_opt" ]; then # Don't populate when the config variable is empty + for _march in "${_cpu_marchs[@]}" + do + _march_upper=`echo ${_march} | tr '[:lower:]' '[:upper:]'` + if [ "$_processor_opt" = "$_march" ]; then + echo "CONFIG_M${_march_upper}=y/" >> ./.config + else + echo "# CONFIG_M${_march_upper} is not set" >> ./.config + fi + done + fi # Disable some debugging if [ "${_debugdisable}" = "true" ]; then