summarylogtreecommitdiffstats
path: root/auto-cpu-optimization.sh
diff options
context:
space:
mode:
authorP. Jung2021-09-03 09:51:06 +0000
committerP. Jung2021-09-03 09:51:06 +0000
commit1c1cced567fb725bd064cda8cfddf9234a534a1d (patch)
tree84c12d8aaebd446042f4797b808d9deca009f202 /auto-cpu-optimization.sh
parent12edcb337bfdf9594c7707a3543b8976c4e7aff4 (diff)
downloadaur-1c1cced567fb725bd064cda8cfddf9234a534a1d.tar.gz
5.14.1
Diffstat (limited to 'auto-cpu-optimization.sh')
-rwxr-xr-xauto-cpu-optimization.sh50
1 files changed, 22 insertions, 28 deletions
diff --git a/auto-cpu-optimization.sh b/auto-cpu-optimization.sh
index 444eac6980a0..f40b21ffd351 100755
--- a/auto-cpu-optimization.sh
+++ b/auto-cpu-optimization.sh
@@ -1,38 +1,32 @@
#!/bin/bash
#######################################
-# Creator : BL4CKH47H4CK3R #
-# https://github.com/BL4CKH47H4CK3R #
+# AUTO-CPU-OPTIMIZATION #
+#######################################
+# 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
+CPU=`gcc -Q -march=native --help=target | grep march | awk '{print $2}' | head -1`
+MARCH=`echo ${CPU} | tr '[:lower:]' '[:upper:]'`&& echo
-if [[ ${INPUT} == 1 ]]
+if [[ ${MARCH} == "ZNVER" ]]
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"
+ MARCH="ZEN"
- elif [[ ${MARCH} == "ZNVER2" ]]
- then
- MARCH="ZEN2"
-
- elif [[ ${MARCH} == "ZNVER3" ]]
- then
- MARCH="ZEN3"
- fi
+elif [[ ${MARCH} == "ZNVER2" ]]
+then
+ MARCH="ZEN2"
- 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
+elif [[ ${MARCH} == "ZNVER3" ]]
+then
+ MARCH="ZEN3"
fi
+
+echo "----------------------------------"
+echo "| APPLYING AUTO-CPU-OPTIMIZATION |"
+echo "----------------------------------"
+echo "[*] DETECTED CPU (MARCH) : ${MARCH}"
+sed -i "/CONFIG_GENERIC_CPU=y/d;s/\# CONFIG_M${MARCH} is not set/CONFIG_M${MARCH}=y/g" *config*
+sleep 3 && echo