OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # This script sets up a the sysroot for a particular target board. | 7 # This script sets up a the sysroot for a particular target board. |
8 | 8 |
9 # Load common constants. This should be the first executable line. | 9 # Load common constants. This should be the first executable line. |
10 # The path to common.sh should be relative to your script's location. | 10 # The path to common.sh should be relative to your script's location. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 for overlay in ${BOARD_OVERLAY_LIST} ; do | 105 for overlay in ${BOARD_OVERLAY_LIST} ; do |
106 if [ -f "${overlay}/make.conf" ]; then | 106 if [ -f "${overlay}/make.conf" ]; then |
107 BOARD_MAKE_CONF_LIST="${BOARD_MAKE_CONF_LIST} ${overlay}/make.conf" | 107 BOARD_MAKE_CONF_LIST="${BOARD_MAKE_CONF_LIST} ${overlay}/make.conf" |
108 fi | 108 fi |
109 done | 109 done |
110 | 110 |
111 # | 111 # |
112 # Check if there are any board overlays. There should be at least a top | 112 # Check if there are any board overlays. There should be at least a top |
113 # level board specific overlay. | 113 # level board specific overlay. |
114 # | 114 # |
115 PRIMARY_BOARD_OVERLAY="${SRC_ROOT}/overlays/overlay-${BOARD}" | 115 PRIMARY_BOARD_OVERLAY=$($SCRIPTS_DIR/bin/cros_overlay_list \ |
| 116 --board "$BOARD" \ |
| 117 --primary_only) |
116 | 118 |
117 if [ ! -d "${PRIMARY_BOARD_OVERLAY}" ]; then | 119 # |
118 warn "No board overlay found. [${PRIMARY_BOARD_OVERLAY}]" | 120 # Fetch the toolchain from the board overlay. |
119 else | 121 # |
120 # | 122 BOARD_TOOL_CHAIN="${PRIMARY_BOARD_OVERLAY}/toolchain.conf" |
121 # Link make.conf.board to the board overlay's make.conf. It must exist. | 123 FLAGS_toolchain=${FLAGS_toolchain:-$(cat ${BOARD_TOOL_CHAIN})} |
122 # | |
123 BOARD_MAKE_CONF="${PRIMARY_BOARD_OVERLAY}/make.conf" | |
124 | |
125 if [ ! -f "${BOARD_MAKE_CONF}" ]; then | |
126 error "No board make.conf found. [${BOARD_MAKE_CONF}]" | |
127 exit 1 | |
128 fi | |
129 | |
130 # | |
131 # Fetch the toolchain from the board overlay. | |
132 # | |
133 BOARD_TOOL_CHAIN="${PRIMARY_BOARD_OVERLAY}/toolchain.conf" | |
134 | |
135 if [ ! -f "${BOARD_TOOL_CHAIN}" ]; then | |
136 error "No board toolchain.conf found. [${BOARD_TOOL_CHAIN}]" | |
137 exit 1 | |
138 fi | |
139 | |
140 FLAGS_toolchain=${FLAGS_toolchain:-$(cat ${BOARD_TOOL_CHAIN})} | |
141 fi | |
142 | 124 |
143 # Figure out ARCH from the given toolchain | 125 # Figure out ARCH from the given toolchain |
144 # TODO: Move to common.sh as a function after scripts are switched over. | 126 # TODO: Move to common.sh as a function after scripts are switched over. |
145 if [ -z "${FLAGS_toolchain}" ]; then | 127 if [ -z "${FLAGS_toolchain}" ]; then |
146 error "No toolchain specified in board overlay or on command line." | 128 error "No toolchain specified in board overlay or on command line." |
147 exit 1 | 129 exit 1 |
148 fi | 130 fi |
149 | 131 |
150 TC_ARCH=$(echo "$FLAGS_toolchain" | awk -F'-' '{ print $1 }') | 132 TC_ARCH=$(echo "$FLAGS_toolchain" | awk -F'-' '{ print $1 }') |
151 case "$TC_ARCH" in | 133 case "$TC_ARCH" in |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 echo $BOARD_VARIANT > "$GCLIENT_ROOT/src/scripts/.default_board" | 403 echo $BOARD_VARIANT > "$GCLIENT_ROOT/src/scripts/.default_board" |
422 fi | 404 fi |
423 | 405 |
424 echo "Done!" | 406 echo "Done!" |
425 echo "You can use the following wrappers:" | 407 echo "You can use the following wrappers:" |
426 echo " ${EMERGE_WRAPPER}" | 408 echo " ${EMERGE_WRAPPER}" |
427 echo " ${EBUILD_WRAPPER}" | 409 echo " ${EBUILD_WRAPPER}" |
428 echo " ${EQUERY_WRAPPER}" | 410 echo " ${EQUERY_WRAPPER}" |
429 echo " ${PORTAGEQ_WRAPPER}" | 411 echo " ${PORTAGEQ_WRAPPER}" |
430 echo "The SYSROOT is: ${BOARD_ROOT}" | 412 echo "The SYSROOT is: ${BOARD_ROOT}" |
OLD | NEW |