OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Script to upload all debug symbols required for crash reporting | 6 # Script to upload all debug symbols required for crash reporting |
7 # purposes. This script need only be used to upload release builds | 7 # purposes. This script need only be used to upload release builds |
8 # symbols or to debug crashes on non-release builds (in which case try | 8 # symbols or to debug crashes on non-release builds (in which case try |
9 # to only upload the symbols for those executables involved). | 9 # to only upload the symbols for those executables involved). |
10 # | 10 # |
11 # NOTE: This script must be run from the chromeos build chroot environment. | 11 # NOTE: This script must be run from the chromeos build chroot environment. |
12 # | 12 # |
13 | 13 |
14 # Load common constants. This should be the first executable line. | 14 # Load common constants. This should be the first executable line. |
15 # The path to common.sh should be relative to your script's location. | 15 # The path to common.sh should be relative to your script's location. |
16 . "$(dirname "$0")/common.sh" | 16 . "$(dirname "$0")/common.sh" |
17 | 17 |
18 # Script must be run inside the chroot | 18 # Script must be run inside the chroot |
19 restart_in_chroot_if_needed $* | 19 restart_in_chroot_if_needed $* |
20 | 20 |
21 get_default_board | 21 get_default_board |
22 | 22 |
23 # Flags | 23 # Flags |
24 DEFINE_string board "$DEFAULT_BOARD" "The board to build packages for." | 24 DEFINE_string board "$DEFAULT_BOARD" "The board to build packages for." |
25 DEFINE_boolean dryrun ${FLAGS_FALSE} "Run without actually uploading." | 25 DEFINE_boolean dryrun ${FLAGS_FALSE} "Run without actually uploading." |
26 DEFINE_boolean verbose ${FLAGS_FALSE} "Be verbose." | 26 DEFINE_boolean verbose ${FLAGS_FALSE} "Be verbose." |
27 DEFINE_boolean yes ${FLAGS_FALSE} "Answer yes to all prompts." | 27 DEFINE_boolean yes ${FLAGS_FALSE} "Answer yes to all prompts." |
28 | 28 |
29 DUMP_SYMS="dump_syms.i386" | 29 DUMP_SYMS="dump_syms" |
30 SYM_UPLOAD="sym_upload.i386" | 30 SYM_UPLOAD="sym_upload" |
31 | 31 |
32 CUMULATIVE_SIZE=0 | 32 CUMULATIVE_SIZE=0 |
33 ANY_ERRORS=0 | 33 ANY_ERRORS=0 |
34 | 34 |
35 SYM_FILE=$(mktemp "/tmp/sym.XXXX") | 35 SYM_FILE=$(mktemp "/tmp/sym.XXXX") |
36 ERR_FILE=$(mktemp "/tmp/err.XXXX") | 36 ERR_FILE=$(mktemp "/tmp/err.XXXX") |
37 | 37 |
38 function cleanup() { | 38 function cleanup() { |
39 rm -f "${SYM_FILE}" "${ERR_FILE}" | 39 rm -f "${SYM_FILE}" "${ERR_FILE}" |
40 } | 40 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 info "Would have uploaded ${CUMULATIVE_SIZE}B of debug information" | 238 info "Would have uploaded ${CUMULATIVE_SIZE}B of debug information" |
239 else | 239 else |
240 info "Uploaded ${CUMULATIVE_SIZE}B of debug information" | 240 info "Uploaded ${CUMULATIVE_SIZE}B of debug information" |
241 fi | 241 fi |
242 | 242 |
243 [ ${ANY_ERRORS} -ne 0 ] && die "Encountered problems" | 243 [ ${ANY_ERRORS} -ne 0 ] && die "Encountered problems" |
244 return 0 | 244 return 0 |
245 } | 245 } |
246 | 246 |
247 main "$@" | 247 main "$@" |
OLD | NEW |