crosutils: disallow running build_packages/setup_board as root

Running these as root does not make sense. Furthermore, it will fail
on calling cros-workon, which sometimes fails but most certainly will
not give correct information anyway.

BUG=chromium-os:30384
TEST=run build_packages/setup_board with/without sudo

Change-Id: I0cba72334369e35ba0e864c53fd81037ee9e0efa
Reviewed-on: https://gerrit.chromium.org/gerrit/23003
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
This commit is contained in:
Zdenek Behan 2012-05-18 03:07:28 +02:00 committed by Gerrit
parent 4d8c285509
commit 05780783a9
2 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,8 @@ restart_in_chroot_if_needed "$@"
get_default_board get_default_board
assert_not_root_user
# Developer-visible flags. # Developer-visible flags.
DEFINE_string board "${DEFAULT_BOARD}" \ DEFINE_string board "${DEFAULT_BOARD}" \
"The board to build packages for." "The board to build packages for."

View File

@ -12,6 +12,8 @@ restart_in_chroot_if_needed "$@"
get_default_board get_default_board
assert_not_root_user
# Developer-visible flags. # Developer-visible flags.
DEFINE_string board "$DEFAULT_BOARD" \ DEFINE_string board "$DEFAULT_BOARD" \
"The name of the board to set up." "The name of the board to set up."