add comments
This commit is contained in:
8
flash.py
Executable file → Normal file
8
flash.py
Executable file → Normal 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
|
||||
|
||||
Reference in New Issue
Block a user