Skip to content

Instantly share code, notes, and snippets.

Created Oct 1, 2018
What would you like to do?
stitch xva's Ref/* files into raw image
# stolen from now defunct
# To summarize the .xva format:
# - it's a tar file
# - it contains a folder
# - the folder contains chunks of 1MB each
# - they can be concatenated, but blank space needs to be filled
dd if=/dev/zero of=blank bs=1024 count=1k
test -f image.img && rm -f image.img
touch image.img
max=`ls ???????? | sort | tail -n1`
for i in `seq 0 $max`; do
fn=`printf "%08d" $i`
echo -n "$fn of $max"
if [ -f "$fn" ]; then
echo " - appending chunk"
cat $fn >> image.img
echo " - filling blank"
cat blank >> image.img
rm -f blank
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment