summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-01-14 08:50:23 -0500
committerTom Rini <trini@konsulko.com>2021-01-14 08:50:23 -0500
commit35772ff4f63a302e0b873096372c70292fb0af79 (patch)
treeffa00f958cf61d12a9348b27699e3980f9d9f15d /tools
parentab1a425524a79eeca61e7b67fdf382c7a499346f (diff)
parent8e70f1cb3f2c18d574b087d4fc1d79e68ce98fa9 (diff)
downloadu-boot-35772ff4f63a302e0b873096372c70292fb0af79.tar.gz
u-boot-35772ff4f63a302e0b873096372c70292fb0af79.tar.xz
u-boot-35772ff4f63a302e0b873096372c70292fb0af79.zip
Merge tag 'efi-2021-04-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2021-04-rc1 In the UEFI sub-system: * implement non-blocking file services * print boot device and file path in helloworld.efi * improve detection of boot device * correct argument handling in efivar.py * implement EFI_DT_FIXUP_PROTOCOL Bug fixes: * adjust conitrace command for low baud rates * check that FIT images are valid FDTs
Diffstat (limited to 'tools')
-rwxr-xr-xtools/efivar.py39
1 files changed, 21 insertions, 18 deletions
diff --git a/tools/efivar.py b/tools/efivar.py
index ebfcab2f0a..67729fa850 100755
--- a/tools/efivar.py
+++ b/tools/efivar.py
@@ -51,21 +51,21 @@ var_guids = {
}
class EfiStruct:
- # struct efi_var_file
- var_file_fmt = '<QQLL'
- var_file_size = struct.calcsize(var_file_fmt)
- # struct efi_var_entry
- var_entry_fmt = '<LLQ16s'
- var_entry_size = struct.calcsize(var_entry_fmt)
- # struct efi_time
- var_time_fmt = '<H6BLh2B'
- var_time_size = struct.calcsize(var_time_fmt)
- # WIN_CERTIFICATE
- var_win_cert_fmt = '<L2H'
- var_win_cert_size = struct.calcsize(var_win_cert_fmt)
- # WIN_CERTIFICATE_UEFI_GUID
- var_win_cert_uefi_guid_fmt = var_win_cert_fmt+'16s'
- var_win_cert_uefi_guid_size = struct.calcsize(var_win_cert_uefi_guid_fmt)
+ # struct efi_var_file
+ var_file_fmt = '<QQLL'
+ var_file_size = struct.calcsize(var_file_fmt)
+ # struct efi_var_entry
+ var_entry_fmt = '<LLQ16s'
+ var_entry_size = struct.calcsize(var_entry_fmt)
+ # struct efi_time
+ var_time_fmt = '<H6BLh2B'
+ var_time_size = struct.calcsize(var_time_fmt)
+ # WIN_CERTIFICATE
+ var_win_cert_fmt = '<L2H'
+ var_win_cert_size = struct.calcsize(var_win_cert_fmt)
+ # WIN_CERTIFICATE_UEFI_GUID
+ var_win_cert_uefi_guid_fmt = var_win_cert_fmt+'16s'
+ var_win_cert_uefi_guid_size = struct.calcsize(var_win_cert_uefi_guid_fmt)
class EfiVariable:
def __init__(self, size, attrs, time, guid, name, data):
@@ -149,7 +149,7 @@ class EfiVariableStore:
offs = 0
while offs < len(self.ents):
var, loffs = self._next_var(offs)
- if var.name == name and str(var.guid):
+ if var.name == name and str(var.guid) == guid:
if var.attrs != attrs:
print("err: attributes don't match")
exit(1)
@@ -292,7 +292,7 @@ def pkcs7_sign(cert, key, buf):
# UEFI 2.8 Errata B "8.2.2 Using the EFI_VARIABLE_AUTHENTICATION_2 descriptor"
def cmd_sign(args):
- guid, name, attrs, data, size = parse_args(args)
+ guid, name, attrs, data, _ = parse_args(args)
attrs |= EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
efi = EfiStruct()
@@ -357,7 +357,10 @@ def main():
signp.set_defaults(func=cmd_sign)
args = ap.parse_args()
- args.func(args)
+ if hasattr(args, "func"):
+ args.func(args)
+ else:
+ ap.print_help()
def group(a, *ns):
for n in ns: