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

Issue 2844006: This fixes the EFI BIOS boot problems introduced with cgpt. (Closed)

Created:
10 years, 6 months ago by Bill Richardson
Modified:
9 years, 6 months ago
CC:
chromium-os-reviews_chromium.org
Base URL:
ssh://git@chromiumos-git//vboot_reference.git
Visibility:
Public.

Description

This fixes the EFI BIOS boot problems introduced with cgpt. There were two changes. First, we need to pack the GPT header to make it match the spec (duh). Second, there's a subtle bug in how the BIOS recovers from corrupted headers. The EFI spec says that the primary GPT header must be at sector 1 (counting from zero) and the secondary GPT header must be at the last sector on the drive. The BIOS correctly looks in those locations to find the headers. However, if the secondary GPT header is invalid (as it usually is due to our build process), the BIOS is supposed to update it from the primary header. In this case, rather than write to the last sector on the drive where it just looked, the BIOS trusts the alternate_lba field of the primary header. That field is supposed to point to the secondary header location, but the BIOS just blindly uses it no matter where it points. The cgpt tool wasn't initializing that field, so it pointed to sector 0, which is the PMBR. The BIOS overwrote that, resulting in an unbootable drive.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -3 lines) Patch
M cgpt/cmd_create.c View 1 chunk +1 line, -0 lines 0 comments Download
M cgpt/cmd_show.c View 1 chunk +1 line, -0 lines 0 comments Download
M vboot_firmware/lib/cgptlib/include/gpt.h View 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Bill Richardson
10 years, 6 months ago (2010-06-16 03:57:36 UTC) #1
Randall Spangler
LGTM
10 years, 6 months ago (2010-06-16 04:05:09 UTC) #2
Nick Sanders
10 years, 6 months ago (2010-06-16 04:08:18 UTC) #3
lgtm, thanks!

Powered by Google App Engine
This is Rietveld 408576698