diff options
Diffstat (limited to 'util/mainboard/google/create_coreboot_variant.sh')
-rwxr-xr-x | util/mainboard/google/create_coreboot_variant.sh | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/util/mainboard/google/create_coreboot_variant.sh b/util/mainboard/google/create_coreboot_variant.sh index 14b2115d18..dcbacb99cd 100755 --- a/util/mainboard/google/create_coreboot_variant.sh +++ b/util/mainboard/google/create_coreboot_variant.sh @@ -13,29 +13,32 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -VERSION="1.0.2" +VERSION="2.0.0" SCRIPT=$(basename -- "${0}") export LC_ALL=C -if [[ "$#" -lt 2 ]]; then - echo "Usage: ${SCRIPT} base_name variant_name [bug_number]" - echo "e.g. ${SCRIPT} hatch kohaku b:140261109" +if [[ "$#" -lt 3 ]]; then + echo "Usage: ${SCRIPT} base_name reference_name variant_name [bug_number]" + echo "e.g. ${SCRIPT} hatch hatch kohaku b:140261109" + echo "e.g. ${SCRIPT} zork trembyle dalboz" echo "* Adds a new variant of the baseboard to Kconfig and Kconfig.name" echo "* Copies the template files for the baseboard to the new variant" exit 1 fi -# This is the name of the base board that we're using to make the variant. +# This is the name of the base board # ${var,,} converts to all lowercase. BASE="${1,,}" +# This is the name of the reference board that we're using to make the variant. +REFERENCE="${2,,}" # This is the name of the variant that is being cloned. # ${var,,} converts to all lowercase; ${var^^} is all uppercase. -VARIANT="${2,,}" +VARIANT="${3,,}" VARIANT_UPPER="${VARIANT^^}" # Assign BUG= text, or "None" if that parameter wasn't specified. -BUG=${3:-None} +BUG=${4:-None} # This script lives in util/mainboard/google # The template files are in util/mainboard/google/${BASE}/templates @@ -61,6 +64,10 @@ git checkout -b "coreboot_${VARIANT}_${DATE}" || exit 1 # Copy the template tree to the target. mkdir -p "variants/${VARIANT}/" cp -pr "${SRC}/${BASE}/template/." "variants/${VARIANT}/" +if [[ -e "variants/${VARIANT}/Kconfig" ]]; then + sed -i -e "s/BOARD_GOOGLE_TEMPLATE/BOARD_GOOGLE_${VARIANT_UPPER}/" \ + "variants/${VARIANT}/Kconfig" +fi git add "variants/${VARIANT}/" # Now add the new variant to Kconfig and Kconfig.name @@ -75,12 +82,13 @@ git add Kconfig Kconfig.name # Now commit the files. git commit -sm "${BASE}: Create ${VARIANT} variant -Create the ${VARIANT} variant of the ${BASE} baseboard by -copying the baseboard template files to a new directory -named for the variant. +Create the ${VARIANT} variant of the ${REFERENCE} reference +board by copying the template files to a new directory named +for the variant. (Auto-Generated by ${SCRIPT} version ${VERSION}). BUG=${BUG} +BRANCH=None TEST=util/abuild/abuild -p none -t google/${BASE} -x -a make sure the build includes GOOGLE_${VARIANT_UPPER}" |