| 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 LIB_CROS_IMAGE_COMMON="$(dirname "$0")/lib/cros_image_common.sh" |
| 15 echo "Missing required library: $LIB_IMAGE_COMMON. Cannot continue." | 15 [ -f "$LIB_CROS_IMAGE_COMMON" ] || |
| 16 LIB_CROS_IMAGE_COMMON="$(dirname "$0")/cros_image_common.sh" |
| 17 if ! . "$LIB_CROS_IMAGE_COMMON"; then |
| 18 echo "ERROR: Cannot load required library: $LIB_CROS_IMAGE_COMMON. Abort." |
| 16 exit 1 | 19 exit 1 |
| 17 fi | 20 fi |
| 18 | 21 |
| 19 if [ -z "$2" -o -z "$1" ]; then | 22 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" | 23 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" | 24 echo " or $0 path/to/chromiumos_img kern_part_no rootfs_part_no" |
| 22 exit 1 | 25 exit 1 |
| 23 fi | 26 fi |
| 24 | 27 |
| 25 if [ "$CROS_GENERATE_UPDATE_PAYLOAD_CALLED" != "1" ]; then | 28 if [ "$CROS_GENERATE_UPDATE_PAYLOAD_CALLED" != "1" ]; then |
| 26 echo "WARNING:" | 29 echo "WARNING:" |
| 27 echo " This script should only be called from cros_generate_update_payload" | 30 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." | 31 echo " Please run that script with --help to see how to use it." |
| 29 fi | 32 fi |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 set -- $CS_AND_RET_CODES | 108 set -- $CS_AND_RET_CODES |
| 106 CALC_CS="$1" | 109 CALC_CS="$1" |
| 107 shift | 110 shift |
| 108 RET_CODES="$@" | 111 RET_CODES="$@" |
| 109 if [ "$RET_CODES" != "$EXPECTED_RET_CODES" ]; then | 112 if [ "$RET_CODES" != "$EXPECTED_RET_CODES" ]; then |
| 110 echo compression/hash failed. $RET_CODES | 113 echo compression/hash failed. $RET_CODES |
| 111 exit 1 | 114 exit 1 |
| 112 fi | 115 fi |
| 113 | 116 |
| 114 echo Success. hash is "$CALC_CS" | 117 echo Success. hash is "$CALC_CS" |
| OLD | NEW |