From e5a0bdf8762faab7949f5c30fc1eafecbd3ad749 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Tue, 28 Sep 2021 19:01:44 +0100 Subject: [PATCH] Add floppy disk image support --- README.md | 7 +++++++ quickemu | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index 989f867..d3e53b7 100644 --- a/README.md +++ b/README.md @@ -271,6 +271,13 @@ Add additional lines to your virtual machine configuration: * `cpu_cores="4"` - Specify the number of CPU cores allocated to the VM * `ram="4G"` - Specify the amount of RAM to allocate to the VM * `disk="16G"` - Specify the size of the virtual disk allocated to the VM +## Floppy disks + +If you're like [Alan Pope](https://popey.com) you'll probably want to mount a +floppy disk image in the guest. To do so add the following line to the VM +configuration: + + * `floppy="/path/to/floppy.img"` # Network port forwarding diff --git a/quickemu b/quickemu index c860fe1..badcd36 100755 --- a/quickemu +++ b/quickemu @@ -483,6 +483,11 @@ function vm_boot() { -monitor none -serial mon:stdio) + if [ -n "${floppy}" ] && [ -e "${floppy}" ]; then + # shellcheck disable=SC2054 + args+=(-drive file=${floppy},index=0,if=floppy,format=raw) + fi + # Add the disks if [ "${boot}" == "efi" ] || [ "${boot}" == "uefi" ]; then # shellcheck disable=SC2054 @@ -608,6 +613,7 @@ cpu_cores="" disk_img="" disk="64G" fixed_iso="" +floppy="" guest_os="linux" img="" iso=""