cros_host: Find BIOS/EC bins with both board and model names

When updating the firmware, we currently look for image-<board>.bin
and <board>/ec.bin for the fw bin names.  However, this will error
out for boards with variants (ie: octopus).  Updating to check for
image-<model>.bin and <model>/ec.bin as well.

BUG=chromium:978161
BRANCH=None
TEST=None

Change-Id: I96e0f0a9f71d49a4811f96821aba3348d32a5ef3
Signed-off-by: Shelley Chen <shchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1674660
Tested-by: Shelley Chen <shchen@chromium.org>
Commit-Ready: Shelley Chen <shchen@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Reviewed-by: Kevin Shelton <kmshelton@chromium.org>
diff --git a/server/cros/servo/servo.py b/server/cros/servo/servo.py
index a0855f7..10d205d 100644
--- a/server/cros/servo/servo.py
+++ b/server/cros/servo/servo.py
@@ -909,16 +909,19 @@
             self.program_bios(os.path.join(dest_dir, image), rw_only)
 
 
-    def program_firmware(self, model, tarball_path, rw_only=False):
+    def program_firmware(self, board, model, tarball_path, rw_only=False):
         """Program firmware (EC, if applied, and BIOS) of the DUT.
 
+        @param board: The DUT board name.
         @param model: The DUT model name.
         @param tarball_path: The path of the downloaded build tarball.
         @param rw_only: True to only install firmware to its RW portions. Keep
                 the RO portions unchanged.
         """
-        ap_image_candidates = ('image.bin', 'image-%s.bin' % model)
-        ec_image_candidates = ('ec.bin', '%s/ec.bin' % model)
+        ap_image_candidates = ('image.bin', 'image-%s.bin' % model,
+                               'image-%s.bin' % board)
+        ec_image_candidates = ('ec.bin', '%s/ec.bin' % model,
+                               '%s/ec.bin' % board)
 
         self._reprogram(tarball_path, 'EC', ec_image_candidates, rw_only)
         self._reprogram(tarball_path, 'BIOS', ap_image_candidates, rw_only)