From 598f37eef32358d703a34a5234c3b4f3e35a89ec Mon Sep 17 00:00:00 2001 From: Hyy2001X <1804430051@qq.com> Date: Thu, 17 Jun 2021 23:55:26 +0800 Subject: [PATCH] =?UTF-8?q?coremark:=20=E5=90=88=E5=B9=B6=E4=B8=8A?= =?UTF-8?q?=E6=B8=B8=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CustomFiles/Depends/coremark.sh.sh | 14 ++++++++++++++ CustomFiles/Depends/coremark_ImmortalWrt.sh | 10 ---------- CustomFiles/Depends/coremark_lede.sh | 17 ----------------- Scripts/AutoBuild_Function.sh | 3 +-- 4 files changed, 15 insertions(+), 29 deletions(-) create mode 100644 CustomFiles/Depends/coremark.sh.sh delete mode 100755 CustomFiles/Depends/coremark_ImmortalWrt.sh delete mode 100755 CustomFiles/Depends/coremark_lede.sh diff --git a/CustomFiles/Depends/coremark.sh.sh b/CustomFiles/Depends/coremark.sh.sh new file mode 100644 index 0000000..3d5c196 --- /dev/null +++ b/CustomFiles/Depends/coremark.sh.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +coremark > /tmp/coremark.log +Scores=$(cat /tmp/coremark.log 2> /dev/null | grep "CoreMark 1.0" | awk '{print $4}') +Processer=$(awk -F ':[ ]' '/model name/{printf ($2);exit}' /proc/cpuinfo) + +[[ -n ${Processer} ]] && echo -e "\nProcesser: ${Processer}" +echo -e "Score: ${Scores}\nTime costs: $(grep "Total time" /tmp/coremark.log | awk '{print $4}')" +echo "(CPU Mark: ${Scores} Scores)" > /etc/bench.log + +if [ -f /etc/bench.log ]; then + sed -i '/coremark/d' /etc/crontabs/root + crontab /etc/crontabs/root +fi \ No newline at end of file diff --git a/CustomFiles/Depends/coremark_ImmortalWrt.sh b/CustomFiles/Depends/coremark_ImmortalWrt.sh deleted file mode 100755 index c631c1c..0000000 --- a/CustomFiles/Depends/coremark_ImmortalWrt.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -echo -e "\nRunning CoreMark test,please wait ..." - -Scores=$(cat /tmp/coremark.log 2> /dev/null | grep "CoreMark 1.0" | awk '{print $4}') -Processer=$(awk -F ':[ ]' '/model name/{printf ($2);exit}' /proc/cpuinfo) -Time=$(grep "Total time" /tmp/coremark.log | awk '{print $4}') -[[ -z "${Processer}" ]] && Processer=Unknown - -echo -e "\nProcesser: ${Processer}\nScore: ${Scores}\nTime costs: ${Time}" \ No newline at end of file diff --git a/CustomFiles/Depends/coremark_lede.sh b/CustomFiles/Depends/coremark_lede.sh deleted file mode 100755 index ab6f9b2..0000000 --- a/CustomFiles/Depends/coremark_lede.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -echo -e "\nRunning CoreMark test,please wait ..." -/bin/coremark > /tmp/coremark.log - -Scores=$(cat /tmp/coremark.log 2> /dev/null | grep "CoreMark 1.0" | awk '{print $4}') -Processer=$(awk -F ':[ ]' '/model name/{printf ($2);exit}' /proc/cpuinfo) -Time=$(grep "Total time" /tmp/coremark.log | awk '{print $4}') -[[ -z "${Processer}" ]] && Processer=Unknown - -echo -e "\nProcesser: ${Processer}\nScore: ${Scores}\nTime costs: ${Time}" -echo "(CPU Mark: ${Scores} Scores)" > /etc/bench.log - -if [ -f "/etc/bench.log" ]; then - sed -i '/coremark/d' /etc/crontabs/root - crontab /etc/crontabs/root -fi \ No newline at end of file diff --git a/Scripts/AutoBuild_Function.sh b/Scripts/AutoBuild_Function.sh index 69feaa4..dbd0697 100755 --- a/Scripts/AutoBuild_Function.sh +++ b/Scripts/AutoBuild_Function.sh @@ -209,7 +209,7 @@ Firmware-Diy_Base() { Replace_File CustomFiles/Depends/base-files-essential package/base-files/files/lib/upgrade/keep.d case "${Openwrt_Author}" in coolsnowwolf) - Replace_File CustomFiles/Depends/coremark_lede.sh package/lean/coremark coremark.sh + Replace_File CustomFiles/Depends/coremark.sh package/feeds/packages/coremark Replace_File CustomFiles/Depends/cpuinfo_x86 package/lean/autocore/files/x86/sbin cpuinfo AddPackage git other helloworld fw876 master sed -i 's/143/143,8080/' $(PKG_Finder d package luci-app-ssr-plus)/root/etc/init.d/shadowsocksr @@ -218,7 +218,6 @@ Firmware-Diy_Base() { # [[ ${INCLUDE_DRM_I915} == true ]] && Replace_File CustomFiles/Depends/i915-5.4 target/linux/x86 config-5.4 ;; immortalwrt) - Replace_File CustomFiles/Depends/coremark_ImmortalWrt.sh package/base-files/files/etc coremark.sh Replace_File CustomFiles/Depends/ImmortalWrt package/base-files/files/etc openwrt_release Replace_File CustomFiles/Depends/cpuinfo_x86 package/lean/autocore/files/x86/sbin cpuinfo sed -i "s?Template?Compiled by ${Author} [${Display_Date}]?g" ${Version_File}