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

Side by Side Diff: utility/load_kernel_test.c

Issue 6462010: Support dev vs consumer firmware in vboot_reference (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: post-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 | « firmware/stub/load_firmware_stub.c ('k') | 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 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 /* Routines for verifying a file's signature. Useful in testing the core 6 /* Routines for verifying a file's signature. Useful in testing the core
7 * RSA verification implementation. 7 * RSA verification implementation.
8 */ 8 */
9 9
10 #include <inttypes.h> /* For PRIu64 macro */ 10 #include <inttypes.h> /* For PRIu64 macro */
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 lkp.header_sign_key_blob = ReadFile(argv[optind+1], &key_size); 137 lkp.header_sign_key_blob = ReadFile(argv[optind+1], &key_size);
138 if (!lkp.header_sign_key_blob) { 138 if (!lkp.header_sign_key_blob) {
139 fprintf(stderr, "Unable to read key file %s\n", argv[optind+1]); 139 fprintf(stderr, "Unable to read key file %s\n", argv[optind+1]);
140 return 1; 140 return 1;
141 } 141 }
142 } 142 }
143 /* Need to skip the address check, since we're putting it somewhere on the 143 /* Need to skip the address check, since we're putting it somewhere on the
144 * heap instead of its actual target address in the firmware. */ 144 * heap instead of its actual target address in the firmware. */
145 lkp.boot_flags |= BOOT_FLAG_SKIP_ADDR_CHECK; 145 lkp.boot_flags |= BOOT_FLAG_SKIP_ADDR_CHECK;
146 146
147 /* If the boot flags are for developer mode, non-recovery, add the dev-type
148 * firmware bit. LoadKernel() masks off the developer bit if the dev
149 * firmware bit is absent, to keep normal firmware from verifying dev
150 * kernels. */
151 if ((lkp.boot_flags & BOOT_FLAG_DEVELOPER)
152 && !(lkp.boot_flags & BOOT_FLAG_RECOVERY)) {
153 lkp.boot_flags |= BOOT_FLAG_DEV_FIRMWARE;
154 }
155
147 printf("bootflags = %" PRIu64 "\n", lkp.boot_flags); 156 printf("bootflags = %" PRIu64 "\n", lkp.boot_flags);
148 157
149 /* Get image size */ 158 /* Get image size */
150 printf("Reading from image: %s\n", image_name); 159 printf("Reading from image: %s\n", image_name);
151 image_file = fopen(image_name, "rb"); 160 image_file = fopen(image_name, "rb");
152 if (!image_file) { 161 if (!image_file) {
153 fprintf(stderr, "Unable to open image file %s\n", image_name); 162 fprintf(stderr, "Unable to open image file %s\n", image_name);
154 return 1; 163 return 1;
155 } 164 }
156 fseek(image_file, 0, SEEK_END); 165 fseek(image_file, 0, SEEK_END);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 lkp.partition_guid[12], 201 lkp.partition_guid[12],
193 lkp.partition_guid[13], 202 lkp.partition_guid[13],
194 lkp.partition_guid[14], 203 lkp.partition_guid[14],
195 lkp.partition_guid[15]); 204 lkp.partition_guid[15]);
196 } 205 }
197 206
198 fclose(image_file); 207 fclose(image_file);
199 Free(lkp.kernel_buffer); 208 Free(lkp.kernel_buffer);
200 return rv != LOAD_KERNEL_SUCCESS; 209 return rv != LOAD_KERNEL_SUCCESS;
201 } 210 }
OLDNEW
« no previous file with comments | « firmware/stub/load_firmware_stub.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698