From 5b3d26a90aaccd4b91afd7913f3b77c83ea1cdd2 Mon Sep 17 00:00:00 2001 From: Michael Faragher Date: Wed, 22 Feb 2023 12:49:24 -0600 Subject: [PATCH] Additional error messages for offline flashing. --- RNS/Utilities/rnodeconf.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/RNS/Utilities/rnodeconf.py b/RNS/Utilities/rnodeconf.py index de2e577..e7e4fae 100644 --- a/RNS/Utilities/rnodeconf.py +++ b/RNS/Utilities/rnodeconf.py @@ -831,6 +831,9 @@ class RNode(): print(" WARNING! This device is NOT verifiable and should NOT be trusted.") print(" Someone could have added privacy-breaking or malicious code to it.") print(" ") + print(" Please verify the signing key is present on this machine.") + print(" Autogenerated keys will not match another machine's signature.") + print(" ") print(" Proceed at your own risk and responsibility! If you created this") print(" device yourself, please read the documentation on how to sign your") print(" device to avoid this warning.") @@ -948,6 +951,7 @@ def ensure_firmware_file(fw_filename): RNS.log("Failed to retrive latest version information for your board.") RNS.log("Check your internet connection and try again.") RNS.log("If you don't have Internet access currently, use the --fw-version option to manually specify a version.") + RNS.log("You can also use --extract to copy the firmware from a known-good RNode of the same model.") exit() import shutil @@ -972,6 +976,7 @@ def ensure_firmware_file(fw_filename): os.makedirs(UPD_DIR+"/"+selected_version) if not os.path.isfile(UPD_DIR+"/"+selected_version+"/"+fw_filename): + RNS.log("Firmware "+UPD_DIR+"/"+selected_version+"/"+fw_filename+" not found.") RNS.log("Downloading missing firmware file: "+fw_filename+" for version "+selected_version) urlretrieve(update_target_url, UPD_DIR+"/"+selected_version+"/"+fw_filename) RNS.log("Firmware file downloaded") @@ -986,6 +991,7 @@ def ensure_firmware_file(fw_filename): selected_hash = release_info.split()[1] except Exception as e: RNS.log("Could not read locally cached release information.") + RNS.log("Ensure "+UPD_DIR+"/"+selected_version+"/"+fw_filename+".version exists and has the correct format and hash.") RNS.log("You can clear the cache with the --clear-cache option and try again.") if selected_hash == None: @@ -1132,6 +1138,11 @@ def main(): if args.fw_version != None: selected_version = args.fw_version + try: + check_float = float(selected_version) + except ValueError: + RNS.log("Selected version \""+selected_version+"\" does not appear to be a number.") + exit() if args.force_update: force_update = True @@ -2937,4 +2948,4 @@ def extract_recovery_esptool(): exit(181) if __name__ == "__main__": - main() \ No newline at end of file + main()