Created
July 19, 2012 17:19
-
-
Save pingswept/3145433 to your computer and use it in GitHub Desktop.
Python script for burning Rascal filesystem tarball to SD card
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import subprocess, sys | |
device = '/dev/sdc1' | |
label = 'beriberi' | |
tarball = 'rascal-filesystem-beriberi-2012-11-09.tar.gz' | |
commands = [ | |
'umount ' + device, | |
'mkfs.ext3 -L ' + label + ' ' + device, | |
'mount -t ext3 ' + device + ' /media/' + label, | |
'tar --directory /media/' + label + '/ -xzf ' + tarball, | |
'sync', | |
'ls /media/'+ label, | |
'umount ' + device, | |
] | |
while(1): | |
for cmd in commands: | |
print(cmd) | |
subprocess.call(cmd, shell=True) | |
# resp = raw_input('Card burned. Burn another?') | |
# if (resp.lower() == 'y'): | |
# pass | |
# else: | |
# sys.exit() | |
sys.exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment