diff --git a/scripts/fish/vm-qemu b/scripts/fish/vm-qemu index c7a4407..9121088 100644 --- a/scripts/fish/vm-qemu +++ b/scripts/fish/vm-qemu @@ -1,10 +1,13 @@ # vim: syntax=fish: -function vm-qemu -d "Frontend to QEMU" -a cfg +function vm-qemu -d "Frontend to QEMU" + set cfg $argv[1] + set -e argv[1] env \ _vm_img="/mnt/s/vm/$cfg/image" \ _vm_media="/mnt/s/osmedia" \ _vm_setup="$_agw_dir_rc/virtual-machines/qemu-setup" \ + _vm_args="$argv" \ $_agw_dir_rc/virtual-machines/$cfg/run end diff --git a/virtual-machines/qemu-setup b/virtual-machines/qemu-setup index 8952a18..37e19e3 100644 --- a/virtual-machines/qemu-setup +++ b/virtual-machines/qemu-setup @@ -1,5 +1,16 @@ # vim: syntax=fish: +for opt in $_vm_args + switch "$opt" + case "" + case -i --install + set _use_install 1 + case \* + echo "error: unknown option $opt" + exit 1 + end +end + set _boot_order c set _args \ @@ -12,7 +23,7 @@ if test $_arch = "i386" || test $_arch = "x86_64" $_args end -if test $_install +if test $_install && test $_use_install set _boot_order d set _args \ --drive file="$_install",media=cdrom,readonly \