aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcompile/fw-ectool.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/compile/fw-ectool.sh b/compile/fw-ectool.sh
new file mode 100755
index 0000000..b507359
--- /dev/null
+++ b/compile/fw-ectool.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+# on rhel 9: yum install libusb-devel libftdi-devel
+# Quell the loud fans on the framework 13:
+# sudo $HOME/.local/bin/ectool fanduty 35
+if [ "$(id -u)" -eq 0 ] ; then
+ echo "Run as a regular user"
+ exit 1
+fi
+set -ex
+codedir="${CODEDIR:-$HOME/.local/src}"
+src=https://gitlab.howett.net/DHowett/ectool
+pkgdir="${codedir}/ectool"
+
+if ! [ -d "$pkgdir" ] ; then
+ git clone "$src" "$pkgdir"
+fi
+
+cd "$pkgdir"
+git checkout 0ac6155abbb7d4622d3bcf2cdf026dde2f80dad7
+git reset --hard HEAD
+git clean -fdx .
+mkdir build
+cd -
+cd "$pkgdir/build"
+cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/.local \
+ -Wno-dev
+cmake --build .
+cp src/ectool $HOME/.local/bin/
+cd -
+