diff --git a/ansible/roles/bhyve/files/bhyve_netgraph_bridge.bash b/ansible/roles/bhyve/files/bhyve_netgraph_bridge.bash index 5871160..e6985cd 100644 --- a/ansible/roles/bhyve/files/bhyve_netgraph_bridge.bash +++ b/ansible/roles/bhyve/files/bhyve_netgraph_bridge.bash @@ -48,6 +48,7 @@ function start_vm { host_interface_name="$4" bridge_name="bridge_${host_interface_name}" ip_range="$5" + mount_cd="${6:-}" mac_address=$(calculate_mac_address "$name") @@ -66,6 +67,10 @@ function start_vm { # -s 29,fbuf,tcp=0.0.0.0:5900,w=1920,h=1080 \ # TODO: Look into using nmdm instead of stdio for serial console + additional_args=() + if [ -n "$mount_cd" ]; then + additional_args+=("-s" "3,ahci-cd,$mount_cd") + fi while true; do set -x set +e @@ -80,6 +85,7 @@ function start_vm { -s 30,xhci,tablet \ -s 31,lpc -l com1,stdio \ -l "bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,${mount_path}/BHYVE_UEFI_VARS.fd" \ + "${additional_args[@]}" \ "$name" exit_code=$? set -e