From 7f642f5659550a9b73a4381976d359d45218cbc7 Mon Sep 17 00:00:00 2001 From: Matt Churchyard Date: Fri, 16 Oct 2015 09:08:47 +0100 Subject: [PATCH] Add some basic version checking --- lib/vm-core | 5 +++++ vm | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/vm-core b/lib/vm-core index 741e8a45..43a175d1 100644 --- a/lib/vm-core +++ b/lib/vm-core @@ -260,6 +260,11 @@ __vm_run(){ # if uefi, make sure we have bootrom, then update options for uefi support if [ -n "${_uefi}" ]; then + if [ `uname -K` -lt 1100000 ]; then + __log "guest" "${_name}" "uefi guests can only be run on FreeBSD 11 or newer" + exit 15 + fi + if [ "${_uefi}" = "csm" ]; then if [ ! -e "${vm_dir}/.config/BHYVE_UEFI_CSM.fd" ]; then __log "guest" "${_name}" "please download uefi csm firmware to ${vm_dir}/.config/BHYVE_UEFI_CSM.fd" diff --git a/vm b/vm index a2d8cd48..8fe6edb3 100644 --- a/vm +++ b/vm @@ -52,6 +52,7 @@ fi # check environment [ `id -u` -ne 0 ] && __err "virtual machines can only be managed by root" +[ `uname -K` -lt 1000000 ] && __err "please upgrade to FreeBSD 10 or newer for bhyve support" # we should be enabled in rc.conf if ! checkyesno vm_enable; then