From 7a7051a9e8de7773ee3cc21c9b18d7441b86e245 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 18 Apr 2019 19:22:53 +0800 Subject: [PATCH] coremark: auto-run benchmark just onece --- package/lean/coremark/Makefile | 4 +++- package/lean/coremark/coremark | 5 +++++ package/lean/coremark/coremark.sh | 7 ++++++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 package/lean/coremark/coremark diff --git a/package/lean/coremark/Makefile b/package/lean/coremark/Makefile index 2edb3697b..bd0e86d3c 100644 --- a/package/lean/coremark/Makefile +++ b/package/lean/coremark/Makefile @@ -15,7 +15,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=coremark -PKG_RELEASE:=8 +PKG_RELEASE:=10 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/eembc/coremark.git @@ -57,6 +57,8 @@ define Package/coremark/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/coremark $(1)/bin/ $(INSTALL_DIR) $(1)/etc $(INSTALL_BIN) ./coremark.sh $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./coremark $(1)/etc/uci-defaults/xxx-coremark endef define Package/coremark/postinst diff --git a/package/lean/coremark/coremark b/package/lean/coremark/coremark new file mode 100755 index 000000000..a2f84725d --- /dev/null +++ b/package/lean/coremark/coremark @@ -0,0 +1,5 @@ +#!/bin/sh + +sed -i '/coremark/d' /etc/crontabs/root +echo "0 4 * * 0 /etc/coremark.sh" >> /etc/crontabs/root +crontab /etc/crontabs/root \ No newline at end of file diff --git a/package/lean/coremark/coremark.sh b/package/lean/coremark/coremark.sh index d6d60e09b..c2a99b376 100755 --- a/package/lean/coremark/coremark.sh +++ b/package/lean/coremark/coremark.sh @@ -4,4 +4,9 @@ cat /tmp/coremark.log | grep "CoreMark 1.0" | cut -d "/" -f 1 > /tmp/bench.log sed -i 's/CoreMark 1.0/(CpuMark/g' /tmp/bench.log -echo " Scores)" >> /tmp/bench.log \ No newline at end of file +echo " Scores)" >> /tmp/bench.log + +if [ -f "/tmp/bench.log" ]; then + sed -i '/coremark/d' /etc/crontabs/root + crontab /etc/crontabs/root +fi \ No newline at end of file