virtual-machines: add -i/--install option for mounting installer images

master
an 2019-08-05 17:29:36 -04:00
parent 029562aff9
commit 8409bfc27f
2 changed files with 16 additions and 2 deletions

View File

@ -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

View File

@ -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 \