diff options
author | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2019-10-09 18:39:53 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-29 22:42:40 +0000 |
commit | d2a31bcc109fd8c10397f7b6c6a1e5ead1bdbe38 (patch) | |
tree | 2de3483db98b12d8b18fbe46e1deb0b11d58dd5d | |
parent | 934a5dff33234e01f856117d86e065effd285c92 (diff) | |
download | chrome-ec-d2a31bcc109fd8c10397f7b6c6a1e5ead1bdbe38.tar.gz |
make_linux_ec_commands_h.sh: Fail gracefully outside of chroot
Running make buildall outside of chroot will fail because the
make_linux_ec_commands_h.sh script expects CROS_WORKON_SRCROOT
to be set. Exit gracefully with a message if it is not.
BUG=none
TEST=make buildall outside of chroot
BRANCH=none
Change-Id: I838a3b551405575650f46281598a466d008222e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1851107
Commit-Queue: Stefan Reinauer <reinauer@google.com>
Tested-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
-rwxr-xr-x | util/make_linux_ec_commands_h.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/make_linux_ec_commands_h.sh b/util/make_linux_ec_commands_h.sh index bb53ffda4f..b860e61f65 100755 --- a/util/make_linux_ec_commands_h.sh +++ b/util/make_linux_ec_commands_h.sh @@ -27,6 +27,12 @@ if [ $# -ne 2 ]; then exit 1 fi +if [ ! -d "${CROS_WORKON_SRCROOT}" ]; then + printf "Not in Chrome OS chroot!\n\n" + usage + exit 0 +fi + out_dir="$(dirname "${out}")" mkdir -p "${out_dir}" tmp="$(mktemp -p "${out_dir}" cros_ec_XXX.h)" |