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

Unified Diff: firmware/lib/vboot_kernel.c

Issue 3007036: Enable TPM in developer mode again. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Fix unused var Created 10 years, 4 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
Index: firmware/lib/vboot_kernel.c
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c
index 0420f2554f332ce123fe18f048266e2b552a0983..3280ba5e17c1bc35e3dc70eed423e2e2468e4b55 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -152,16 +152,12 @@ int LoadKernel(LoadKernelParams* params) {
params->bootloader_address = 0;
params->bootloader_size = 0;
- 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. */
- }
+ /* Let the TPM know if we're in recovery mode */
+ if (is_rec) {
+ if (0 != RollbackKernelRecovery(is_dev)) {
+ VBDEBUG(("Error setting up TPM for recovery kernel\n"));
+ /* Ignore return code, since we need to boot recovery mode to
+ * fix the TPM. */
}
}
@@ -350,6 +346,8 @@ int LoadKernel(LoadKernelParams* params) {
good_partition = gpt.current_kernel + 1;
params->partition_number = gpt.current_kernel + 1;
GetCurrentKernelUniqueGuid(&gpt, &params->partition_guid);
+ /* TODO: GetCurrentKernelUniqueGuid() should take a destination size, or
+ * the dest should be a struct, so we know it's big enough. */
params->bootloader_address = preamble->bootloader_address;
params->bootloader_size = preamble->bootloader_size;
/* If we're in developer or recovery mode, there's no rollback
@@ -400,24 +398,20 @@ int LoadKernel(LoadKernelParams* params) {
(uint16_t)lowest_kernel_version);
if (0 != status) {
VBDEBUG(("Error writing kernel versions to TPM.\n"));
- return (status == TPM_E_MUST_REBOOT ?
- LOAD_KERNEL_REBOOT : LOAD_KERNEL_RECOVERY);
+ 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);
- }
+ /* 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! */

Powered by Google App Engine
This is Rietveld 408576698