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.

TEST=`./security_test_image --board samus` still detects the correct board

Change-Id: If88a8ae59b9c9fd45ddd796653a0173ed0186d2d
Commit-Ready: Mike Frysinger <>
Tested-by: Mike Frysinger <>
Reviewed-by: Hung-Te Lin <>
Reviewed-by: Nicolas Boichat <>
4 files changed