image_signing: unify board extraction logic from lsb-release

We had two places extracting the board value from lsb-release and parsing
the output by hand.  Unify them to use the same parsing logic to avoid
desynchronized behavior.

We also create a new get_boardvar_from_lsb_release helper to unify the
board name -> variable name mangling logic.

BUG=chromium:667192
TEST=`./security_test_image --board samus` still detects the correct board
BRANCH=None

Change-Id: If88a8ae59b9c9fd45ddd796653a0173ed0186d2d
Reviewed-on: https://chromium-review.googlesource.com/414224
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
4 files changed