Simplify run_vm_bios.sh to unconditionally load clean-state snapshot
This commit is contained in:
@@ -3,34 +3,12 @@
|
|||||||
# Configuration
|
# Configuration
|
||||||
ISO_PATH="${1:-/home/n0va/.local/share/iridium-installer-vm/Fedora.iso}"
|
ISO_PATH="${1:-/home/n0va/.local/share/iridium-installer-vm/Fedora.iso}"
|
||||||
DISK_PATH="${2:-/home/n0va/.local/share/iridium-installer-vm/test-disk.qcow2}"
|
DISK_PATH="${2:-/home/n0va/.local/share/iridium-installer-vm/test-disk.qcow2}"
|
||||||
SNAPSHOT_NAME="clean-state"
|
|
||||||
|
|
||||||
if [ ! -f "$ISO_PATH" ]; then
|
|
||||||
echo "Error: ISO not found at $ISO_PATH"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f "$DISK_PATH" ]; then
|
|
||||||
echo "Error: Disk image not found at $DISK_PATH"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Starting Iridium VM with BIOS (Legacy) support..."
|
echo "Starting Iridium VM with BIOS (Legacy) support..."
|
||||||
echo "ISO: $ISO_PATH"
|
echo "ISO: $ISO_PATH"
|
||||||
echo "Disk: $DISK_PATH"
|
echo "Disk: $DISK_PATH"
|
||||||
|
|
||||||
# Check if snapshot exists
|
|
||||||
LOADVM_ARG=""
|
|
||||||
if qemu-img info "$DISK_PATH" | grep -q " $SNAPSHOT_NAME$"; then
|
|
||||||
echo "Found snapshot '$SNAPSHOT_NAME', loading..."
|
|
||||||
LOADVM_ARG="-loadvm $SNAPSHOT_NAME"
|
|
||||||
else
|
|
||||||
echo "Snapshot '$SNAPSHOT_NAME' not found. Starting from fresh disk state."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# QEMU Command with BIOS
|
# QEMU Command with BIOS
|
||||||
# Note: For snapshots to work reliably, all writable disks must be qcow2.
|
|
||||||
# The ISO is raw but readonly=on, which is compatible.
|
|
||||||
qemu-system-x86_64 \
|
qemu-system-x86_64 \
|
||||||
-enable-kvm \
|
-enable-kvm \
|
||||||
-m 8G \
|
-m 8G \
|
||||||
@@ -47,4 +25,4 @@ qemu-system-x86_64 \
|
|||||||
-display gtk,gl=on \
|
-display gtk,gl=on \
|
||||||
-monitor unix:$HOME/.local/share/iridium-installer-vm/monitor.sock,server,nowait \
|
-monitor unix:$HOME/.local/share/iridium-installer-vm/monitor.sock,server,nowait \
|
||||||
-name "Iridium Installer Test VM (BIOS)" \
|
-name "Iridium Installer Test VM (BIOS)" \
|
||||||
$LOADVM_ARG
|
-loadvm clean-state
|
||||||
|
|||||||
Reference in New Issue
Block a user