/** @file\r
+The tool dumps the contents of a firmware volume\r
\r
-Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
-\r
- VolInfo.c\r
-\r
-Abstract:\r
-\r
- The tool dumps the contents of a firmware volume\r
-\r
**/\r
\r
#include <stdio.h>\r
#include <string.h>\r
#include <ctype.h>\r
#include <assert.h>\r
+#ifdef __GNUC__\r
+#include <unistd.h>\r
+#endif\r
\r
#include <FvLib.h>\r
#include <Common/UefiBaseTypes.h>\r
\r
EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid = EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID;\r
\r
-#define UTILITY_MAJOR_VERSION 0\r
-#define UTILITY_MINOR_VERSION 83\r
+#define UTILITY_MAJOR_VERSION 1
+#define UTILITY_MINOR_VERSION 0
\r
#define UTILITY_NAME "VolInfo"\r
\r
//\r
// Print utility header\r
//\r
- printf ("%s Version %d.%d %s, %s\n",\r
+ printf ("%s Version %d.%d Build %s\n",
UTILITY_NAME,\r
UTILITY_MAJOR_VERSION,\r
UTILITY_MINOR_VERSION,\r
- __BUILD_VERSION,\r
- __DATE__\r
+ __BUILD_VERSION
);\r
\r
//\r
//\r
if (argc != 1) {\r
Usage ();\r
- return -1;\r
+ return STATUS_ERROR;
}\r
//\r
// Look for help options\r
if ((strcmp(argv[0], "-h") == 0) || (strcmp(argv[0], "--help") == 0) || \r
(strcmp(argv[0], "-?") == 0) || (strcmp(argv[0], "/?") == 0)) {\r
Usage();\r
- return STATUS_ERROR;\r
+ return STATUS_SUCCESS;
+ }
+ //
+ // Version has already been printed, return success.
+ //
+ if (strcmp(argv[0], "--version") == 0) {
+ return STATUS_SUCCESS;
}\r
-\r
//\r
// Open the file containing the FV\r
//\r
);\r
\r
if (ExtractionTool != NULL) {\r
-\r
+ #ifndef __GNUC__\r
ToolInputFile = CloneString (tmpnam (NULL));\r
ToolOutputFile = CloneString (tmpnam (NULL));\r
+ #else\r
+ char tmp1[] = "/tmp/fileXXXXXX";\r
+ char tmp2[] = "/tmp/fileXXXXXX";\r
+ int fd1;\r
+ int fd2;\r
+ fd1 = mkstemp(tmp1);\r
+ fd2 = mkstemp(tmp2);\r
+ ToolInputFile = CloneString(tmp1);\r
+ ToolOutputFile = CloneString(tmp2);\r
+ close(fd1);\r
+ close(fd2);\r
+ #endif\r
\r
//\r
// Construction 'system' command string\r
CHAR8 Line[MAX_LINE_LEN];\r
GUID_TO_BASENAME *GPtr;\r
\r
- if ((Fptr = fopen (FileName, "r")) == NULL) {\r
+ if ((Fptr = fopen (LongFilePath (FileName), "r")) == NULL) {\r
printf ("ERROR: Failed to open input cross-reference file '%s'\n", FileName);\r
return EFI_DEVICE_ERROR;\r
}\r
//\r
// Copyright declaration\r
// \r
- fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");\r
+ fprintf (stdout, "Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.\n\n");
fprintf (stdout, " Display Tiano Firmware Volume FFS image information\n\n");\r
\r
//\r
Parse basename to file-guid cross reference file(s).\n");\r
fprintf (stdout, " --offset offset\n\\r
Offset of file to start processing FV at.\n");\r
+ fprintf (stdout, " --version\n\
+ Display version of this tool and exit.\n");
fprintf (stdout, " -h, --help\n\\r
Show this help message and exit.\n");\r
\r