Update lmc UEFI support to use the edk2-ovmf package
Fedora now has a edk2 package so use the OVMF code from there. This also adds using a copy of OVMF_VARS for each boot instead of reusing the one provided by the package.
This commit is contained in:
parent
6989afb5fd
commit
2a025e8360
@ -90,6 +90,7 @@ Summary: livemedia-creator libvirt dependencies
|
|||||||
Requires: lorax = %{version}-%{release}
|
Requires: lorax = %{version}-%{release}
|
||||||
Requires: libvirt-python3
|
Requires: libvirt-python3
|
||||||
Requires: virt-install
|
Requires: virt-install
|
||||||
|
Requires: edk2-ovmf
|
||||||
|
|
||||||
%description lmc-virt
|
%description lmc-virt
|
||||||
Additional dependencies required by livemedia-creator when using it with virt-install.
|
Additional dependencies required by livemedia-creator when using it with virt-install.
|
||||||
|
@ -71,7 +71,6 @@ DRACUT_DEFAULT = ["--xz", "--add", "livenet dmsquash-live convertfs pollcdrom qe
|
|||||||
|
|
||||||
ROOT_PATH = "/mnt/sysimage/"
|
ROOT_PATH = "/mnt/sysimage/"
|
||||||
RUNTIME = "images/install.img"
|
RUNTIME = "images/install.img"
|
||||||
UEFI_FIRMWARE="loader={0}/OVMF_CODE.fd,loader_ro=yes,loader_type=pflash,nvram_template={0}/OVMF_VARS.fd"
|
|
||||||
|
|
||||||
|
|
||||||
class InstallError(Exception):
|
class InstallError(Exception):
|
||||||
@ -186,13 +185,21 @@ class VirtualInstall(object):
|
|||||||
|
|
||||||
if boot_uefi and ovmf_path:
|
if boot_uefi and ovmf_path:
|
||||||
args.append("--boot")
|
args.append("--boot")
|
||||||
args.append(UEFI_FIRMWARE.format(ovmf_path))
|
|
||||||
|
# Make a copy of the OVMF_VARS.fd for this run
|
||||||
|
ovmf_vars = tempfile.mktemp(prefix="lmc-OVMF_VARS-", suffix=".fd")
|
||||||
|
shutil.copy2(joinpaths(ovmf_path, "/OVMF_VARS.fd"), ovmf_vars)
|
||||||
|
|
||||||
|
args.append("loader=%s/OVMF_CODE.fd,loader_ro=yes,loader_type=pflash,nvram_template=%s" % (ovmf_path, ovmf_vars))
|
||||||
|
|
||||||
log.info("Running virt-install.")
|
log.info("Running virt-install.")
|
||||||
try:
|
try:
|
||||||
execWithRedirect("virt-install", args, raise_err=True)
|
execWithRedirect("virt-install", args, raise_err=True)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
raise InstallError("Problem starting virtual install: %s" % e)
|
raise InstallError("Problem starting virtual install: %s" % e)
|
||||||
|
finally:
|
||||||
|
if boot_uefi and ovmf_path:
|
||||||
|
os.unlink(ovmf_vars)
|
||||||
|
|
||||||
conn = libvirt.openReadOnly(None)
|
conn = libvirt.openReadOnly(None)
|
||||||
dom = conn.lookupByName(self.virt_name)
|
dom = conn.lookupByName(self.virt_name)
|
||||||
@ -1191,7 +1198,7 @@ def main():
|
|||||||
help="Passed to --arch command")
|
help="Passed to --arch command")
|
||||||
virt_group.add_argument("--kernel-args",
|
virt_group.add_argument("--kernel-args",
|
||||||
help="Additional argument to pass to the installation kernel")
|
help="Additional argument to pass to the installation kernel")
|
||||||
virt_group.add_argument("--ovmf-path", default="/usr/share/OVMF/",
|
virt_group.add_argument("--ovmf-path", default="/usr/share/edk2/ovmf/",
|
||||||
help="Path to OVMF firmware")
|
help="Path to OVMF firmware")
|
||||||
virt_group.add_argument("--virt-uefi", action="store_true", default=False,
|
virt_group.add_argument("--virt-uefi", action="store_true", default=False,
|
||||||
help="Use OVMF firmware to boot the VM in UEFI mode")
|
help="Use OVMF firmware to boot the VM in UEFI mode")
|
||||||
|
Loading…
Reference in New Issue
Block a user