Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: bin/cros_revert_image.sh

Issue 6240018: This starts to fix the scripts so that they load from /usr/lib/crosutils (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: fixing bad merge Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bin/cros_resign_image.sh ('k') | bin/cros_run_vm_test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
2 5
3 # Usage: 6 # Usage:
4 # revert_image.sh [image_to_revert] 7 # revert_image.sh [image_to_revert]
5 # 8 #
6 # This assumes the image has been updated by update_image.sh. 9 # This assumes the image has been updated by update_image.sh.
7 usage() 10 usage()
8 { 11 {
9 cat <<EOF 12 cat <<EOF
10 13
11 usage: 14 usage:
12 revert_image.sh [image_to_revert] 15 revert_image.sh [image_to_revert]
13 EOF 16 EOF
14 } 17 }
15 18
16 if [[ $# < 1 ]]; then 19 if [[ $# < 1 ]]; then
17 echo "Not enough arguments supplied." 20 echo "Not enough arguments supplied."
18 usage 21 usage
19 exit 1 22 exit 1
20 fi 23 fi
21 24
22 IMAGE=$( readlink -f ${1} ) 25 IMAGE=$(readlink -f "$1")
23 IMAGE_DIR=$( dirname ${IMAGE} ) 26 IMAGE_DIR=$(dirname "$IMAGE")
24 27
25 if [[ -z "${IMAGE}" ]]; then 28 if [[ -z "$IMAGE" ]]; then
26 echo "Missing required argument 'image_to_revert'" 29 echo "Missing required argument 'image_to_revert'"
27 usage 30 usage
28 exit 1 31 exit 1
29 fi 32 fi
30 33
31 cd ${IMAGE_DIR} 34 cd "$IMAGE_DIR"
32 35
33 if [[ ! -d "./orig_partitions" ]]; then 36 if [[ ! -d "./orig_partitions" ]]; then
34 echo "Could not find original partitions." 37 echo "Could not find original partitions."
35 exit 1 38 exit 1
36 fi 39 fi
37 40
38 yes | cp ./orig_partitions/* ./ 41 cp -f ./orig_partitions/* ./
39 42
40 ./pack_partitions.sh ${IMAGE} 43 ./pack_partitions.sh "$IMAGE"
41 rm -rf ./orig_partitions 44 rm -rf ./orig_partitions
42 cd -
OLDNEW
« no previous file with comments | « bin/cros_resign_image.sh ('k') | bin/cros_run_vm_test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698