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

Unified Diff: firmware/lib/vboot_kernel.c

Issue 3041005: Add lots of debugging to TPM library. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Fix TPM unit tests Created 10 years, 5 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') | firmware/linktest/main.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 ddbceed6e39cc7b281afa57d66b0644117f23851..03e4da81cbdb4ca88dad17daec7472af782a1db8 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -136,12 +136,16 @@ int LoadKernel(LoadKernelParams* params) {
params->bootloader_address = 0;
params->bootloader_size = 0;
- /* Let the TPM know if we're in recovery mode */
- if (is_rec) {
- if (0 != RollbackKernelRecovery(is_dev ? 1 : 0)) {
- VBDEBUG(("Error setting up TPM for recovery kernel\n"));
- /* Ignore return code, since we need to boot recovery mode to
- * fix the TPM. */
+ if (!is_dev) {
+ /* TODO: should use the TPM all the time; for now, only use when
+ * not in developer mode. */
+ /* Let the TPM know if we're in recovery mode */
+ if (is_rec) {
+ if (0 != RollbackKernelRecovery(is_dev ? 1 : 0)) {
+ VBDEBUG(("Error setting up TPM for recovery kernel\n"));
+ /* Ignore return code, since we need to boot recovery mode to
+ * fix the TPM. */
+ }
}
}
@@ -381,14 +385,18 @@ int LoadKernel(LoadKernelParams* params) {
}
}
- /* Lock the kernel versions */
- status = RollbackKernelLock();
- if (0 != status) {
- VBDEBUG(("Error locking kernel versions.\n"));
- /* Don't reboot to recovery mode if we're already there */
- if (!is_rec)
- return (status == TPM_E_MUST_REBOOT ?
- LOAD_KERNEL_REBOOT : LOAD_KERNEL_RECOVERY);
+ if (!is_dev) {
+ /* TODO: should use the TPM all the time; for now, only use when
+ * not in developer mode. */
+ /* Lock the kernel versions */
+ status = RollbackKernelLock();
+ if (0 != status) {
+ VBDEBUG(("Error locking kernel versions.\n"));
+ /* Don't reboot to recovery mode if we're already there */
+ if (!is_rec)
+ return (status == TPM_E_MUST_REBOOT ?
+ LOAD_KERNEL_REBOOT : LOAD_KERNEL_RECOVERY);
+ }
}
/* Success! */
« no previous file with comments | « firmware/lib/vboot_firmware.c ('k') | firmware/linktest/main.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698