| 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 # Downloads the latest buildbot image and prints the path to it. | 7 # Downloads the latest buildbot image and prints the path to it. |
| 8 # This script only works if you have access to buildbot images. | 8 # This script only works if you have access to buildbot images. |
| 9 | 9 |
| 10 # Load common constants. This should be the first executable line. | 10 # Load common constants. This should be the first executable line. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 # Check on the board that they are trying to set up. | 24 # Check on the board that they are trying to set up. |
| 25 if [ -z "$FLAGS_board" ] ; then | 25 if [ -z "$FLAGS_board" ] ; then |
| 26 die "Error: --board required." | 26 die "Error: --board required." |
| 27 fi | 27 fi |
| 28 | 28 |
| 29 IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}" | 29 IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}" |
| 30 | 30 |
| 31 if [ $FLAGS_board = x86-generic ]; then | 31 if [ $FLAGS_board = x86-generic ]; then |
| 32 if [ "$FLAGS_incremental" -eq "$FLAGS_TRUE" ]; then | 32 if [ "$FLAGS_incremental" -eq "$FLAGS_TRUE" ]; then |
| 33 URL_PREFIX="http://codg174.jail.google.com/archive/x86-generic-inc" | 33 URL_PREFIX="https://sandbox.google.com/storage/chromeos-archive/x86-generic-
bin" |
| 34 else | 34 else |
| 35 URL_PREFIX="http://codg163.jail.google.com/archive/x86-generic-rel" | 35 URL_PREFIX="https://sandbox.google.com/storage/chromeos-archive/x86-generic-
rel" |
| 36 fi | 36 fi |
| 37 else | 37 else |
| 38 die "Unrecognized board: $FLAGS_board" | 38 die "Unrecognized board: $FLAGS_board" |
| 39 fi | 39 fi |
| 40 | 40 |
| 41 LATEST_BUILD=$(curl -s $URL_PREFIX/LATEST) | 41 read -p "Username [${LOGNAME}]: " GSDCURL_USERNAME |
| 42 export GSDCURL_USERNAME |
| 43 read -s -p "Password: " GSDCURL_PASSWORD |
| 44 export GSDCURL_PASSWORD |
| 45 |
| 46 LATEST_BUILD=$(bin/cros_gsdcurl.py -s $URL_PREFIX/LATEST) |
| 42 LATEST_IMAGE_DIR="$IMAGES_DIR/$LATEST_BUILD" | 47 LATEST_IMAGE_DIR="$IMAGES_DIR/$LATEST_BUILD" |
| 43 if [ ! -e $LATEST_IMAGE_DIR/chromiumos_base_image.bin ]; then | 48 if [ ! -e $LATEST_IMAGE_DIR/chromiumos_base_image.bin ]; then |
| 44 mkdir -p $LATEST_IMAGE_DIR | 49 mkdir -p $LATEST_IMAGE_DIR |
| 45 curl $URL_PREFIX/$LATEST_BUILD/image.zip -o $LATEST_IMAGE_DIR/image.zip \ | 50 bin/cros_gsdcurl.py $URL_PREFIX/$LATEST_BUILD/image.zip -o \ |
| 51 $LATEST_IMAGE_DIR/image.zip \ |
| 46 || die "Could not download image.zip" | 52 || die "Could not download image.zip" |
| 47 ( cd $LATEST_IMAGE_DIR && unzip -qo image.zip ) \ | 53 ( cd $LATEST_IMAGE_DIR && unzip -qo image.zip ) \ |
| 48 || die "Could not unzip image.zip" | 54 || die "Could not unzip image.zip" |
| 49 fi | 55 fi |
| 50 | 56 |
| 51 echo $LATEST_IMAGE_DIR | 57 echo $LATEST_IMAGE_DIR |
| 52 exit 0 | 58 exit 0 |
| OLD | NEW |