feat: Added warning when secure boot enabled

Warning message that the flash settings parameters won't be changed because of enabled secure boot
This commit is contained in:
Jakub Kocka
2024-02-27 14:43:58 +01:00
committed by Radim Karniš
parent 3b0939c37f
commit 8d2637532a
2 changed files with 10 additions and 1 deletions

View File

@@ -569,7 +569,13 @@ def write_flash(esp, args):
if len(image) == 0:
print("WARNING: File %s is empty" % argfile.name)
continue
image = _update_image_flash_params(esp, address, args, image)
if 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."
)
calcmd5 = hashlib.md5(image).hexdigest()
uncsize = len(image)
if compress:

View File

@@ -178,6 +178,9 @@ class ESP8266ROM(ESPLoader):
def check_spi_connection(self, spi_connection):
raise NotSupportedError(self, "Setting --spi-connection")
def get_secure_boot_enabled(self):
return False # ESP8266 doesn't have security features
class ESP8266StubLoader(ESP8266ROM):
"""Access class for ESP8266 stub loader, runs on top of ROM."""