gooftool: adapt to new cr50-set-board-id.sh logic

cr50-set-board-id.sh now supports two new arguments:
  - whitelabel_flags
  - whitelabel

For a device that is whitelabel device, but we don't know the actual
whitelabel tag yet (e.g. spare RMA MLB in the factory), we should call
"cr50-set-board-id.sh whitelabel_flags".

When the whitelabel tag is set, we should call
"cr50-set-board-id.sh whitelabel".

This CL makes the finalize process call the later one if this device is
determined to be a whitelabel device (by checking with cros_config).

BUG=b:133159485
TEST=None

Change-Id: I6160dccf33ed0d7ae2b30009881072a34cb93789
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/factory/+/2000256
Reviewed-by: Wei-Han Chen <stimim@chromium.org>
Commit-Queue: Wei-Han Chen <stimim@chromium.org>
Tested-by: Wei-Han Chen <stimim@chromium.org>
diff --git a/py/gooftool/commands.py b/py/gooftool/commands.py
index 2e9e161..0e0e564 100755
--- a/py/gooftool/commands.py
+++ b/py/gooftool/commands.py
@@ -454,9 +454,22 @@
 
 @Command('cr50_set_sn_bits_and_board_id')
 def Cr50SetSnBitsAndBoardId(options):
+  """Deprecated: use Cr50WriteFlashInfo instead."""
+  logging.warning('This function is renamed to Cr50WriteFlashInfo')
+  Cr50WriteFlashInfo(options)
+
+
+@Command('cr50_write_flash_info')
+def Cr50WriteFlashInfo(options):
   """Set the serial number bits, board id and flags on the Cr50 chip."""
-  GetGooftool(options).Cr50SetSnBitsAndBoardId()
-  event_log.Log('cr50_set_sn_bits_and_board_id')
+  GetGooftool(options).Cr50WriteFlashInfo()
+  event_log.Log('cr50_write_flash_info')
+
+
+@Command('cr50_write_whitelabel_flags')
+def Cr50WriteWhitelabelFlags(options):
+  GetGooftool(options).Cr50WriteWhitelabelFlags()
+  event_log.Log('cr50_write_whitelabel_flags')
 
 
 @Command('cr50_disable_factory_mode')
@@ -803,7 +816,7 @@
     GetGooftool(options).WriteVPDForRLZPing(options.embargo_offset)
     if options.generate_mfg_date:
       GetGooftool(options).WriteVPDForMFGDate()
-  Cr50SetSnBitsAndBoardId(options)
+  Cr50WriteFlashInfo(options)
   Cr50DisableFactoryMode(options)
   Verify(options)
   LogSourceHashes(options)