new_variant: add support for Guybrush

Add support for creating new variants of Guybrush, specifically
'guybrush'.

BUG=b:195354362
TEST=`new_variant_fulltest.sh guybrush && echo PASS`

Change-Id: If1a8c8edc8382a2071da9653692e1b55abb974b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/3075256
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
Tested-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
Auto-Submit: Bhanu Prakash Maiya <bhanumaiya@google.com>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
diff --git a/contrib/variant/guybrush.py b/contrib/variant/guybrush.py
new file mode 100644
index 0000000..1cd87c0
--- /dev/null
+++ b/contrib/variant/guybrush.py
@@ -0,0 +1,72 @@
+# -*- coding: utf-8 -*-
+"""Define steps, package names, and directories for creating a Guybrush variant
+
+Copyright 2021 The Chromium OS Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+"""
+
+from __future__ import print_function
+import step_names
+
+# Name of the baseboard
+base = 'guybrush'
+
+# List of steps (named in step_names.py) to run in sequence to create
+# the new variant of the baseboard
+step_list = [
+    step_names.PROJECT_CONFIG,
+    step_names.FW_BUILD_CONFIG,
+    step_names.CB_VARIANT,
+    step_names.CB_CONFIG,
+    step_names.CRAS_CONFIG,
+    step_names.EC_IMAGE,
+    step_names.EMERGE,
+    step_names.PUSH,
+    step_names.FIND,
+    step_names.UPLOAD,
+    step_names.CALC_CQ_DEPEND,
+    step_names.ADD_CQ_DEPEND,
+    step_names.RE_UPLOAD,
+    step_names.CLEAN_UP]
+
+# Base directory for coreboot
+coreboot_dir = 'third_party/coreboot'
+
+# List of packages to cros_workon
+workon_pkgs = ['coreboot', 'chromeos-ec', 'chromeos-config-bsp-guybrush-private']
+
+# The emerge command
+emerge_cmd = 'emerge-guybrush'
+
+# List of packages to emerge
+emerge_pkgs = [
+    'coreboot', 'vboot_reference',
+    'chromeos-ec', 'chromeos-config-bsp-guybrush-private',
+    'chromeos-config', 'chromeos-config-bsp',
+    'coreboot-private-files', 'chromeos-bootimage']
+
+# List of packages to cros_workon to build the project config
+config_workon_pkgs = ['chromeos-config', 'chromeos-config-bsp-guybrush-private']
+
+# List of packages to emerge to build the project config
+config_emerge_pkgs = [
+    'chromeos-config-bsp', 'chromeos-config',
+    'chromeos-config-bsp-guybrush-private']
+
+# List of commits that will be uploaded with `repo upload`
+repo_upload_list = [
+    step_names.CB_CONFIG, step_names.CRAS_CONFIG, step_names.EC_IMAGE,
+    step_names.FW_BUILD_CONFIG]
+
+# List of commits that will be pushed to review.coreboot.org
+coreboot_push_list = [step_names.CB_VARIANT]
+
+# List of steps that depend on other steps, and what those are.
+# This list gets used for setting up Cq-Depend on the uploaded CLs.
+depends = {
+    step_names.CB_CONFIG: [step_names.FIND],
+    step_names.FW_BUILD_CONFIG: [
+        step_names.FIND, step_names.CB_CONFIG,
+        step_names.CRAS_CONFIG, step_names.EC_IMAGE, step_names.COMMIT_FIT]
+}
diff --git a/contrib/variant/kconfig.py b/contrib/variant/kconfig.py
index b4cd0a2..33089de 100755
--- a/contrib/variant/kconfig.py
+++ b/contrib/variant/kconfig.py
@@ -34,7 +34,7 @@
     parser.add_argument('--board', type=str, required=True,
                         choices=('hatch', 'volteer', 'trembyle', 'dalboz',
                                  'waddledee', 'waddledoo', 'lalala', 'puff',
-                                 'brya0'),
+                                 'brya0','guybrush'),
                         help='Name of the baseboard')
     parser.add_argument('--variant', type=str, required=True,
                         help='Name of the board variant')
@@ -162,6 +162,10 @@
             print('\nconfig ' + 'BOARD_GOOGLE_' + uppercase, file=outfile)
             print('\tbool "-> ' + capitalized + '"', file=outfile)
             print('\tselect BOARD_GOOGLE_BASEBOARD_BRYA', file=outfile)
+        elif baseboard_name == 'guybrush':
+            print('\nconfig ' + 'BOARD_GOOGLE_' + uppercase, file=outfile)
+            print('\tbool "-> ' + capitalized + '"', file=outfile)
+            print('\tselect BOARD_GOOGLE_BASEBOARD_GUYBRUSH', file=outfile)
         else:
             raise ValueError(f'Unsupported board {baseboard_name}')
 
diff --git a/contrib/variant/testdata/README.md b/contrib/variant/testdata/README.md
index 0e889ee..9e57e89 100644
--- a/contrib/variant/testdata/README.md
+++ b/contrib/variant/testdata/README.md
@@ -89,6 +89,7 @@
 * dalboz (zork)
 * waddledee (dedede)
 * waddledoo (dedede)
+* guybrush
 
 For example, to test that creating a variant of the Waddledee reference board
 still works,
diff --git a/contrib/variant/testdata/new_variant_fulltest.sh b/contrib/variant/testdata/new_variant_fulltest.sh
index 20ffe09..172c976 100755
--- a/contrib/variant/testdata/new_variant_fulltest.sh
+++ b/contrib/variant/testdata/new_variant_fulltest.sh
@@ -151,6 +151,14 @@
     SUPPORTS_DC_VARIANT=1
     ;;
 
+  guybrush)
+    BASE=guybrush
+    NEW=jojo
+    CONFIG_DIR=/mnt/host/source/src/project/guybrush
+    OVERLAY_DIR=/mnt/host/source/src/private-overlays/overlay-guybrush-private/chromeos-base/chromeos-config-bsp-guybrush-private
+    EBUILD=chromeos-config-bsp-guybrush-private-9999.ebuild
+    ;;
+
   *)
     echo Unsupported reference board "${REFERENCE}"
     exit 1