Fix key incremental test image creation.

The key incremental test using fm_and_key_version_test_prep.sh won't abort if
the image creation process failed. That may lead to incorrect test results
because update payloads won't get signed. To catch that error, we should abort
when any commands in fm_and_key_version_test_prep.sh returns non-zero value.

Another issue is, due to issue http://crosbug.com/p/33719 , running
fm_and_key_version_test_prep on ToT against an old image (using old version of
shar) may abort image signing. To workaround that, we have to change the shar
command before changing firmware updater.

BUG=chrome-os-partner:33763
TEST=./fm_and_key_version_test_prep.sh -i IMAGE -f PATTERN -s FILE -v NAME
     And then manually check partition #2 of output images - hash changed.

Change-Id: Idab09c81020ac8d0d711c90fc89475716821dbb6
Reviewed-on: https://chromium-review.googlesource.com/230299
Reviewed-by: danny chan <dchan@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
1 file changed