Allow optional spoofing on native Models

This commit is contained in:
Mykola Grymalyuk
2022-01-14 18:04:39 -07:00
parent 64b9e7ada6
commit 023fec03aa
6 changed files with 66 additions and 10 deletions

View File

@@ -71,9 +71,15 @@ def generate_fw_features(model, custom):
firmwarefeature = utilities.get_rom("firmware-features")
if not firmwarefeature:
print("- Failed to find FirmwareFeatures, falling back on defaults")
firmwarefeature = int(smbios_data.smbios_dictionary[model]["FirmwareFeatures"], 16)
if smbios_data.smbios_dictionary[model]["FirmwareFeatures"] is None:
firmwarefeature = 0
else:
firmwarefeature = int(smbios_data.smbios_dictionary[model]["FirmwareFeatures"], 16)
else:
firmwarefeature = int(smbios_data.smbios_dictionary[model]["FirmwareFeatures"], 16)
if smbios_data.smbios_dictionary[model]["FirmwareFeatures"] is None:
firmwarefeature = 0
else:
firmwarefeature = int(smbios_data.smbios_dictionary[model]["FirmwareFeatures"], 16)
firmwarefeature = update_firmware_features(firmwarefeature)
return firmwarefeature