generate: fail if system isn't Linux x86_64

Currently the script will fail anyway (at the protoc lines) if the
system isn't of that architecture, so we might as well make it clear
why that failure would occur.

BUG=chromium:1174238
TEST=local run

Change-Id: I1fd7fb22fc4774efb6a6fa55b18d80e9479473bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra/proto/+/2676167
Auto-Submit: Sean Abraham <seanabraham@chromium.org>
Commit-Queue: LaMont Jones <lamontjones@chromium.org>
Reviewed-by: LaMont Jones <lamontjones@chromium.org>
diff --git a/generate.sh b/generate.sh
index 2fb3838..be0717c 100755
--- a/generate.sh
+++ b/generate.sh
@@ -15,6 +15,13 @@
 trap "rm -rf ${work_dir}" EXIT
 echo "Using temporary directory ${work_dir}"
 
+if [[ "$(uname -s)" != "Linux" || "$(uname -m)" != "x86_64" ]]; then
+  echo "Error: currently generate.sh can only run on Linux x86_64 systems."
+  echo "This is because we use checked-in binaries for protoc-gen-go(-grpc)?."
+  echo "This will change soon though. See https://crbug.com/1174238"
+  exit 1
+fi
+
 if [[ -n ${CHROMIUMOS_CONFIG_DIR+x} ]]; then
   echo "CHROMIUMOS_CONFIG_DIR is set: " \
     "Copying sources from ${CHROMIUMOS_CONFIG_DIR}/"