From 25d233b558b7bd2ff94caa4a671531935a660aa5 Mon Sep 17 00:00:00 2001 From: "Igor Zalatov (from Citadel PC)" Date: Sat, 4 Sep 2021 15:54:26 +0300 Subject: [PATCH] Add pqtools script --- general/overlay/usr/sbin/pqtools | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 general/overlay/usr/sbin/pqtools diff --git a/general/overlay/usr/sbin/pqtools b/general/overlay/usr/sbin/pqtools new file mode 100755 index 00000000..6f3d4e85 --- /dev/null +++ b/general/overlay/usr/sbin/pqtools @@ -0,0 +1,49 @@ +#!/bin/sh +# +# OpenIPC.org | v.20210904 +# + +set -e + +mpp=$(awk '/Version:/ {print $3,$4"]"}' /proc/umap/sys) +soc=$(ipctool --chip_id) + + + +prepare() +{ + case ${soc} in + + hi3516av300|hi3516cv500|hi3516dv300) + echo -e "\n\e[1;31mSorry but the ${soc} is not supported at the moment...\e[0m\n" + ;; + + hi3516ev200|hi3516ev300|hi3516dv200|hi3518ev300) + echo -e "\n\e[1;31mA supported processor with ${mpp} was found...\e[0m\n" + ittb_url="https://raw.githubusercontent.com/widgetii/pqtools/master/hi3516ev300/ittb_ev300_V1.0.1.2.tgz" + ittb_folder="ittb_ev300_V1.0.1.2" + ;; + + *) + echo -e "\n\e[1;31mSorry but the ${soc} is not supported at the moment...\e[0m\n" + ;; + + esac +} + + +download() + if [[ -d /tmp/${ittb_folder} ]]; then + echo -e "\n\e[1;31mA directory with utilities was found and the download is not needed...\e[0m\n" + echo -e "\n\e[1;31mWe run the utilities for sensor calibration...\e[0m\n" + cd /tmp/${ittb_folder} ; ./start.sh + else + echo -e "\n\e[1;31mDownloading the latest tools, please wait...\e[0m\n" + curl -s ${ittb_url} | gzip -d - | tar xvf - -C /tmp + echo -e "\n\e[1;31mWe run the utilities for sensor calibration...\e[0m\n" + cd /tmp/${ittb_folder} ; ./start.sh + fi + + + +prepare && download