Skip to content

Commit

Permalink
Don't require a boot disk for uefi
Browse files Browse the repository at this point in the history
It's possible to boot a guest directly from a passthru device
Github issue #344
  • Loading branch information
churchers committed Jan 14, 2020
1 parent 4c2fce2 commit 6385042
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/vm-base
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

VERSION=1.4.1
VERSION_INT=104001
VERSION=1.4.2
VERSION_INT=104002
VERSION_BSD=$(uname -K)
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin

Expand Down
2 changes: 1 addition & 1 deletion lib/vm-core
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ core::__start(){
config::get "_uefi" "uefi"

# check minimum configuration
if [ -z "${_cpu}" -o -z "${_memory}" -o -z "${_disk}" ]; then
if [ -z "${_cpu}" -o -z "${_memory}" ]; then
echo " ! incomplete virtual machine configuration"
return 1
fi
Expand Down
6 changes: 6 additions & 0 deletions lib/vm-guest
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ guest::load(){
local _iso="$1"
local _args _command _timeout _grub_opt _bsd_loader

# require a boot disk
if [ -z "${_bootdisk}" ]; then
util::log "guest" "${_name}" "fatal; non-uefi loaders require a boot disk device"
return 15
fi

# all loaders have same console and wired memory options
[ -z "${VM_OPT_FOREGROUND}" ] && _args="-c ${_com}"
[ "${_wiredmem}" = "1" ] && _args="${_args}${_args:+ }-S"
Expand Down
4 changes: 2 additions & 2 deletions lib/vm-run
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ vm::run(){
" [primary disk dev: ${_bootdisk_dev}]"

# check basic settings
if [ -z "${_loader}" -o -z "${_cpu}" -o -z "${_memory}" -o -z "${_bootdisk}" ]; then
if [ -z "${_loader}" -o -z "${_cpu}" -o -z "${_memory}" ]; then
util::log "guest" "${_name}" "fatal; unable to start - missing required configuration"
exit 15
fi
Expand Down Expand Up @@ -192,7 +192,7 @@ vm::run(){
util::checkyesno "${_debug}" && _logpath="${VM_DS_PATH}/${_name}/bhyve.log"

# complete the boot disk path
vm::get_disk_path "_bootdisk" "${_name}" "${_bootdisk}" "${_bootdisk_dev}"
[ -n "${_bootdisk}" ] && vm::get_disk_path "_bootdisk" "${_name}" "${_bootdisk}" "${_bootdisk_dev}"

# build bhyve device string
vm::bhyve_device_comports
Expand Down

0 comments on commit 6385042

Please sign in to comment.