mirror of
https://github.com/churchers/vm-bhyve.git
synced 2025-12-12 01:40:40 +01:00
Remove uefi setting entirely and use loader=bhyveload/grub/uefi/uefi-csm
This provides a single, consistent way to configure boot method. the guest listing now shows uefi and uefi-csm guests without having to fudge the uefi setting into loader column.
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
VERSION=1.3-devel
|
VERSION=1.3-devel
|
||||||
VERSION_INT=103027
|
VERSION_INT=103028
|
||||||
VERSION_BSD=$(uname -K)
|
VERSION_BSD=$(uname -K)
|
||||||
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
|
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
|
||||||
|
|
||||||
|
|||||||
23
lib/vm-run
23
lib/vm-run
@@ -77,8 +77,14 @@ vm::run(){
|
|||||||
# get cpu topology
|
# get cpu topology
|
||||||
vm::__cpu "_cpu"
|
vm::__cpu "_cpu"
|
||||||
|
|
||||||
# old uefi flag just sets loader="uefi"
|
# check old uefi flag
|
||||||
util::checkyesno "${_uefi}" && _loader="uefi"
|
if util::checkyesno "${_uefi}"; then
|
||||||
|
if [ "${_uefi}" = "csm" ]; then
|
||||||
|
_loader="uefi-csm"
|
||||||
|
else
|
||||||
|
_loader="uefi"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
util::log_rotate "guest" "${_name}"
|
util::log_rotate "guest" "${_name}"
|
||||||
util::log "guest" "${_name}" \
|
util::log "guest" "${_name}" \
|
||||||
@@ -123,19 +129,18 @@ vm::run(){
|
|||||||
util::checkyesno "${_ignore_msr}" && _opts="${_opts}w"
|
util::checkyesno "${_ignore_msr}" && _opts="${_opts}w"
|
||||||
|
|
||||||
# if uefi, make sure we have bootrom, then update options for uefi support
|
# if uefi, make sure we have bootrom, then update options for uefi support
|
||||||
if [ "${_loader}" = "uefi" ]; then
|
if [ "${_loader%-*}" = "uefi" ]; then
|
||||||
if [ ${VERSION_BSD} -lt 1002509 ]; then
|
if [ ${VERSION_BSD} -lt 1002509 ]; then
|
||||||
util::log "guest" "${_name}" "fatal; uefi guests can only be run on FreeBSD 10.3 or newer"
|
util::log "guest" "${_name}" "fatal; uefi guests can only be run on FreeBSD 10.3 or newer"
|
||||||
exit 15
|
exit 15
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "${_uefi}" in
|
case "${_loader}" in
|
||||||
csm)
|
uefi-csm)
|
||||||
_bootrom="/usr/local/share/uefi-firmware/BHYVE_UEFI_CSM.fd"
|
_bootrom="/usr/local/share/uefi-firmware/BHYVE_UEFI_CSM.fd"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
_bootrom="/usr/local/share/uefi-firmware/BHYVE_UEFI.fd"
|
_bootrom="/usr/local/share/uefi-firmware/BHYVE_UEFI.fd"
|
||||||
_uefi="yes"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -145,9 +150,9 @@ vm::run(){
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
_opts="-Hwl bootrom,${_bootrom}"
|
_opts="-Hwl bootrom,${_bootrom}"
|
||||||
|
_uefi="yes"
|
||||||
else
|
else
|
||||||
# make sure uefi is unset as it affects various functions
|
_uefi="no"
|
||||||
_uefi=""
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add any custom bhyve options
|
# add any custom bhyve options
|
||||||
@@ -231,7 +236,7 @@ vm::run(){
|
|||||||
|
|
||||||
# use null.iso if not an install and uefi firmware
|
# use null.iso if not an install and uefi firmware
|
||||||
# old instructions but some windows versions apparently needed this present
|
# old instructions but some windows versions apparently needed this present
|
||||||
[ -z "${_iso}" -a -n "${_uefi}" -a "${_uefi}" != "csm" ] && \
|
[ -z "${_iso}" -a -n "${_uefi}" -a "${_loader}" != "uefi-csm" ] && \
|
||||||
_iso_dev="-s ${_install_slot}:0,ahci-cd,${vm_dir}/.config/null.iso"
|
_iso_dev="-s ${_install_slot}:0,ahci-cd,${vm_dir}/.config/null.iso"
|
||||||
|
|
||||||
# reasonably ugly hack to remove wait option after first run
|
# reasonably ugly hack to remove wait option after first run
|
||||||
|
|||||||
@@ -11,10 +11,11 @@
|
|||||||
# double-quotes, and so cannot be used inside any values.
|
# double-quotes, and so cannot be used inside any values.
|
||||||
|
|
||||||
# loader
|
# loader
|
||||||
# If the guest you are using requires either bhyveload or grub-bhyve,
|
# Specify the loader to use for the guest. This can either be
|
||||||
# specify the loader to use here.
|
# one of the original bhyve loaders (bhyveload/grub), or
|
||||||
|
# you can specify to use uefi firmware to load the guest
|
||||||
#
|
#
|
||||||
# Valid Options: bhyveload,grub,uefi
|
# Valid Options: bhyveload,grub,uefi,uefi-csm
|
||||||
#
|
#
|
||||||
loader=""
|
loader=""
|
||||||
|
|
||||||
@@ -34,15 +35,6 @@ bhyveload_loader=""
|
|||||||
#
|
#
|
||||||
loader_timeout="3"
|
loader_timeout="3"
|
||||||
|
|
||||||
# uefi
|
|
||||||
#
|
|
||||||
# When using a UEFI loader, this can be used to specify the CSM firmware
|
|
||||||
# should be used instead of the default.
|
|
||||||
#
|
|
||||||
# Valid Options: csm
|
|
||||||
#
|
|
||||||
uefi=""
|
|
||||||
|
|
||||||
# cpu (required)
|
# cpu (required)
|
||||||
# specify the number of cpu cores to give to the guest
|
# specify the number of cpu cores to give to the guest
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -3,9 +3,19 @@ graphics="yes"
|
|||||||
xhci_mouse="yes"
|
xhci_mouse="yes"
|
||||||
cpu=2
|
cpu=2
|
||||||
memory=2G
|
memory=2G
|
||||||
|
|
||||||
|
# put up to 8 disks on a single ahci controller.
|
||||||
|
# without this, adding a disk pushes the following network devices onto higher slot numbers,
|
||||||
|
# which causes windows to see them as a new interface
|
||||||
ahci_device_limit="8"
|
ahci_device_limit="8"
|
||||||
|
|
||||||
|
# ideally this should be changed to virtio-net and drivers installed in the guest
|
||||||
|
# e1000 works out-of-the-box
|
||||||
network0_type="e1000"
|
network0_type="e1000"
|
||||||
network0_switch="public"
|
network0_switch="public"
|
||||||
|
|
||||||
disk0_type="ahci-hd"
|
disk0_type="ahci-hd"
|
||||||
disk0_name="disk0.img"
|
disk0_name="disk0.img"
|
||||||
|
|
||||||
|
# windows expects the host to expose localtime by default, not UTC
|
||||||
utctime="no"
|
utctime="no"
|
||||||
|
|||||||
9
vm.8
9
vm.8
@@ -994,8 +994,9 @@ This option sets the loader to use for a guest and must be specified.
|
|||||||
The valid options are
|
The valid options are
|
||||||
.Sy bhyveload ,
|
.Sy bhyveload ,
|
||||||
.Sy grub ,
|
.Sy grub ,
|
||||||
|
.Sy uefi ,
|
||||||
or
|
or
|
||||||
.Sy uefi .
|
.Sy uefi-csm .
|
||||||
.It bhyveload_loader
|
.It bhyveload_loader
|
||||||
This option allows a custom path to be used for the loader inside the guest.
|
This option allows a custom path to be used for the loader inside the guest.
|
||||||
Passed to
|
Passed to
|
||||||
@@ -1013,12 +1014,6 @@ If access to the grub console is needed, this can be increased to give more
|
|||||||
time to connect to the console.
|
time to connect to the console.
|
||||||
If access to the grub console is not required, it can also be reduced to speed
|
If access to the grub console is not required, it can also be reduced to speed
|
||||||
up overall boot.
|
up overall boot.
|
||||||
.It uefi
|
|
||||||
This option can be used to choose the UEFI firmware to use. The only applicable
|
|
||||||
value here is
|
|
||||||
.Sy csm ,
|
|
||||||
which configures the guest to use the firmware that includes traditional BIOS
|
|
||||||
compatability.
|
|
||||||
.It cpu_sockets
|
.It cpu_sockets
|
||||||
Specify the number of CPU sockets that should be exposed to the guest. The product
|
Specify the number of CPU sockets that should be exposed to the guest. The product
|
||||||
of
|
of
|
||||||
|
|||||||
Reference in New Issue
Block a user