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

Side by Side Diff: scripts/image_signing/cros_resign_image_standalone.sh

Issue 2967011: Make re-signing script abort on error. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 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 # Standalone version of cros_resign_image.sh script from 7 # Standalone version of cros_resign_image.sh script from
8 # from chromeos/src/scripts/bin/ for use on signing servers. 8 # from chromeos/src/scripts/bin/ for use on signing servers.
9 9
10 # Both the cgpt tool and vbutil_kernel should be in the system path. 10 # Both the cgpt tool and vbutil_kernel should be in the system path.
11 11
12 # Abort on error
13 set -e
14
12 # Check arguments 15 # Check arguments
13 if [ $# -ne 4 ] ; then 16 if [ $# -ne 4 ] ; then
14 echo "usage: $0 src_bin dst_bin kernel_datakey kernel_keyblock" 17 echo "usage: $0 src_bin dst_bin kernel_datakey kernel_keyblock"
15 exit 1 18 exit 1
16 fi 19 fi
17 20
18 # Make sure the tools we need are available. 21 # Make sure the tools we need are available.
19 type -P cgpt &>/dev/null || \ 22 type -P cgpt &>/dev/null || \
20 { echo "cgpt tool not found."; exit 1; } 23 { echo "cgpt tool not found."; exit 1; }
21 type -P vbutil_kernel &>/dev/null || \ 24 type -P vbutil_kernel &>/dev/null || \
(...skipping 25 matching lines...) Expand all
47 --signprivate "${kernel_datakey}" \ 50 --signprivate "${kernel_datakey}" \
48 --oldblob "${temp_kimage}" 51 --oldblob "${temp_kimage}"
49 52
50 # Create a copy of the input image and put in the new vblock 53 # Create a copy of the input image and put in the new vblock
51 cp "${src_bin}" "${dst_bin}" 54 cp "${src_bin}" "${dst_bin}"
52 dd if="${temp_out_vb}" of="${dst_bin}" seek=$koffset bs=$sector_size \ 55 dd if="${temp_out_vb}" of="${dst_bin}" seek=$koffset bs=$sector_size \
53 count=$num_sectors_vb conv=notrunc 56 count=$num_sectors_vb conv=notrunc
54 57
55 echo "New signed image was output to ${dst_bin}" 58 echo "New signed image was output to ${dst_bin}"
56 59
57 # Clean up temporary files
58 rm -f ${temp_kimage}
59 rm -f ${temp_out_vb}
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698