sign_cr50_firmware: improve error reporting

In case jq does not find a node in the JSON file, it still returns
with exit code of 0, it just prints 'null' instead of the expected
node value.

This patch adds processing this error condition, which makes it easier
to troubleshoot the case of misconfigured Cr50 signing manifest.

BRANCH=none
BUG=b:74100307
TEST=tried using the script with a manifest which does not have the
     node of board_id_flags defined. Observed error message of

       ...sign_cr50_firmware.sh: ERROR  : bid_flags not found in...

     instead of previous error reported as

       ...sign_cr50_firmware.sh: line 53: null: unbound variable

Change-Id: I70acff7a3331b01f0f964f2942bf2806a2af8691
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1537260
Reviewed-by: Mike Frysinger <vapier@chromium.org>
1 file changed