diff options
author | Louis Yung-Chieh Lo <yjlou@chromium.org> | 2012-06-26 14:48:39 +0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-06-27 00:55:04 -0700 |
commit | 455b119dc0f3cd5538c4a53f0e2ab38534bcdf14 (patch) | |
tree | 8731db8a42f4896d9c3e26d5ffccd5f2c7776953 /cgpt/cmd_show.c | |
parent | 58def7454d2c4d085e383a0b73d00670390ddd83 (diff) | |
download | vboot-455b119dc0f3cd5538c4a53f0e2ab38534bcdf14.tar.gz |
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 <yjlou@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26091
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Commit-Ready: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Diffstat (limited to 'cgpt/cmd_show.c')
-rw-r--r-- | cgpt/cmd_show.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; |