Merge pull request #362 from Erethon/eeprom-dump-dir
rnodeconf: Dump eeprom under specific directory
This commit is contained in:
commit
bb53bd3f27
@ -237,6 +237,7 @@ try:
|
|||||||
EXT_DIR = CNF_DIR+"/extracted"
|
EXT_DIR = CNF_DIR+"/extracted"
|
||||||
RT_PATH = CNF_DIR+"/recovery_esptool.py"
|
RT_PATH = CNF_DIR+"/recovery_esptool.py"
|
||||||
TK_DIR = CNF_DIR+"/trusted_keys"
|
TK_DIR = CNF_DIR+"/trusted_keys"
|
||||||
|
ROM_DIR = CNF_DIR+"/eeprom"
|
||||||
|
|
||||||
if not os.path.isdir(CNF_DIR):
|
if not os.path.isdir(CNF_DIR):
|
||||||
os.makedirs(CNF_DIR)
|
os.makedirs(CNF_DIR)
|
||||||
@ -248,6 +249,8 @@ try:
|
|||||||
os.makedirs(EXT_DIR)
|
os.makedirs(EXT_DIR)
|
||||||
if not os.path.isdir(TK_DIR):
|
if not os.path.isdir(TK_DIR):
|
||||||
os.makedirs(TK_DIR)
|
os.makedirs(TK_DIR)
|
||||||
|
if not os.path.isdir(ROM_DIR):
|
||||||
|
os.makedirs(ROM_DIR)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("No access to directory "+str(CNF_DIR)+". This utility needs file system access to store firmware and data files. Cannot continue.")
|
print("No access to directory "+str(CNF_DIR)+". This utility needs file system access to store firmware and data files. Cannot continue.")
|
||||||
@ -2674,7 +2677,7 @@ def main():
|
|||||||
try:
|
try:
|
||||||
timestamp = time.time()
|
timestamp = time.time()
|
||||||
filename = str(time.strftime("%Y-%m-%d_%H-%M-%S"))
|
filename = str(time.strftime("%Y-%m-%d_%H-%M-%S"))
|
||||||
path = "./eeprom/"+filename+".eeprom"
|
path = ROM_DIR + filename + ".eeprom"
|
||||||
file = open(path, "wb")
|
file = open(path, "wb")
|
||||||
file.write(rnode.eeprom)
|
file.write(rnode.eeprom)
|
||||||
file.close()
|
file.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user