aboutsummaryrefslogtreecommitdiff
path: root/binary_search_tool/sysroot_wrapper/test_setup_host.sh
blob: e61bc36746ba9d0e9f09e47408385bd83057560a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
#
# Copyright 2017 Google LLC
#
# This is a generic ChromeOS package/image test setup script. It is meant to
# be used for either the object file or package bisection tools. This script
# is intended to be used with host object bisection, to bisect the object
# files in a host package.  Since it deals with a host package, there is no
# building an image or flashing a device -- just building the host package
# itself.
#
# This script is intended to be used by binary_search_state.py, as
# part of the binary search triage on ChromeOS objects and packages. It should
# return '0' if the setup succeeds; and '1' if the setup fails (the image
# could not build or be flashed).
#

export PYTHONUNBUFFERED=1

source common/common.sh


if [[ "${BISECT_MODE}" == "OBJECT_MODE" ]]; then
  echo "EMERGING ${BISECT_PACKAGE}"
  sudo -E emerge ${BISECT_PACKAGE}
  emerge_status=$?

  if [[ ${emerge_status} -ne 0 ]] ; then
    echo "emerging ${BISECT_PACKAGE} returned a non-zero status: $emerge_status"
    exit 1
  fi

  exit 0
fi


exit 0