diff options
author | P.Jung | 2021-08-16 17:51:49 +0000 |
---|---|---|
committer | P.Jung | 2021-08-16 17:51:49 +0000 |
commit | cbaeb40b88c5b9bd3c99e29a33286f63fa8cdc31 (patch) | |
tree | e0f582273a8e768123f7ed09243ebac59a75db30 /auto-cpu-optimization.sh | |
parent | 2f56ac6a8b4c27fa46dee26e3c98e05c79009719 (diff) | |
download | aur-cbaeb40b88c5b9bd3c99e29a33286f63fa8cdc31.tar.gz |
kernel panic fix, rc6, arch-patches
Diffstat (limited to 'auto-cpu-optimization.sh')
-rwxr-xr-x | auto-cpu-optimization.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/auto-cpu-optimization.sh b/auto-cpu-optimization.sh new file mode 100755 index 000000000000..444eac6980a0 --- /dev/null +++ b/auto-cpu-optimization.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +####################################### +# Creator : BL4CKH47H4CK3R # +# https://github.com/BL4CKH47H4CK3R # +####################################### + +echo -e "-------------------------" +echo -e "| Auto-CPU-Optimization |" +echo -e "-------------------------" +echo -e "[1] Enable CPU Optimization" +echo -e "[2] Disable CPU Optimization" + +read -p "[*] Enter Choice [1, 2]: " INPUT + +if [[ ${INPUT} == 1 ]] +then + CPU=`gcc -Q -march=native --help=target | grep march | awk '{print $2}' | head -1` + MARCH=`echo "${CPU}" | tr '[:lower:]' '[:upper:]'` + + if [[ ${MARCH} == "ZNVER" ]] + then + MARCH="ZEN" + + elif [[ ${MARCH} == "ZNVER2" ]] + then + MARCH="ZEN2" + + elif [[ ${MARCH} == "ZNVER3" ]] + then + MARCH="ZEN3" + fi + + echo -e "[*] Detected CPU : `echo ${MARCH}`" + echo -e "[*] Setting Detected CPU Microarchitecture ..." + sed -i '/CONFIG_GENERIC_CPU=y/d' .config + sed -i "s/\# CONFIG_M${MARCH} is not set/CONFIG_M${MARCH}=y/g" .config +fi |