Why not do all the work up until this point with $VM_TMP_DIR/root.cpio and then after that is complete compress it and write it to the final file named with whater.cpio.gz?