fix(secure_download_mode): Disable secure boot detection and print more info

This commit is contained in:
Radim Karniš
2024-03-14 15:28:41 +01:00
parent 0215786283
commit 1dc3c8bc16
2 changed files with 7 additions and 3 deletions

View File

@@ -906,6 +906,10 @@ def main(argv=None, esp=None):
flash_size = detect_flash_size(esp, args)
elif args.flash_size == "keep":
flash_size = detect_flash_size(esp, args=None)
if not esp.IS_STUB:
print(
"WARNING: In case of failure, please set a specific --flash_size."
)
else:
flash_size = args.flash_size

View File

@@ -230,7 +230,7 @@ def detect_flash_size(esp, args=None):
if flash_size is None:
flash_size = "4MB"
print(
"Warning: Could not auto-detect Flash size "
"WARNING: Could not auto-detect Flash size "
f"(FlashID={flash_id:#x}, SizeID={size_id:#x}), defaulting to 4MB"
)
else:
@@ -568,11 +568,11 @@ def write_flash(esp, args):
print("WARNING: File %s is empty" % argfile.name)
continue
if not esp.get_secure_boot_enabled():
if not esp.secure_download_mode and not esp.get_secure_boot_enabled():
image = _update_image_flash_params(esp, address, args, image)
else:
print(
"WARNING: Secure boot is enabled, so not changing any flash settings."
"WARNING: Security features enabled, so not changing any flash settings."
)
calcmd5 = hashlib.md5(image).hexdigest()
uncsize = len(image)