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

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

Issue 3327005: Add a "verify" option to sign_official_build.sh. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: nosudo Created 10 years, 3 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 | scripts/image_signing/sign_official_build.sh » ('j') | 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 # Determine script directory 7 # Determine script directory
8 SCRIPT_DIR=$(dirname $0) 8 SCRIPT_DIR=$(dirname $0)
9 PROG=$(basename $0) 9 PROG=$(basename $0)
10 GPT=cgpt 10 GPT=cgpt
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 # Extract a partition to a file 40 # Extract a partition to a file
41 # Args: IMAGE PARTNUM OUTPUTFILE 41 # Args: IMAGE PARTNUM OUTPUTFILE
42 extract_image_partition() { 42 extract_image_partition() {
43 local image=$1 43 local image=$1
44 local partnum=$2 44 local partnum=$2
45 local output_file=$3 45 local output_file=$3
46 local offset=$(partoffset "$image" "$partnum") 46 local offset=$(partoffset "$image" "$partnum")
47 local size=$(partsize "$image" "$partnum") 47 local size=$(partsize "$image" "$partnum")
48 dd if=$image of=$output_file bs=512 skip=$offset count=$size conv=notrunc 48 dd if=$image of=$output_file bs=512 skip=$offset count=$size conv=notrunc >/de v/null 2>&1
49 } 49 }
50 50
51 # Replace a partition in an image from file 51 # Replace a partition in an image from file
52 # Args: IMAGE PARTNUM INPUTFILE 52 # Args: IMAGE PARTNUM INPUTFILE
53 replace_image_partition() { 53 replace_image_partition() {
54 local image=$1 54 local image=$1
55 local partnum=$2 55 local partnum=$2
56 local input_file=$3 56 local input_file=$3
57 local offset=$(partoffset "$image" "$partnum") 57 local offset=$(partoffset "$image" "$partnum")
58 local size=$(partsize "$image" "$partnum") 58 local size=$(partsize "$image" "$partnum")
59 dd if=$input_file of=$image bs=512 seek=$offset count=$size conv=notrunc 59 dd if=$input_file of=$image bs=512 seek=$offset count=$size conv=notrunc
60 } 60 }
(...skipping 25 matching lines...) Expand all
86 sudo umount -d $i 2>/dev/null 86 sudo umount -d $i 2>/dev/null
87 rm -rf $i 87 rm -rf $i
88 fi 88 fi
89 done 89 done
90 set -e 90 set -e
91 rm -rf $TEMP_DIR_LIST $TEMP_FILE_LIST 91 rm -rf $TEMP_DIR_LIST $TEMP_FILE_LIST
92 } 92 }
93 93
94 trap "cleanup_temps_and_mounts" EXIT 94 trap "cleanup_temps_and_mounts" EXIT
95 95
OLDNEW
« no previous file with comments | « no previous file | scripts/image_signing/sign_official_build.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698