From 507b53a75ed049cbb05ce974419db4dd3fdce494 Mon Sep 17 00:00:00 2001 From: wozniaktv Date: Tue, 24 May 2022 09:31:35 +0200 Subject: [PATCH] added check if all partitions are there --- flashall.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/flashall.py b/flashall.py index 22277fe..e7a1eaa 100644 --- a/flashall.py +++ b/flashall.py @@ -22,9 +22,23 @@ class color: print(color.RED + "\npreparing to flash rom, 5 seconds to abort..." + color.END) time.sleep(5) +print(color.PURPLE+"Checking if partitions are there..."+color.END) +time.sleep(1) + +missing = False +for partition in partitions: + if not os.path.exists(f"./{partition}.img"): + missing = True + print(color.RED+f"Missing partition {partition}"+ color.END) +if missing: + print(color.RED+f"due to the missing partitions you have 5 seconds to abort..."+ color.END) + time.sleep(5) +del missing + print(color.RED + "starting to flash rom...\n" + color.END) time.sleep(1) + for partition in partitions: if not os.path.exists(f"./{partition}.img"): print(color.BOLD + color.PURPLE + f"no {partition} to flash" + color.END)