improved gang flash

This commit is contained in:
schneider 2011-08-06 07:11:45 +02:00
parent 6721b93d53
commit 83f9b3513c
2 changed files with 17 additions and 9 deletions

View File

@ -44,7 +44,7 @@ def flash(count, target, firmware):
def copy(count, target, dir): def copy(count, target, dir):
flashed = [] flashed = []
filestocopy = os.listdir(dir) #filestocopy = os.listdir(dir)
os.mkdir("/tmp/r0ket") os.mkdir("/tmp/r0ket")
while len(flashed) != count: while len(flashed) != count:
@ -68,10 +68,11 @@ def copy(count, target, dir):
print "mkdir", "/tmp/r0ket/"+device print "mkdir", "/tmp/r0ket/"+device
os.mkdir("/tmp/r0ket/"+device) os.mkdir("/tmp/r0ket/"+device)
print "mount "+target+device+" "+"/tmp/r0ket/"+device print "mount "+target+device+" "+"/tmp/r0ket/"+device
os.system("mount "+target+device+" "+"/tmp/r0ket/"+device) os.system("mount -t vfat "+target+device+" "+"/tmp/r0ket/"+device)
for file in filestocopy: os.system("../tools/crypto/generate-keys")
print "cp "+dir+file+" /tmp/r0ket/"+device #for file in filestocopy:
os.system("cp "+dir+file+" /tmp/r0ket/"+device) print "cp "+dir+"/* /tmp/r0ket/"+device
os.system("cp "+dir+"/* /tmp/r0ket/"+device)
print "flashed %s" % device print "flashed %s" % device
except Exception, ex: except Exception, ex:
print "error!" print "error!"
@ -84,6 +85,8 @@ def copy(count, target, dir):
for mount in mounted: for mount in mounted:
print "touch /tmp/r0ket/"+mount+"/flashed.cfg" print "touch /tmp/r0ket/"+mount+"/flashed.cfg"
os.system("touch /tmp/r0ket/"+mount+"/flashed.cfg") os.system("touch /tmp/r0ket/"+mount+"/flashed.cfg")
print "sync"
os.system("sync")
print "umount /tmp/r0ket/"+mount print "umount /tmp/r0ket/"+mount
os.system("umount /tmp/r0ket/"+mount) os.system("umount /tmp/r0ket/"+mount)
print "rm /tmp/r0ket/"+mount print "rm /tmp/r0ket/"+mount
@ -94,10 +97,10 @@ def copy(count, target, dir):
while True: while True:
flash(6, "/dev/lpcflash/", "bootstrap.bin")
raw_input("Flashed bootstrap firmware.\nNow cycle power and press enter.")
copy(6, "/dev/r0ketflash/","../default-files/")
flash(6, "/dev/lpcflash/", "firmware.bin")
raw_input("Flashed firmware.\nNow cycle power and press enter.") raw_input("Flashed firmware.\nNow cycle power and press enter.")
flash(8, "/dev/lpcflash/", "initial.bin")
raw_input("Flashed bootstrap firmware.\nNow cycle power and press enter.")
copy(8, "/dev/r0ketflash/","files")
flash(8, "/dev/lpcflash/", "final.bin")

5
tools/bootloader/watchlist Executable file
View File

@ -0,0 +1,5 @@
echo lpcflash:
ls /dev/lpcflash
echo r0ketflash
ls /dev/r0ketflash