#include "fat.h"\r
#include "mbr.h"\r
#include "EfiUtilityMsgs.h"\r
+#include "ParseInf.h"\r
\r
#define DEBUG_WARN 0x1\r
#define DEBUG_ERROR 0x2\r
BOOLEAN ProcessMbr; // -m\r
BOOLEAN DoParse; // -p SrcImage or -g SrcImage DstImage\r
BOOLEAN Verbose; // -v\r
- \r
+ UINT64 LogLevel;\r
+ EFI_STATUS EfiStatus;\r
+\r
SrcImage = DstImage = NULL;\r
ForcePatch = FALSE;\r
ProcessMbr = FALSE;\r
ProcessMbr = TRUE;\r
} else if (strcmp (*argv, "-v") == 0 || strcmp (*argv, "--verbose") == 0) {\r
Verbose = TRUE;\r
+ } else if ((stricmp (*argv, "-d") == 0) || (stricmp (*argv, "--debug") == 0)) {\r
+ argc--; argv++;\r
+ if (argc < 1) {\r
+ Usage ();\r
+ return -1;\r
+ }\r
+ EfiStatus = AsciiStringToUint64 (*argv, FALSE, &LogLevel);\r
+ if (EFI_ERROR (EfiStatus)) {\r
+ Error (NULL, 0, 1003, "Invalid option value", "%s = %s", "--debug", *argv);\r
+ return 1;\r
+ }\r
+ if (LogLevel > 9) {\r
+ Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, currnt input level is %d", (int) LogLevel);\r
+ return 1;\r
+ }\r
+ SetPrintLevel (LogLevel);\r
+ DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", *argv);\r
} else {\r
Usage ();\r
return -1;\r