build_packages: Add internal flag

Add the internal flag as a convenience option for doing an internal
build.

BUG=None
TEST=manual

Change-Id: I2c95a53a56cc26d8af1d285210d6f28c49023b5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/2173298
Tested-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
Commit-Queue: Alex Klein <saklein@chromium.org>
diff --git a/build_packages b/build_packages
index a3617a8..388847b 100755
--- a/build_packages
+++ b/build_packages
@@ -36,6 +36,8 @@
   "Use any Chrome prebuilt available, even if the prebuilt doesn't match exactly."
 DEFINE_boolean cleanbuild "${FLAGS_FALSE}" \
   "Perform a clean build; delete sysroot if it exists before building."
+DEFINE_boolean internal "${FLAGS_FALSE}" \
+  "Build the internal version of chrome (set the chrome_internal USE flag)."
 
 # The --board_root flag specifies the environment variables ROOT and PKGDIR.
 # This allows fetching and emerging of all packages to specified board_root.
@@ -124,6 +126,10 @@
   "chromeos-base/chrome-icu"
 )
 
+if [[ "${FLAGS_internal}" -eq "${FLAGS_TRUE}" ]]; then
+  export USE="${USE} chrome_internal"
+fi
+
 # This is a temporary measure to help the goma team check the configs while
 # they transition their backend service.
 # TODO(crbug.com/1032290): Delete after the goma RBE transition is complete.