variant: check for gen_config on the PATH before running

This ensures that gen_config is available before the script runs, and
fails with instructions for adding it if it is not available.

BUG=b:172835923
TEST=remove gen_config from path and run fw_build_config.sh directly,
  then again after adding to path with the instructions from the script.

Change-Id: I39f684d24ffdd0205652f7c3d900621f88f28bb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2527604
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Commit-Queue: Matthew Ziegelbaum <ziegs@chromium.org>
Tested-by: Matthew Ziegelbaum <ziegs@chromium.org>
diff --git a/contrib/variant/fw_build_config.sh b/contrib/variant/fw_build_config.sh
index e07af62..de5e601 100755
--- a/contrib/variant/fw_build_config.sh
+++ b/contrib/variant/fw_build_config.sh
@@ -14,6 +14,13 @@
   exit 1
 fi
 
+if ! hash gen_config 2>/dev/null; then
+  echo "gen_config is not on your PATH."
+  echo "Run the following before continuing:"
+  echo "echo 'export PATH=\$PATH:~/trunk/src/config/bin' >> ~/.bashrc && source ~/.bashrc"
+  exit 1
+fi
+
 if [[ "$#" -lt 2 ]]; then
   echo "Usage: ${SCRIPT} base_name variant_name [bug_number]"
   echo "e.g. ${SCRIPT} puff wyvern b:158269582"