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

Issue 3548013: AU: Add a private_key option to cros_generate_update_payload. (Closed)

Created:
10 years, 2 months ago by petkov
Modified:
9 years, 7 months ago
Reviewers:
adlr
CC:
chromium-os-reviews_chromium.org, Mandeep Singh Baines, anush, sosa
Visibility:
Public.

Description

AU: Add a private_key option to cros_generate_update_payload. BUG=5663 TEST=generated a delta payload Change-Id: I62f2fae07152f67ecbf64d16948e6add1c6ba3db Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=c90b71e

Patch Set 1 #

Patch Set 2 : fix whitespace #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -10 lines) Patch
M cros_generate_update_payload View 1 4 chunks +11 lines, -10 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
petkov
10 years, 2 months ago (2010-10-05 16:04:18 UTC) #1
adlr
10 years, 2 months ago (2010-10-05 17:10:43 UTC) #2
LGTM

On Tue, Oct 5, 2010 at 9:04 AM, <petkov@chromium.org> wrote:

> Reviewers: adlr,
>
> Description:
> AU: Add a private_key option to cros_generate_update_payload.
>
> BUG=5663
> TEST=generated a delta payload
>
> Change-Id: I62f2fae07152f67ecbf64d16948e6add1c6ba3db
>
> Please review this at http://codereview.chromium.org/3548013/show
>
> SVN Base: ssh://git@gitrw.chromium.org:9222/crosutils.git
>
> Affected files:
>  M cros_generate_update_payload
>
>
> Index: cros_generate_update_payload
> diff --git a/cros_generate_update_payload b/cros_generate_update_payload
> index
>
0699f09f475cfc8b0a5a793105b0c9b7a10581f5..f848686d0129e8196418af35d1dc0fd379d929af
> 100755
> --- a/cros_generate_update_payload
> +++ b/cros_generate_update_payload
> @@ -57,7 +57,7 @@ extract_partition_to_temp_file() {
>   local filename="$1"
>   local partition="$2"
>   local temp_file=$(mktemp /tmp/generate_update_payload.XXXXXX)
> -
> +
>   local offset=$(partoffset "${filename}" ${partition})  # 512-byte sectors
>   local length=$(partsize "${filename}" ${partition})  # 512-byte sectors
>   local bs=512
> @@ -99,6 +99,7 @@ DEFINE_boolean old_style "$FLAGS_TRUE" "Generate an
> old-style .gz full update."
>  DEFINE_string output "" "Output file"
>  DEFINE_boolean patch_kernel "$FLAGS_FALSE" "Whether or not to patch the
> kernel \
>  with the patch from the stateful partition (default: false)"
> +DEFINE_string private_key "" "Path to private key in .pem format."
>
>  # Parse command line
>  FLAGS "$@" || exit 1
> @@ -128,7 +129,7 @@ fi
>
>  if [ "$DELTA" -eq "$FLAGS_TRUE" ]; then
>   echo "Generating a delta update"
> -
> +
>   # Sanity check that the real generator exists:
>   GENERATOR="$(dirname "$0")/../platform/update_engine/delta_generator"
>   [ -x "$GENERATOR" ] || die "$GENERATOR doesn't exist, or isn't
> executable"
> @@ -144,42 +145,42 @@ if [ "$DELTA" -eq "$FLAGS_TRUE" ]; then
>   md5sum "$SRC_KERNEL"
>   echo md5sum of src root:
>   md5sum "$SRC_ROOT"
> -
> +
>   DST_KERNEL=$(extract_partition_to_temp_file "$FLAGS_image" 2)
>   if [ "$FLAGS_patch_kernel" -eq "$FLAGS_TRUE" ]; then
>     patch_kernel "$FLAGS_image" "$DST_KERNEL"
>   fi
>   DST_ROOT=$(extract_partition_to_temp_file "$FLAGS_image" 3)
> -
> +
>   SRC_MNT=$(mktemp -d /tmp/src_root.XXXXXX)
>   sudo mount -o loop,ro "$SRC_ROOT" "$SRC_MNT"
>
>   DST_MNT=$(mktemp -d /tmp/src_root.XXXXXX)
>   sudo mount -o loop,ro "$DST_ROOT" "$DST_MNT"
> -
> +
>   sudo "$GENERATOR" \
>       -new_dir "$DST_MNT" -new_image "$DST_ROOT" -new_kernel "$DST_KERNEL"
> \
>       -old_dir "$SRC_MNT" -old_image "$SRC_ROOT" -old_kernel "$SRC_KERNEL"
> \
> -      -out_file "$FLAGS_output"
> -
> +      -out_file "$FLAGS_output" -private_key "$FLAGS_private_key"
> +
>   trap - INT TERM EXIT
>   cleanup noexit
>   echo "Done generating delta."
>  else
>   echo "Generating full update"
> -
> +
>   trap cleanup INT TERM EXIT
>   DST_KERNEL=$(extract_partition_to_temp_file "$FLAGS_image" 2)
>   if [ "$FLAGS_patch_kernel" -eq "$FLAGS_TRUE" ]; then
>     patch_kernel "$FLAGS_image" "$DST_KERNEL"
>   fi
>   DST_ROOT=$(extract_partition_to_temp_file "$FLAGS_image" 3)
> -
> +
>   GENERATOR="$(dirname "$0")/mk_memento_images.sh"
>
>   CROS_GENERATE_UPDATE_PAYLOAD_CALLED=1 "$GENERATOR" "$DST_KERNEL"
> "$DST_ROOT"
>   mv "$(dirname "$DST_KERNEL")/update.gz" "$FLAGS_output"
> -
> +
>   trap - INT TERM EXIT
>   cleanup noexit
>   echo "Done generating full update."
>
>
>

Powered by Google App Engine
This is Rietveld 408576698