util/mb/google/hatch: script can take optional bug parameter

When creating a new variant, adding a bug parameter after the name
of the variant will populate the BUG= field in the commit message.
If the parameter is not present, then BUG=None.

Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org>
Change-Id: I3e08df5d80a5684c9f3675e3c0a8346240171cd3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35606
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Andrew McRae <amcrae@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
Paul Fagerburg 2019-09-25 09:59:46 -06:00 committed by Patrick Georgi
parent cad708d210
commit 39f3f52b3e
1 changed files with 8 additions and 4 deletions

View File

@ -15,9 +15,9 @@
export LC_ALL=C export LC_ALL=C
if [[ "$#" -ne 1 ]]; then if [[ "$#" -lt 1 ]]; then
echo "Usage: $0 variant_name" echo "Usage: $0 variant_name [b:bug_number]"
echo "e.g. $0 kohaku" echo "e.g. $0 kohaku b:140261109"
echo "Adds a new variant of Hatch to Kconfig and Kconfig.name, creates the" echo "Adds a new variant of Hatch to Kconfig and Kconfig.name, creates the"
echo "skeleton files for acpi, ec, and gpio, copies the makefile for" echo "skeleton files for acpi, ec, and gpio, copies the makefile for"
echo "SPD sources, and sets up a basic overridetree" echo "SPD sources, and sets up a basic overridetree"
@ -34,6 +34,10 @@ BASE="hatch"
VARIANT="${1,,}" VARIANT="${1,,}"
VARIANT_UPPER="${VARIANT^^}" VARIANT_UPPER="${VARIANT^^}"
# Assign text for the "BUG=" part of the commit, or use "None" if that
# parameter wasn't specified.
BUG=${2:-None}
# This script and the templates live in util/mainboard/google/hatch # This script and the templates live in util/mainboard/google/hatch
# We need to create files in src/mainboard/google/hatch # We need to create files in src/mainboard/google/hatch
pushd "${BASH_SOURCE%/*}" || exit 1 pushd "${BASH_SOURCE%/*}" || exit 1
@ -71,7 +75,7 @@ git add Kconfig Kconfig.name
# Now commit the files. # Now commit the files.
git commit -sm "${BASE}: Create ${VARIANT} variant git commit -sm "${BASE}: Create ${VARIANT} variant
BUG=none BUG=${BUG}
TEST=util/abuild/abuild -p none -t google/${BASE} -x -a TEST=util/abuild/abuild -p none -t google/${BASE} -x -a
make sure the build includes GOOGLE_${VARIANT_UPPER}" make sure the build includes GOOGLE_${VARIANT_UPPER}"