Home | History | Annotate | Download | only in sysroot_wrapper
      1 #!/bin/bash -u
      2 #
      3 # Copyright 2016 Google Inc. All Rights Reserved.
      4 #
      5 # This script is part of the ChromeOS object binary search triage process.
      6 # It should be the first script called by the user, after the user has set up
      7 # the two necessary build tree directories (see sysroot_wrapper/README).
      8 #
      9 # This script requires three arguments.  The first argument must be the name of
     10 # the board for which this work is being done (e.g. 'daisy', 'lumpy','parrot',
     11 # etc.).  The second argument must be the name or IP address of the chromebook
     12 # on which the ChromeOS images will be pushed and tested. The third argument
     13 # must be the name of the package being bisected (e.g. 'chromeos-chrome',
     14 # 'cryptohome', etc.).
     15 #
     16 # This script generates common/common.sh, which generates enviroment variables
     17 # used by the other scripts in the object file binary search triage process.
     18 #
     19 
     20 # Set up basic variables.
     21 bisect_dir=${BISECT_DIR:-/tmp/sysroot_bisect}
     22 
     23 BOARD=$1
     24 REMOTE=$2
     25 PACKAGE=$3
     26 
     27 GOOD_BUILD=${bisect_dir}/good
     28 BAD_BUILD=${bisect_dir}/bad
     29 GOOD_LIST=${GOOD_BUILD}/_LIST
     30 BAD_LIST=${BAD_BUILD}/_LIST
     31 
     32 #
     33 # Verify that the necessary directories exist.
     34 #
     35 
     36 if [[ ! -d ${GOOD_BUILD} ]] ; then
     37     echo "Error:  ${GOOD_BUILD} does not exist."
     38     exit 1
     39 fi
     40 
     41 if [[ ! -d ${BAD_BUILD} ]] ; then
     42     echo "Error:  ${BAD_BUILD} does not exist."
     43     exit 1
     44 fi
     45 
     46 if [[ ! -e ${GOOD_LIST} ]] ; then
     47     echo "Error:  ${GOOD_LIST} does not exist."
     48     exit 1
     49 fi
     50 
     51 if [[ ! -e ${BAD_LIST} ]] ; then
     52     echo "Error: ${BAD_LIST} does not exist."
     53     exit 1
     54 fi
     55 
     56 COMMON_FILE="common/common.sh"
     57 
     58 cat <<-EOF > ${COMMON_FILE}
     59 
     60 BISECT_BOARD=${BOARD}
     61 BISECT_REMOTE=${REMOTE}
     62 BISECT_PACKAGE=${PACKAGE}
     63 BISECT_MODE="OBJECT_MODE"
     64 
     65 bisect_dir=${bisect_dir}
     66 
     67 export BISECT_STAGE=TRIAGE
     68 
     69 EOF
     70 
     71 chmod 755 ${COMMON_FILE}
     72 
     73 exit 0
     74