fix: vminstall.sh: show the QEMU, serial and install logs when the install fails
Sync git.upriser.nl mirror / sync (push) Skipped

This commit is contained in:
theupriser committed 2026-09-30 10:07:43 +02:00
1 parent 232c92fcd7
commit 913a8f0830
1 file changed
+6 -1
+6 -1
View File
@@ -183,7 +183,12 @@ done
kill -0 $qemu 2>/dev/null && { echo "The install didn't finish in 90 minutes; see $www/install.log." >&2; kill $qemu; exit 1; }
status="$(cat "$www/status" 2>/dev/null || echo "no status (the live system never reported back)")"
cp "$www/install.log" install.log 2>/dev/null || true
[[ "$status" == ok ]] || { echo "Install failed: $status. Log: $VM_DIR/install.log" >&2; exit 1; }
if [[ "$status" != ok ]]; then
echo "Install failed: $status. Log: $VM_DIR/install.log" >&2
# In CI only the job log survives: show why.
for f in vm-install.log serial.log install.log; do [[ -s "$f" ]] && { echo "--- $f (last 40 lines)" >&2; tail -n 40 "$f" | sed 's/\x1b\[[0-9;]*[A-Za-z]//g' >&2; }; done
exit 1
fi
qemu-img snapshot -c clean disk.qcow2 && cp vars.fd vars.clean.fd
echo "Installed; snapshot 'clean' taken."