OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 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 takes a path to a rootfs.ext2 which was generated by | 7 # This script takes a path to a rootfs.ext2 which was generated by |
8 # build_image.sh and generates an image that can be used for auto | 8 # build_image.sh and generates an image that can be used for auto |
9 # update. | 9 # update. |
10 | 10 |
11 set -e | 11 set -e |
12 | 12 |
13 LIB_IMAGE_COMMON="$(dirname "$0")/image_common.sh" | 13 # Load functions designed for image processing |
14 if ! . "$LIB_IMAGE_COMMON"; then | 14 if ! . "$(dirname "$0")/lib/cros_image_common.sh"; then |
15 echo "Missing required library: $LIB_IMAGE_COMMON. Cannot continue." | 15 echo "ERROR: Cannot load required library: lib/cros_image_common.sh; Abort." |
16 exit 1 | 16 exit 1 |
17 fi | 17 fi |
18 | 18 |
19 if [ -z "$2" -o -z "$1" ]; then | 19 if [ -z "$2" -o -z "$1" ] || [ "${#@}" -ne 2 -a "${#@}" -ne 3 ]; then |
20 echo "usage: $0 path/to/kernel_partition_img path/to/rootfs_partition_img" | 20 echo "usage: $0 path/to/kernel_partition_img path/to/rootfs_partition_img" |
21 echo " or $0 path/to/chromiumos_img kern_part_no rootfs_part_no" | 21 echo " or $0 path/to/chromiumos_img kern_part_no rootfs_part_no" |
22 exit 1 | 22 exit 1 |
23 fi | 23 fi |
24 | 24 |
25 if [ "$CROS_GENERATE_UPDATE_PAYLOAD_CALLED" != "1" ]; then | 25 if [ "$CROS_GENERATE_UPDATE_PAYLOAD_CALLED" != "1" ]; then |
26 echo "WARNING:" | 26 echo "WARNING:" |
27 echo " This script should only be called from cros_generate_update_payload" | 27 echo " This script should only be called from cros_generate_update_payload" |
28 echo " Please run that script with --help to see how to use it." | 28 echo " Please run that script with --help to see how to use it." |
29 fi | 29 fi |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 set -- $CS_AND_RET_CODES | 105 set -- $CS_AND_RET_CODES |
106 CALC_CS="$1" | 106 CALC_CS="$1" |
107 shift | 107 shift |
108 RET_CODES="$@" | 108 RET_CODES="$@" |
109 if [ "$RET_CODES" != "$EXPECTED_RET_CODES" ]; then | 109 if [ "$RET_CODES" != "$EXPECTED_RET_CODES" ]; then |
110 echo compression/hash failed. $RET_CODES | 110 echo compression/hash failed. $RET_CODES |
111 exit 1 | 111 exit 1 |
112 fi | 112 fi |
113 | 113 |
114 echo Success. hash is "$CALC_CS" | 114 echo Success. hash is "$CALC_CS" |
OLD | NEW |