Skip to content

Commit

Permalink
Address comments on 2024/11/14
Browse files Browse the repository at this point in the history
  • Loading branch information
Kane Chen committed Nov 14, 2024
1 parent 05d3f94 commit d135b1d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 125 deletions.
4 changes: 4 additions & 0 deletions SetupDataPkg/Include/Library/PlatformConfigDataLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
#include <Uefi.h>
#include <ConfigStdStructDefs.h>

#define SCHEMA_XML_HASH_VAR_NAME L"SCHEMA_XML_HASH"
#define SCHEMA_XML_HASH_GUID = {0x1321e012, 0x14c5, 0x42db, { 0x8c, 0xa9, 0xe7, 0x97, 0x1d, 0x88, 0x15, 0x18 }}

extern CHAR8 *gSchemaXmlHash;
extern KNOB_DATA gKnobData[];
extern UINTN gNumKnobs;
extern PROFILE gProfileData[];
Expand Down
80 changes: 0 additions & 80 deletions SetupDataPkg/SetupDataDxe/SchemaXmlHashDriver/SchemaXmlHash.c

This file was deleted.

36 changes: 0 additions & 36 deletions SetupDataPkg/SetupDataDxe/SchemaXmlHashDriver/SchemaXmlHash.inf

This file was deleted.

1 change: 0 additions & 1 deletion SetupDataPkg/SetupDataPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@

[Components.X64, Components.AARCH64]
SetupDataPkg/ConfApp/ConfApp.inf
SetupDataPkg/SetupDataDxe/SchemaXmlHashDriver/SchemaXmlHash.inf

[BuildOptions]
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
2 changes: 1 addition & 1 deletion SetupDataPkg/Tools/BoardMiscInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_schema_xml_hash_from_bios():
UefiVar = UefiVariable()
(errorcode, data) = UefiVar.GetUefiVar(SCHEMA_XML_HASH_VAR_NAME, SCHEMA_XML_HASH_GUID)

result = "Unknown"
result = None
if errorcode == 0:
result = data.decode("utf-8")

Expand Down
6 changes: 3 additions & 3 deletions SetupDataPkg/Tools/ConfigEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def __init__(self, master=None):
# self.page_cfg_map[page_id] = cfg_data_idx
self.page_cfg_map = {}

self.bios_schema_xml_hash = "Unknown"
self.bios_schema_xml_hash = None

# Check if current directory contains a file with a .yaml extension
# if not default self.last_dir to a Platform directory where it is
Expand Down Expand Up @@ -977,8 +977,8 @@ def load_cfg_file(self, path, file_id, clear_config):
# load xml file and get the hash value of all xml nodes
config_xml_hash = get_xml_full_hash(self.config_xml_path)

# compare the xml version with self.bios_git_info, 7 digits should be enough
if self.bios_schema_xml_hash != "Unknown" and config_xml_hash != self.bios_schema_xml_hash:
# Compare the xml hash and the hash claimed in FW.
if self.bios_schema_xml_hash is not None and config_xml_hash != self.bios_schema_xml_hash:
self.output_current_status("WARNING: Config xml file hash mismatches with system FW", color="red")
self.output_current_status(f"FW ConfigXml Hash = {self.bios_schema_xml_hash}", color="red")
self.output_current_status(f"{self.config_xml_path} Hash = {config_xml_hash}", color="red")
Expand Down
5 changes: 1 addition & 4 deletions SetupDataPkg/Tools/KnobService.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,7 @@ def generate_cached_implementation(schema, header_path, efi_type=False, no_chang
out.write("// Generated Header" + get_line_ending(efi_type))
out.write("// Script: {}".format(sys.argv[0]) + get_line_ending(efi_type))
out.write("// Schema: {}".format(schema.path) + get_line_ending(efi_type))
out.write('#define SCHEMA_XML_HASH "' + get_xml_full_hash(schema.path) + '"' + get_line_ending(efi_type))
out.write('#define SCHEMA_XML_HASH_VAR_NAME L"SCHEMA_XML_HASH"' + get_line_ending(efi_type))
xml_hash_guid = "{0x1321e012, 0x14c5, 0x42db, { 0x8c, 0xa9, 0xe7, 0x97, 0x1d, 0x88, 0x15, 0x18 }}"
out.write('#define SCHEMA_XML_HASH_GUID ' + xml_hash_guid + get_line_ending(efi_type))
out.write('CHAR8 *gSchemaXmlHash = "' + get_xml_full_hash(schema.path) + '";' + get_line_ending(efi_type))
out.write("" + get_line_ending(efi_type))

out.write("typedef struct {" + get_line_ending(efi_type))
Expand Down

0 comments on commit d135b1d

Please sign in to comment.