summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-11-06 00:37:56 (EST)
committer P. J. McDermott <pj@pehjota.net>2015-11-06 00:37:56 (EST)
commit37ec7327dbd692a6969bcc556c0f3758ad3dda91 (patch)
tree2993edd676d57aa670b5fbc1e28ea7b9df520a6b
parent41f764da19048fc2e9ec583c37de73de915811d2 (diff)
downloadfirman.sh-37ec7327dbd692a6969bcc556c0f3758ad3dda91.zip
firman.sh-37ec7327dbd692a6969bcc556c0f3758ad3dda91.tar.gz
firman.sh-37ec7327dbd692a6969bcc556c0f3758ad3dda91.tar.bz2
do_update(): Fix error handling
What idiot messed up this return logic?
-rw-r--r--src/action/update.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/action/update.sh b/src/action/update.sh
index 477300f..b0e228d 100644
--- a/src/action/update.sh
+++ b/src/action/update.sh
@@ -130,9 +130,7 @@ do_update()
# Write the ROM to flash.
info 'Installing new firmware...'
- if flashrom_write "$(board_get_chip)"; then
- info 'Firmware installation complete'
- sleep 5
+ if ! flashrom_write "$(board_get_chip)"; then
rm_temp 'rom'
return 1
fi
@@ -140,5 +138,8 @@ do_update()
# Clean up the ROM.
rm_temp 'rom'
+ info 'Firmware installation complete'
+ sleep 5
+
return 0
}