copy file and compute sha256 before flashing

This commit is contained in:
Trammell Hudson 2017-04-12 06:50:18 -04:00
parent 7a9ab72144
commit 84f1d0af39
Failed to extract signature

View File

@ -1,4 +1,13 @@
#!/bin/sh
. /etc/functions
ROM="$1"
if [ -z "$1" ]; then
die "Usage: $0 /media/x230.rom"
fi
cp "$ROM" /tmp/x230.rom
sha256sum /tmp/x230.rom
flashrom \
--force \
@ -6,4 +15,8 @@ flashrom \
--programmer internal \
--layout /etc/x230-layout.txt \
--image BIOS \
-w "$*"
-w /tmp/x230.rom \
|| die "$ROM: Flash failed"
warn "Reboot and hopefully it works..."
exit 0