From 393266b499d151f0dcde5d00dca44e672a2420b2 Mon Sep 17 00:00:00 2001 From: Andrew de los Reyes Date: Thu, 26 Aug 2010 09:53:52 -0700 Subject: [PATCH] AU: when generating payload, don't patch kernel by default Normally, images are signed for USB boot and the HD boot patch is in the stateful partition. Official image are resigned, and the kernel partition needs no patch for HD boot. Since folks generating updates generally don't need to patch, this CL turns off patching by default. BUG=5975 TEST=Generated update payload Review URL: http://codereview.chromium.org/3167035 --- cros_generate_update_payload | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cros_generate_update_payload b/cros_generate_update_payload index edc40d41fa..ad63fd73d6 100755 --- a/cros_generate_update_payload +++ b/cros_generate_update_payload @@ -100,6 +100,8 @@ DEFINE_string src_image "" "Optional: a source image. If specified, this makes\ a delta update." 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)" # Parse command line FLAGS "$@" || exit 1 @@ -131,7 +133,9 @@ if [ "$DELTA" -eq "$FLAGS_TRUE" ]; then trap cleanup INT TERM EXIT SRC_KERNEL=$(extract_partition_to_temp_file "$FLAGS_src_image" 2) - patch_kernel "$FLAGS_src_image" "$SRC_KERNEL" + if [ "$FLAGS_patch_kernel" -eq "$FLAGS_TRUE" ]; then + patch_kernel "$FLAGS_src_image" "$SRC_KERNEL" + fi SRC_ROOT=$(extract_partition_to_temp_file "$FLAGS_src_image" 3) echo md5sum of src kernel: @@ -140,7 +144,9 @@ if [ "$DELTA" -eq "$FLAGS_TRUE" ]; then md5sum "$SRC_ROOT" DST_KERNEL=$(extract_partition_to_temp_file "$FLAGS_image" 2) - patch_kernel "$FLAGS_image" "$DST_KERNEL" + 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) @@ -162,7 +168,9 @@ else trap cleanup INT TERM EXIT DST_KERNEL=$(extract_partition_to_temp_file "$FLAGS_image" 2) - patch_kernel "$FLAGS_image" "$DST_KERNEL" + 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"