add comments

This commit is contained in:
ducoterra
2019-09-11 21:57:56 -04:00
parent b10e31f7f7
commit 930672acb6

8
flash.py Executable file → Normal file
View File

@@ -44,17 +44,25 @@ def flash(dev):
try:
flash_cmd = ["/bin/dd", f"if={IMAGE}", f"of={dev}"]
print("flashing")
subprocess.run(flash_cmd)
print("flashed")
with tempfile.TemporaryDirectory() as tempdir:
mount_cmd = ["mount",f"{dev}2", tempdir]
umount_cmd = ["umount", tempdir]
print("mounting")
subprocess.run(mount_cmd)
print(f"changing dir to {tempdir}")
os.chdir(tempdir)
print("making ssh dir")
os.mkdir("ssh")
print(f"changing dir to {PWD}")
os.chdir(PWD)
print(f"copying wpa_supplicant to {tempdir}")
copyfile("wpa_supplicant.conf", tempdir)
print("unmounting")
subprocess.run(umount_cmd)
return True