diff --git a/oz.cfg b/oz.cfg index 8913f9d4..14937730 100644 --- a/oz.cfg +++ b/oz.cfg @@ -11,6 +11,7 @@ image_type = raw # bridge_name = virbr0 # cpus = 1 # memory = 1024 +# boot_mode = bios [cache] original_media = yes diff --git a/oz/Guest.py b/oz/Guest.py index 92bdc71c..941a0e22 100644 --- a/oz/Guest.py +++ b/oz/Guest.py @@ -191,6 +191,8 @@ def __init__(self, tdl, config, auto, output_disk, nicmodel, clockoffset, 'rng_rate_bytes', 1024)) self.rng_rate_period = int(oz.ozutil.config_get_key(config, 'libvirt', 'rng_rate_period', 1000)) + self.boot_mode = oz.ozutil.config_get_key(config, 'libvirt', 'boot_mode', + 'bios') # configuration from 'cache' section self.cache_original_media = oz.ozutil.config_get_boolean_key(config, @@ -497,6 +499,10 @@ def _generate_xml(self, bootdev, installdev, kernel=None, initrd=None, loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch) oz.ozutil.lxml_subelement(osNode, "loader", loader, {'readonly': 'yes', 'type': 'pflash'}) oz.ozutil.lxml_subelement(osNode, "nvram", None, {'template': nvram}) + if self.tdl.arch in ["x86_64"] and self.boot_mode == "uefi": + loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch) + oz.ozutil.lxml_subelement(osNode, "loader", loader, {'readonly': 'yes', 'type': 'pflash'}) + oz.ozutil.lxml_subelement(osNode, "nvram", None, {'template': nvram}) # poweroff, reboot, crash oz.ozutil.lxml_subelement(domain, "on_poweroff", "destroy") oz.ozutil.lxml_subelement(domain, "on_reboot", "destroy")