diff --git a/firmware/lib/cgptlib/cgptlib.c b/firmware/lib/cgptlib/cgptlib.c index 2dcb46df3c..e708b7bc99 100644 --- a/firmware/lib/cgptlib/cgptlib.c +++ b/firmware/lib/cgptlib/cgptlib.c @@ -44,7 +44,7 @@ int GptNextKernelEntry(GptData* gpt, uint64_t* start_sector, uint64_t* size) { e = entries + i; if (!IsKernelEntry(e)) continue; - VBDEBUG(("GptNextKernelEntry looking at same prio partition %d\n", i)); + VBDEBUG(("GptNextKernelEntry looking at same prio partition %d\n", i+1)); VBDEBUG(("GptNextKernelEntry s%d t%d p%d\n", GetEntrySuccessful(e), GetEntryTries(e), GetEntryPriority(e))); if (!(GetEntrySuccessful(e) || GetEntryTries(e))) @@ -65,7 +65,7 @@ int GptNextKernelEntry(GptData* gpt, uint64_t* start_sector, uint64_t* size) { int current_prio = GetEntryPriority(e); if (!IsKernelEntry(e)) continue; - VBDEBUG(("GptNextKernelEntry looking at new prio partition %d\n", i)); + VBDEBUG(("GptNextKernelEntry looking at new prio partition %d\n", i+1)); VBDEBUG(("GptNextKernelEntry s%d t%d p%d\n", GetEntrySuccessful(e), GetEntryTries(e), GetEntryPriority(e))); if (!(GetEntrySuccessful(e) || GetEntryTries(e))) diff --git a/firmware/lib/cgptlib/include/cgptlib.h b/firmware/lib/cgptlib/include/cgptlib.h index 4eadc817ee..451ecf0bbd 100644 --- a/firmware/lib/cgptlib/include/cgptlib.h +++ b/firmware/lib/cgptlib/include/cgptlib.h @@ -61,7 +61,10 @@ typedef struct { * 0x04 = table1 * 0x08 = table2 */ int current_kernel; /* the current chromeos kernel index in partition table. - * -1 means not found on drive. */ + * -1 means not found on drive. Note that GPT partition + * numbers are traditionally 1-based, but we're using + * a zero-based index here. + */ /* Internal variables */ uint32_t valid_headers, valid_entries;