From ed505602ec6eba80bece4b936d3bf923cd7c4ebe Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Fri, 11 Sep 2020 12:23:25 -0600 Subject: [PATCH] Don't attempt to flash EC if not on 76ec --- scripts/flash.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/flash.sh b/scripts/flash.sh index 1eed421..9cafe26 100755 --- a/scripts/flash.sh +++ b/scripts/flash.sh @@ -37,7 +37,14 @@ then if [ -e "build/${MODEL}/ec.rom" ] then cargo build --release --manifest-path ec/tool/Cargo.toml - sudo ec/tool/target/release/system76_ectool flash "build/${MODEL}/ec.rom" + ECTOOL=ec/tool/target/release/system76_ectool + + if sudo $ECTOOL info &> /dev/null + then + sudo $ECTOOL flash "build/${MODEL}/ec.rom" + else + echo "WARNING: Skipping EC flash: Could not get System76 EC info" + fi fi else echo "Skipping EC flash"