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

Unified Diff: firmware/lib/vboot_kernel.c

Issue 2865014: Assorted integration fixes. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Add struct size tests Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/lib/vboot_firmware.c ('k') | tests/cgptlib_test.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/vboot_kernel.c
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c
index ea0fc295480e46c49921b98d52113d19386b7b38..c3b3423eebc23f1bfa70f5cd8cd329a4f74e7181 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -67,6 +67,7 @@ int WriteAndFreeGptData(GptData* gptdata) {
if (gptdata->primary_header) {
if (gptdata->modified & GPT_MODIFIED_HEADER1) {
+ debug("Updating GPT header 1\n");
if (0 != BootDeviceWriteLBA(1, 1, gptdata->primary_header))
return 1;
}
@@ -75,6 +76,7 @@ int WriteAndFreeGptData(GptData* gptdata) {
if (gptdata->primary_entries) {
if (gptdata->modified & GPT_MODIFIED_ENTRIES1) {
+ debug("Updating GPT entries 1\n");
if (0 != BootDeviceWriteLBA(2, entries_sectors,
gptdata->primary_entries))
return 1;
@@ -84,6 +86,7 @@ int WriteAndFreeGptData(GptData* gptdata) {
if (gptdata->secondary_entries) {
if (gptdata->modified & GPT_MODIFIED_ENTRIES2) {
+ debug("Updating GPT header 2\n");
if (0 != BootDeviceWriteLBA(gptdata->drive_sectors - entries_sectors - 1,
entries_sectors, gptdata->secondary_entries))
return 1;
@@ -93,6 +96,7 @@ int WriteAndFreeGptData(GptData* gptdata) {
if (gptdata->secondary_header) {
if (gptdata->modified & GPT_MODIFIED_HEADER2) {
+ debug("Updating GPT entries 2\n");
if (0 != BootDeviceWriteLBA(gptdata->drive_sectors - 1, 1,
gptdata->secondary_header))
return 1;
@@ -130,6 +134,15 @@ int LoadKernel(LoadKernelParams* params) {
params->bootloader_address = 0;
params->bootloader_size = 0;
+ /* Set up TPM; required in all modes */
+ if (0 != SetupTPM(
+ ((BOOT_FLAG_RECOVERY & params->boot_flags) ?
+ RO_RECOVERY_MODE : RW_NORMAL_MODE),
+ ((BOOT_FLAG_DEVELOPER & params->boot_flags) ? 1 : 0))) {
+ debug("Error setting up TPM\n");
+ return LOAD_KERNEL_RECOVERY;
+ }
+
if (is_normal) {
/* Read current kernel key index from TPM. Assumes TPM is already
* initialized. */
« no previous file with comments | « firmware/lib/vboot_firmware.c ('k') | tests/cgptlib_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698