From 455b119dc0f3cd5538c4a53f0e2ab38534bcdf14 Mon Sep 17 00:00:00 2001 From: Louis Yung-Chieh Lo Date: Tue, 26 Jun 2012 14:48:39 +0800 Subject: cgpt: add -d option for cgpt show The debug mode is used to dump GPT headers and entries no matter the they are valid or not. BUG=chromium-os:32142 TEST=tested in chroot with the bad secondary entries. % cgpt show /dev/sda -d ... 976773135 32 INVALID Sec GPT table 282624 968101888 1 Label: "STATE" Type: Linux data ... 1 1 INVALID Sec GPT header Sig: [EFI PART] Rev: 0x00010000 ... Change-Id: Ie54068353b87c9f15915ffb51b8de688e0367975 Signed-off-by: Louis Yung-Chieh Lo Reviewed-on: https://gerrit.chromium.org/gerrit/26091 Reviewed-by: Bill Richardson Tested-by: Yung-Chieh Lo Commit-Ready: Yung-Chieh Lo --- cgpt/cmd_show.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cgpt/cmd_show.c') diff --git a/cgpt/cmd_show.c b/cgpt/cmd_show.c index 6443931f..fa0e5f8b 100644 --- a/cgpt/cmd_show.c +++ b/cgpt/cmd_show.c @@ -28,6 +28,7 @@ static void Usage(void) " -T Tries flag\n" " -P Priority flag\n" " -A raw 64-bit attribute value\n" + " -d Debug output (including invalid headers)\n" "\n", progname); } @@ -40,7 +41,7 @@ int cmd_show(int argc, char *argv[]) { char *e = 0; opterr = 0; // quiet, you - while ((c=getopt(argc, argv, ":hnvqi:bstulSTPA")) != -1) + while ((c=getopt(argc, argv, ":hnvqi:bstulSTPAd")) != -1) { switch (c) { @@ -73,6 +74,10 @@ int cmd_show(int argc, char *argv[]) { params.single_item = c; break; + case 'd': + params.debug = 1; + break; + case 'h': Usage(); return CGPT_OK; -- cgit v1.2.1