setup_board: load all hooks in one go

No need to setup these hooks in their own set of sudo commands,
so merge with the existing block to avoid another sudo.

Also install all hooks that are available in case we want to add
more in the future (we probably do).

BUG=None
TEST=`./setup_board --board=daisy --skip_chroot_upgrade --regen_configs` created install hooks

Change-Id: Idcd64afc32c81fcc2b4a712992c5ee0edf5ae0d4
Reviewed-on: https://gerrit.chromium.org/gerrit/36474
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Mike Frysinger 2012-10-24 17:39:38 -04:00 committed by Gerrit
parent b36c52784f
commit 1d107dc1f7

View File

@ -531,15 +531,13 @@ cmds=(
"touch /etc/make.conf.user"
"ln -sf /etc/make.globals '${BOARD_ROOT}/etc/make.globals'"
"ln -sf /etc/make.conf.user '${BOARD_ROOT}/etc/make.conf.user'"
"mkdir -p '${BOARD_ROOT}/etc/portage/hooks'"
)
for d in "${SCRIPTS_DIR}"/hooks/*; do
cmds+=( "ln -sfT '${d}' '${BOARD_ROOT}/etc/portage/hooks/${d##*/}'" )
done
sudo_multi "${cmds[@]}"
# Set up post_install hooks that run qa on ELF binaries.
sudo_multi \
"mkdir -p '${BOARD_ROOT}/etc/portage/hooks'" \
"ln -sfT '${SCRIPTS_DIR}/hooks/install' \
'${BOARD_ROOT}/etc/portage/hooks/install'"
# Select the profile to build based on the board and profile passed to
# setup_board. The developer can later change profiles by running
# cros_choose_profile manually.