summarylogtreecommitdiffstats
path: root/auto-cpu-optimization.sh
diff options
context:
space:
mode:
authorP. Jung2021-10-12 18:38:52 +0000
committerP. Jung2021-10-12 18:38:52 +0000
commite9f46474844a86fcd59638aa89304776248d6499 (patch)
treebd9d0cf5da66dc5ca7418212c7e26702d77dbeaa /auto-cpu-optimization.sh
downloadaur-e9f46474844a86fcd59638aa89304776248d6499.tar.gz
first push
Diffstat (limited to 'auto-cpu-optimization.sh')
-rwxr-xr-xauto-cpu-optimization.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/auto-cpu-optimization.sh b/auto-cpu-optimization.sh
new file mode 100755
index 000000000000..517d52067b80
--- /dev/null
+++ b/auto-cpu-optimization.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+#######################################
+# AUTO-CPU-OPTIMIZATION #
+#######################################
+# CREATOR : BL4CKH47H4CK3R #
+#######################################
+# HTTPS://GITHUB.COM/BL4CKH47H4CK3R #
+#######################################
+
+CPU=`gcc -Q -march=native --help=target | grep march | awk '{print $2}' | head -1`
+MARCH=`echo ${CPU} | tr '[:lower:]' '[:upper:]'`&& echo
+
+if [[ ${MARCH} == "ZNVER" ]]
+then
+ MARCH="ZEN"
+
+elif [[ ${MARCH} == "ZNVER2" ]]
+then
+ MARCH="ZEN2"
+
+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