Brillo: Skip VerifyBranding and SetFirmwareBitmapLocale.

In ChromeOS Core project, the brand code and bmpblk check should be
optional. Therefore we skip the VerifyBranding and SetFirmwareBipmapLocale.

TEST=Manually test finalize in Brillo device
BUG=chrome-os-partner:42819

Change-Id: I02605574d2617e187428d553a94d549b0f31bc82
Reviewed-on: https://chromium-review.googlesource.com/287121
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
diff --git a/py/gooftool/gooftool.py b/py/gooftool/gooftool.py
index 22cc9fa..f52d340 100755
--- a/py/gooftool/gooftool.py
+++ b/py/gooftool/gooftool.py
@@ -124,6 +124,12 @@
     '--rma_mode', action='store_true',
     help='Enable RMA mode, do not check for deprecated components.')
 
+_cros_core_cmd_arg = CmdArg(
+    '--cros_core', action='store_true',
+    help='Finalize for ChromeOS Core devices (may add or remove few test '
+         'items. For example, branding verification or firmware bitmap '
+         'locale settings).')
+
 _hwid_version_cmd_arg = CmdArg(
     '-i', '--hwid-version', default=3, choices=(2, 3), type=int,
     help='Version of HWID to operate on. (default: %(default)s)')
@@ -677,7 +683,8 @@
          _board_cmd_arg,
          _probe_results_cmd_arg,
          _hwid_cmd_arg,
-         _rma_mode_cmd_arg)
+         _rma_mode_cmd_arg,
+         _cros_core_cmd_arg)
 def Verify(options):
   """Verifies if whole factory process is ready for finalization.
 
@@ -701,7 +708,10 @@
   VerifyKeys(options)
   VerifyRootFs(options)
   VerifyTPM(options)
-  VerifyBranding(options)
+  if options.cros_core:
+    logging.info('VerifyBranding is skipped for ChromeOS Core device.')
+  else:
+    VerifyBranding(options)
   VerifyReleaseChannel(options)
 
 
@@ -850,7 +860,8 @@
          _board_cmd_arg,
          _probe_results_cmd_arg,
          _hwid_cmd_arg,
-         _rma_mode_cmd_arg)
+         _rma_mode_cmd_arg,
+         _cros_core_cmd_arg)
 def Finalize(options):
   """Verify system readiness and trigger transition into release state.
 
@@ -869,7 +880,10 @@
   Verify(options)
   LogSourceHashes(options)
   UntarStatefulFiles(options)
-  SetFirmwareBitmapLocale(options)
+  if options.cros_core:
+    logging.info('SetFirmwareBitmapLocale is skipped for ChromeOS Core device.')
+  else:
+    SetFirmwareBitmapLocale(options)
   ClearGBBFlags(options)
   ClearFactoryVPDEntries(options)
   GenerateStableDeviceSecret(options)