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

Side by Side Diff: bin/cros_resign_image.sh

Issue 6240018: This starts to fix the scripts so that they load from /usr/lib/crosutils (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: fixing bad merge Created 9 years, 10 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 | « bin/cros_package_to_live ('k') | bin/cros_revert_image.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 # Script to resign the kernel partition generated in the output of build_image 7 # Script to resign the kernel partition generated in the output of build_image
8 # with keys of our choosing. 8 # with keys of our choosing.
9 9
10 # Load common constants. This should be the first executable line. 10 # --- BEGIN COMMON.SH BOILERPLATE ---
11 # The path to common.sh should be relative to your script's location. 11 # Load common CrOS utilities. Inside the chroot this file is installed in
12 . "$(dirname "$0")/../common.sh" 12 # /usr/lib/crosutils. Outside the chroot we find it relative to the script's
13 # location.
14 find_common_sh() {
15 local common_paths=(/usr/lib/crosutils "$(dirname "$(readlink -f "$0")")/..")
16 local path
13 17
14 . "$(dirname "$0")/../chromeos-common.sh" # for partoffset and partsize 18 SCRIPT_ROOT=
19 for path in "${common_paths[@]}"; do
20 if [ -r "${path}/common.sh" ]; then
21 SCRIPT_ROOT=${path}
22 break
23 fi
24 done
25 }
26
27 find_common_sh
28 . "${SCRIPT_ROOT}/common.sh" || (echo "Unable to load common.sh" && exit 1)
29 # --- END COMMON.SH BOILERPLATE ---
30
31 # Need to be inside the chroot to load chromeos-common.sh
32 assert_inside_chroot
33
34 # Load functions and constants for chromeos-install
35 . "/usr/lib/installer/chromeos-common.sh" || \
36 die "Unable to load /usr/lib/installer/chromeos-common.sh"
15 37
16 locate_gpt 38 locate_gpt
17 39
18 DEFINE_string from "chromiumos_image.bin" \ 40 DEFINE_string from "chromiumos_image.bin" \
19 "Input file name of Chrome OS image to re-sign." 41 "Input file name of Chrome OS image to re-sign."
20 DEFINE_string datakey "" \ 42 DEFINE_string datakey "" \
21 "Private Kernel Data Key (.vbprivk) to use for re-signing." 43 "Private Kernel Data Key (.vbprivk) to use for re-signing."
22 DEFINE_string keyblock "" \ 44 DEFINE_string keyblock "" \
23 "Kernel Keyblock (.keyblock) to use for generating the vblock" 45 "Kernel Keyblock (.keyblock) to use for generating the vblock"
24 DEFINE_string to "" \ 46 DEFINE_string to "" \
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 if [ ! -z $FLAGS_vsubkey ]; then 109 if [ ! -z $FLAGS_vsubkey ]; then
88 ${FLAGS_vbutil_dir}load_kernel_test "${FLAGS_to}" "${FLAGS_vsubkey}" \ 110 ${FLAGS_vbutil_dir}load_kernel_test "${FLAGS_to}" "${FLAGS_vsubkey}" \
89 ${FLAGS_bootflags} 111 ${FLAGS_bootflags}
90 fi 112 fi
91 113
92 echo "New signed image was output to ${FLAGS_to}" 114 echo "New signed image was output to ${FLAGS_to}"
93 115
94 # Clean up temporary files 116 # Clean up temporary files
95 rm -f ${temp_kimage} 117 rm -f ${temp_kimage}
96 rm -f ${temp_out_vb} 118 rm -f ${temp_out_vb}
OLDNEW
« no previous file with comments | « bin/cros_package_to_live ('k') | bin/cros_revert_image.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698