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 23 matching lines...) Expand all Loading... |
34 else | 34 else |
35 URL_PREFIX="https://sandbox.google.com/storage/chromeos-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 read -p "Username [${LOGNAME}]: " GSDCURL_USERNAME | 41 read -p "Username [${LOGNAME}]: " GSDCURL_USERNAME |
42 export GSDCURL_USERNAME | 42 export GSDCURL_USERNAME |
43 read -s -p "Password: " GSDCURL_PASSWORD | 43 read -s -p "Password: " GSDCURL_PASSWORD |
44 echo # ... because read -s didn't print a newline | 44 echo >&2 # ... because read -s didn't print a newline |
45 export GSDCURL_PASSWORD | 45 export GSDCURL_PASSWORD |
46 | 46 |
47 LATEST_BUILD=$(bin/cros_gsdcurl.py -s $URL_PREFIX/LATEST) | 47 LATEST_BUILD=$(bin/cros_gsdcurl.py -s $URL_PREFIX/LATEST) |
48 LATEST_IMAGE_DIR="$IMAGES_DIR/$LATEST_BUILD" | 48 LATEST_IMAGE_DIR="$IMAGES_DIR/$LATEST_BUILD" |
49 if [ ! -e $LATEST_IMAGE_DIR/chromiumos_base_image.bin ]; then | 49 if [ ! -e $LATEST_IMAGE_DIR/chromiumos_base_image.bin ]; then |
50 mkdir -p $LATEST_IMAGE_DIR | 50 mkdir -p $LATEST_IMAGE_DIR |
51 bin/cros_gsdcurl.py $URL_PREFIX/$LATEST_BUILD/image.zip -o \ | 51 bin/cros_gsdcurl.py $URL_PREFIX/$LATEST_BUILD/image.zip -o \ |
52 $LATEST_IMAGE_DIR/image.zip \ | 52 $LATEST_IMAGE_DIR/image.zip \ |
53 || die "Could not download image.zip" | 53 || die "Could not download image.zip" |
54 ( cd $LATEST_IMAGE_DIR && unzip -qo image.zip ) \ | 54 ( cd $LATEST_IMAGE_DIR && unzip -qo image.zip ) \ |
55 || die "Could not unzip image.zip" | 55 || die "Could not unzip image.zip" |
56 fi | 56 fi |
57 | 57 |
58 echo $LATEST_IMAGE_DIR | 58 echo $LATEST_IMAGE_DIR |
59 exit 0 | 59 exit 0 |
OLD | NEW |