//\r
Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_CAPSULE_FLAGS_STRING, 0, Value);\r
if (Status == EFI_SUCCESS) {\r
- if (strstr (Value, "PersistAcrossReset") != NULL) {\r
- CapInfo->Flags |= CAPSULE_FLAGS_PERSIST_ACROSS_RESET; \r
- } else if (strstr (Value, "PopulateSystemTable") != NULL) {\r
+ if (strstr (Value, "PopulateSystemTable") != NULL) {\r
CapInfo->Flags |= CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE;\r
+ } else if (strstr (Value, "PersistAcrossReset") != NULL) {\r
+ CapInfo->Flags |= CAPSULE_FLAGS_PERSIST_ACROSS_RESET; \r
} else {\r
Error (NULL, 0, 2000, "Invalid paramter", "invalid Flag setting for %s", EFI_CAPSULE_FLAGS_STRING);\r
return EFI_ABORTED;\r
UINT8 ctr;\r
\r
Line[MAX_LINE_LEN - 1] = 0;\r
- if (fgets (Line, MAX_LINE_LEN, InFptr) == NULL) {\r
- return STATUS_ERROR;\r
- }\r
-\r
- // Strip leading white-space characters (except carriage returns) from Line\r
- //\r
- if (isspace(Line[0]) && Line[0] != '\n') {\r
- // printf("Found a space character at Line[0] = 0x%x\n", Line[0]);\r
- while (isspace(Line[0])) {\r
- for (ctr = 0; ctr < strlen(Line); ctr++)\r
- if (Line[ctr] != '\n')\r
- Line[ctr] = Line[ctr + 1];\r
+ while (1) {\r
+ if (fgets (Line, MAX_LINE_LEN, InFptr) == NULL) {\r
+ return STATUS_ERROR;\r
+ }\r
+ //\r
+ // If it was a binary file, then it may have overwritten our null terminator\r
+ //\r
+ if (Line[MAX_LINE_LEN - 1] != 0) {\r
+ return STATUS_ERROR;\r
+ }\r
+ \r
+ //\r
+ // strip space\r
+ // \r
+ for (cptr = Line; *cptr && isspace(*cptr); cptr++) {\r
+ }\r
+ \r
+ // Skip Blank Lines and Comment Lines\r
+ if ((strlen(cptr) != 0) && (*cptr != ';')) {\r
+ break;\r
}\r
- }\r
-\r
- //\r
- // If it was a binary file, then it may have overwritten our null terminator\r
- //\r
- if (Line[MAX_LINE_LEN - 1] != 0) {\r
- return STATUS_ERROR;\r
}\r
\r
// Look for\r
// DD XXXXXXXXX\r
// DD XXXXXXXXX\r
//\r
- for (cptr = Line; *cptr && isspace(*cptr); cptr++) {\r
- }\r
-\r
if ((tolower(cptr[0]) == 'd') && (tolower(cptr[1]) == 'd') && isspace (cptr[2])) {\r
//\r
// Skip blanks and look for a hex digit\r
}\r
return STATUS_SUCCESS;\r
}\r
- // Skip Blank Lines \r
- if (strlen(Line) == 1) {\r
- return STATUS_IGNORE;\r
- }\r
- // Skip Comment Lines\r
- if (tolower(cptr[0]) == ';') {\r
- return STATUS_IGNORE;\r
- }\r
\r
return STATUS_ERROR;\r
}\r
fprintf (stdout, " -g GuidValue, --vendor GuidValue\n\\r
GuidValue is one specific vendor guid value.\n\\r
Its format is 00000000-0000-0000-0000-000000000000\n");\r
+ fprintf (stdout, " -l GuidHeaderLength, --HeaderLength GuidHeaderLength\n\\r
+ GuidHeaderLength is the size of header of guided data\n");\r
fprintf (stdout, " -r GuidAttr, --attributes GuidAttr\n\\r
GuidAttr is guid section atttributes, which may be\n\\r
PROCESSING_REQUIRED or AUTH_STATUS_VALID\n");\r
UINT32 InputFileNum,\r
EFI_GUID *VendorGuid,\r
UINT16 DataAttribute,\r
+ UINT32 DataHeaderSize,\r
FILE *OutFile\r
)\r
/*++\r
\r
DataAttribute - Specify attribute for the vendor guid data. \r
\r
+ DataHeaderSize- Guided Data Header Size\r
+ \r
OutFile - Output file handle\r
\r
Returns:\r
VendorGuidSect.CommonHeader.Size[2] = (UINT8) ((TotalLength & 0xff0000) >> 16);\r
memcpy (&(VendorGuidSect.SectionDefinitionGuid), VendorGuid, sizeof (EFI_GUID));\r
VendorGuidSect.Attributes = DataAttribute;\r
- VendorGuidSect.DataOffset = sizeof (EFI_GUID_DEFINED_SECTION);\r
+ VendorGuidSect.DataOffset = sizeof (EFI_GUID_DEFINED_SECTION) + DataHeaderSize;\r
fwrite (&VendorGuidSect, sizeof (EFI_GUID_DEFINED_SECTION), 1, OutFile); \r
DebugMsg (NULL, 0, 9, "Guided section", "Data offset is %d", VendorGuidSect.DataOffset);\r
}\r
UINT8 SectType;\r
UINT8 SectCompSubType;\r
UINT16 SectGuidAttribute; \r
+ UINT64 SectGuidHeaderLength;\r
EFI_COMMON_SECTION_HEADER CommonSect;\r
UINT32 InputLength;\r
UINT8 *FileBuffer;\r
InputLength = 0;\r
Status = STATUS_SUCCESS;\r
LogLevel = 0;\r
+ SectGuidHeaderLength = 0;\r
\r
SetUtilityName (UTILITY_NAME);\r
\r
continue;\r
}\r
\r
+ if ((stricmp (argv[0], "-l") == 0) || (stricmp (argv[0], "--HeaderLength") == 0)) {\r
+ Status = AsciiStringToUint64 (argv[1], FALSE, &SectGuidHeaderLength);\r
+ if (EFI_ERROR (Status)) {\r
+ Error (NULL, 0, 1003, "Invalid option value for GuidHeaderLength", "%s = %s", argv[0], argv[1]);\r
+ goto Finish;\r
+ }\r
+ argc -= 2;\r
+ argv += 2;\r
+ continue;\r
+ }\r
+\r
if ((stricmp (argv[0], "-n") == 0) || (stricmp (argv[0], "--name") == 0)) {\r
StringBuffer = argv[1];\r
argc -= 2;\r
if ((SectGuidAttribute & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) != 0) {\r
VerboseMsg ("Guid Attribute is %s", mGUIDedSectionAttribue[EFI_GUIDED_SECTION_AUTH_STATUS_VALID]);\r
}\r
+ if (SectGuidHeaderLength != 0) {\r
+ VerboseMsg ("Guid Data Header size is 0x%x", SectGuidHeaderLength);\r
+ }\r
} else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_PE32]) == 0) {\r
SectType = EFI_SECTION_PE32;\r
} else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_PIC]) == 0) {\r
InputFileNum,\r
&VendorGuid,\r
SectGuidAttribute,\r
+ (UINT32) SectGuidHeaderLength,\r
OutFile\r
);\r
break;\r