| 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 if [ -z "$2" -o -z "$1" ]; then | 13 if [ -z "$2" -o -z "$1" ]; then |
| 14 echo "usage: $0 path/to/kernel_partition_img path/to/rootfs_partition_img" | 14 echo "usage: $0 path/to/kernel_partition_img path/to/rootfs_partition_img" |
| 15 exit 1 | 15 exit 1 |
| 16 fi | 16 fi |
| 17 | 17 |
| 18 if [ "$CROS_GENERATE_UPDATE_PAYLOAD_CALLED" != "1" ]; then | 18 if [ "$CROS_GENERATE_UPDATE_PAYLOAD_CALLED" != "1" ]; then |
| 19 echo "WARNING:" |
| 19 echo "This script should only be called from cros_generate_update_payload" | 20 echo "This script should only be called from cros_generate_update_payload" |
| 20 echo "Please run that script with --help to see how to use it." | 21 echo "Please run that script with --help to see how to use it." |
| 21 exit 1 | |
| 22 fi | 22 fi |
| 23 | 23 |
| 24 if [ $(whoami) = "root" ]; then | 24 if [ $(whoami) = "root" ]; then |
| 25 echo "running $0 as root which is unneccessary" | 25 echo "running $0 as root which is unneccessary" |
| 26 fi | 26 fi |
| 27 | 27 |
| 28 KPART="$1" | 28 KPART="$1" |
| 29 ROOT_PART="$2" | 29 ROOT_PART="$2" |
| 30 | 30 |
| 31 KPART_SIZE=$(stat -c%s "$KPART") | 31 KPART_SIZE=$(stat -c%s "$KPART") |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 shift | 71 shift |
| 72 RET_CODES="$@" | 72 RET_CODES="$@" |
| 73 if [ "$RET_CODES" != "$EXPECTED_RET_CODES" ]; then | 73 if [ "$RET_CODES" != "$EXPECTED_RET_CODES" ]; then |
| 74 echo compression/hash failed. $RET_CODES | 74 echo compression/hash failed. $RET_CODES |
| 75 exit 1 | 75 exit 1 |
| 76 fi | 76 fi |
| 77 | 77 |
| 78 rm "$UNCOMPRESSED_OUT_FILE" | 78 rm "$UNCOMPRESSED_OUT_FILE" |
| 79 | 79 |
| 80 echo Success. hash is "$CALC_CS" | 80 echo Success. hash is "$CALC_CS" |
| OLD | NEW |