# Shell snippet: read the vmix agent's result off the VMIX HFS+ volume of a raw # disk image (${image}). Prints the guest logs and sets STATUS to the contents # of vmix-run.status ("0" on success). Uses libguestfs (mtools is FAT-only). The # agent unmounts VMIX cleanly before shutdown, so a read-only mount is safe. { ... }: image: '' echo "=== vmix: reading result from ${image} ===" for f in install.log system-install.log vmix-run.log vmix-agent.log; do C=$(guestfish --ro -a ${image} -m /dev/sda1 cat /$f 2>/dev/null || true) [ -n "$C" ] && { echo "--- $f ---"; printf '%s\n' "$C"; } done STATUS=$(guestfish --ro -a ${image} -m /dev/sda1 cat /vmix-run.status 2>/dev/null | tr -d '[:space:]' || true) ''