Skip to content

Instantly share code, notes, and snippets.

@pingswept
Created July 19, 2012 17:19
Show Gist options
  • Save pingswept/3145433 to your computer and use it in GitHub Desktop.
Save pingswept/3145433 to your computer and use it in GitHub Desktop.
Python script for burning Rascal filesystem tarball to SD card
#!/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