diff --git a/flash.py b/flash.py old mode 100755 new mode 100644 index da360a0..c6a280d --- a/flash.py +++ b/flash.py @@ -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