What I wanted was a script that would run under Python on a Linux workstation and do the following:
- Save an image to the hard drive of the Linux box or burn a previously saved image to an SD Card (--save and --burn).
- Optionally compress the saved image (and decompress as part of the burn process) as the hard drive on my Linux box is kinda small (--zip).
- Organize my images into three folders with one for original Distro images, one for date stamped Backups, and one for Checkpoints. An example of my use of Checkpoints: I have an Arch image that is built just to the point of the network running, one that includes LXDE, and one that is my working Robot (--checkpoint and --distros with backup being default).
- List images available for burn in the above folders (--list).
- Provide password on the command line so it can be fed to sudo for the execution of the dd command
- Enable a save or restore at the partition level. Note that only two partitions are supported and that a burn destination will be reformatted and partitioned to fit the saved image
- Alter output from the script with one displaying everything (--verbose) and one nothing (--quiet). The default is to display a minimum of status but to prompt for confirmation of command line options.
- Added an image number to the --list option such that the user can provide that number for a burn request rather than an entire image name.
Some examples of the script command line invocation:
Output from the --list command showing image numbers:
I had made the source code for this script available but then pulled it when I a) realized that there were still features that I wanted to add and b) that as I added those features I was also introducing bugs.
I have finally finished development and a fair amount of testing on the three Ubuntu machines that I have available. The code is available here. I would really appreciate some feedback and any reports of problems.