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

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

Issue 6727019: vboot_reference: fix make_dev_firmware to fit latest dev firmware design (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: split and remove non-related fix Created 9 years, 9 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/sh 1 #!/bin/sh
2 # 2 #
3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2011 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 # This script can change key (usually developer keys) in a firmware binary 7 # This script can change key (usually developer keys) in a firmware binary
8 # image or system live firmware (EEPROM), and assign proper HWID, BMPFV as well. 8 # image or system live firmware (EEPROM), and assign proper HWID, BMPFV as well.
9 9
10 SCRIPT_BASE="$(dirname "$0")" 10 SCRIPT_BASE="$(dirname "$0")"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 # Main 136 # Main
137 # ---------------------------------------------------------------------------- 137 # ----------------------------------------------------------------------------
138 main() { 138 main() {
139 # Check parameters 139 # Check parameters
140 local root_pubkey="$FLAGS_keys/root_key.vbpubk" 140 local root_pubkey="$FLAGS_keys/root_key.vbpubk"
141 local recovery_pubkey="$FLAGS_keys/recovery_key.vbpubk" 141 local recovery_pubkey="$FLAGS_keys/recovery_key.vbpubk"
142 local firmware_keyblock="$FLAGS_keys/firmware.keyblock" 142 local firmware_keyblock="$FLAGS_keys/firmware.keyblock"
143 local firmware_prvkey="$FLAGS_keys/firmware_data_key.vbprivk" 143 local firmware_prvkey="$FLAGS_keys/firmware_data_key.vbprivk"
144 local dev_firmware_keyblock="$FLAGS_keys/dev_firmware.keyblock"
145 local dev_firmware_prvkey="$FLAGS_keys/dev_firmware_data_key.vbprivk"
144 local kernel_sub_pubkey="$FLAGS_keys/kernel_subkey.vbpubk" 146 local kernel_sub_pubkey="$FLAGS_keys/kernel_subkey.vbpubk"
145 local new_bmpfv="$FLAGS_bmpfv" 147 local new_bmpfv="$FLAGS_bmpfv"
146 local is_from_live=0 148 local is_from_live=0
147 local backup_image= 149 local backup_image=
148 local opt_bmpfv="" 150 local opt_bmpfv=""
149 151
150 if [ "$new_bmpfv" = "$DEFAULT_BMPFV_FILE" ]; then 152 if [ "$new_bmpfv" = "$DEFAULT_BMPFV_FILE" ]; then
151 new_bmpfv=$(explore_bmpfv) && 153 new_bmpfv=$(explore_bmpfv) &&
152 debug_msg "Using bitmaps from $new_bmpfv" 154 debug_msg "Using bitmaps from $new_bmpfv"
153 fi 155 fi
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 err_die "Failed to change GBB Data. (message: $(cat "$EXEC_LOG"))" 220 err_die "Failed to change GBB Data. (message: $(cat "$EXEC_LOG"))"
219 221
220 debug_msg "Resign the firmware code (A/B) with new keys" 222 debug_msg "Resign the firmware code (A/B) with new keys"
221 local unsigned_image="$(make_temp_file)" 223 local unsigned_image="$(make_temp_file)"
222 cp -f "$IMAGE" "$unsigned_image" 224 cp -f "$IMAGE" "$unsigned_image"
223 "$SCRIPT_BASE/resign_firmwarefd.sh" \ 225 "$SCRIPT_BASE/resign_firmwarefd.sh" \
224 "$unsigned_image" \ 226 "$unsigned_image" \
225 "$IMAGE" \ 227 "$IMAGE" \
226 "$firmware_prvkey" \ 228 "$firmware_prvkey" \
227 "$firmware_keyblock" \ 229 "$firmware_keyblock" \
230 "$dev_firmware_prvkey" \
231 "$dev_firmware_keyblock" \
228 "$kernel_sub_pubkey" >"$EXEC_LOG" 2>&1 || 232 "$kernel_sub_pubkey" >"$EXEC_LOG" 2>&1 ||
229 err_die "Failed to re-sign firmware. (message: $(cat "$EXEC_LOG"))" 233 err_die "Failed to re-sign firmware. (message: $(cat "$EXEC_LOG"))"
230 234
231 # TODO(hungte) compare if the image really needs to be changed. 235 # TODO(hungte) compare if the image really needs to be changed.
232 236
233 debug_msg "Check if we need to make backup file(s)" 237 debug_msg "Check if we need to make backup file(s)"
234 if [ -n "$backup_image" ]; then 238 if [ -n "$backup_image" ]; then
235 local backup_hwid_name="$(echo "$old_hwid" | sed 's/ /_/g')" 239 local backup_hwid_name="$(echo "$old_hwid" | sed 's/ /_/g')"
236 local backup_date_time="$(date +'%Y%m%d_%H%M%S')" 240 local backup_date_time="$(date +'%Y%m%d_%H%M%S')"
237 local backup_file_name="firmware_${backup_hwid_name}_${backup_date_time}.fd" 241 local backup_file_name="firmware_${backup_hwid_name}_${backup_date_time}.fd"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 274
271 debug_msg "Complete." 275 debug_msg "Complete."
272 if [ -z "$FLAGS_to" ]; then 276 if [ -z "$FLAGS_to" ]; then
273 echo "Successfully changed firmware to Developer Keys. New HWID: $new_hwid" 277 echo "Successfully changed firmware to Developer Keys. New HWID: $new_hwid"
274 else 278 else
275 echo "Firmware '$FLAGS_to' now uses Developer Keys. New HWID: $new_hwid" 279 echo "Firmware '$FLAGS_to' now uses Developer Keys. New HWID: $new_hwid"
276 fi 280 fi
277 } 281 }
278 282
279 main 283 main
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