summaryrefslogtreecommitdiff
path: root/cgpt
diff options
context:
space:
mode:
authorMatt Delco <delco@google.com>2018-08-13 14:21:04 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-08-14 16:06:30 -0700
commit0f1de7b5fe7b4dbe12ed544ee7e0ae064393e898 (patch)
treef959729bdc15316e6bee479398d9c720fd6790bf /cgpt
parentd139653fd9234545cfb97189109589535fc3a673 (diff)
downloadvboot-0f1de7b5fe7b4dbe12ed544ee7e0ae064393e898.tar.gz
cgpt: show verbose details when primary ignored
A later change I authored has the tests check the GUID of the drive. When the primary table is ignored the GUID from the secondary wasn't being displayed either. This change has the details of the secondary table get displayed when the primary table is ignored. BRANCH=none BUG=None TEST=Compiled. The change was runtime tested as part of a larger change though I didn't unit test this particular change after it was split out into a separate commit. Change-Id: I300511cf65c67f4888e08ab49cd72c7acf234507 Signed-off-by: Matt Delco <delco@google.com> Reviewed-on: https://chromium-review.googlesource.com/1173410 Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'cgpt')
-rw-r--r--cgpt/cgpt_show.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cgpt/cgpt_show.c b/cgpt/cgpt_show.c
index 72217419..2b882778 100644
--- a/cgpt/cgpt_show.c
+++ b/cgpt/cgpt_show.c
@@ -328,7 +328,7 @@ static int GptShow(struct drive *drive, CgptShowParams *params) {
* 1. in debug mode.
* 2. primary table is being ignored
* 3. only secondary is valid.
- * 4. secondary is not identical to promary.
+ * 4. secondary is not identical to primary.
*/
if (params->debug || (drive->gpt.ignored & MASK_PRIMARY) ||
((drive->gpt.valid_entries & MASK_SECONDARY) &&
@@ -349,10 +349,11 @@ static int GptShow(struct drive *drive, CgptShowParams *params) {
}
/* We show secondary header if any of following is true:
* 1. in debug mode.
- * 2. only secondary is valid.
- * 3. secondary is not synonymous to primary and not ignored.
+ * 2. primary table is being ignored
+ * 3. only secondary is valid.
+ * 4. secondary is not synonymous to primary and not ignored.
*/
- if (params->debug ||
+ if (params->debug || (drive->gpt.ignored & MASK_PRIMARY) ||
((drive->gpt.valid_headers & MASK_SECONDARY) &&
(!(drive->gpt.valid_headers & MASK_PRIMARY) ||
!IsSynonymous((GptHeader*)drive->gpt.primary_header,