From 8bc07288064485684a8944b7810f0922610a8e08 Mon Sep 17 00:00:00 2001 From: mgb01105731 Date: Wed, 23 Nov 2022 13:52:48 +0800 Subject: [PATCH] remove edk2 --- 0001-disable-edk2.patch | 60 +++++++++++++++++++++++++++++++++++++++++ lorax.spec | 13 ++++----- 2 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 0001-disable-edk2.patch diff --git a/0001-disable-edk2.patch b/0001-disable-edk2.patch new file mode 100644 index 0000000..91ae9a7 --- /dev/null +++ b/0001-disable-edk2.patch @@ -0,0 +1,60 @@ +diff -Nurw lorax-37.0/src/pylorax/cmdline.py lorax-37.0_old/src/pylorax/cmdline.py +--- lorax-37.0/src/pylorax/cmdline.py 2022-03-29 02:50:47.000000000 +0800 ++++ lorax-37.0_old/src/pylorax/cmdline.py 2022-11-24 14:28:26.993756765 +0800 +@@ -263,7 +263,7 @@ + "Defaults to qemu-system-") + virt_group.add_argument("--kernel-args", + help="Additional argument to pass to the installation kernel") +- virt_group.add_argument("--ovmf-path", default="/usr/share/edk2/ovmf/", ++ virt_group.add_argument("--ovmf-path", default="/usr/share/OVMF/", + help="Path to OVMF firmware") + virt_group.add_argument("--virt-uefi", action="store_true", default=False, + help="Use OVMF firmware to boot the VM in UEFI mode") +diff -Nurw lorax-37.0/src/pylorax/installer.py lorax-37.0_old/src/pylorax/installer.py +--- lorax-37.0/src/pylorax/installer.py 2022-03-29 02:50:47.000000000 +0800 ++++ lorax-37.0_old/src/pylorax/installer.py 2022-11-24 15:10:12.117693364 +0800 +@@ -38,6 +38,7 @@ + + + ROOT_PATH = "/mnt/sysimage/" ++UEFI_FIRMWARE="loader={0}/OVMF_CODE.fd,loader_ro=yes,loader_type=pflash,nvram_template={0}/OVMF_VARS.fd" + + class InstallError(Exception): + pass +@@ -244,12 +245,7 @@ + + if boot_uefi and ovmf_path: + qemu_cmd += ["-drive", "file=%s/OVMF_CODE.secboot.fd,if=pflash,format=raw,unit=0,readonly=on" % ovmf_path] +- +- # Make a copy of the OVMF_VARS.secboot.fd for this run +- ovmf_vars = tempfile.mktemp(prefix="lmc-OVMF_VARS-", suffix=".fd") +- shutil.copy2(joinpaths(ovmf_path, "/OVMF_VARS.secboot.fd"), ovmf_vars) +- +- qemu_cmd += ["-drive", "file=%s,if=pflash,format=raw,unit=1" % ovmf_vars] ++ qemu_cmd += ["-drive", "file=%sOVMF_VARS.fd,if=pflash,format=raw,unit=1" % ovmf_path] + + log.info("Running qemu") + log.debug(qemu_cmd) +@@ -266,8 +262,6 @@ + raise InstallError("QEMUInstall failed") + finally: + os.unlink(qemu_initrd) +- if boot_uefi and ovmf_path: +- os.unlink(ovmf_vars) + + if cancel_func and cancel_func(): + log.error("Installation error detected. See logfile for details.") +diff -Nurw lorax-37.0/src/sbin/livemedia-creator lorax-37.0_old/src/sbin/livemedia-creator +--- lorax-37.0/src/sbin/livemedia-creator 2022-03-29 02:50:47.000000000 +0800 ++++ lorax-37.0_old/src/sbin/livemedia-creator 2022-11-24 15:12:12.000350605 +0800 +@@ -140,10 +140,6 @@ + + if opts.virt_uefi and not os.path.isdir(opts.ovmf_path): + errors.append("The OVMF firmware is missing from %s" % opts.ovmf_path) +- elif opts.virt_uefi and os.path.isdir(opts.ovmf_path): +- for f in ["OVMF_CODE.secboot.fd", "OVMF_VARS.secboot.fd"]: +- if not os.path.exists(joinpaths(opts.ovmf_path, f)): +- errors.append("OVMF secure boot firmware file %s is missing from %s" % (f, opts.ovmf_path)) + + if opts.domacboot and not os.path.exists("/usr/sbin/mkfs.hfsplus"): + errors.append("mkfs.hfsplus is missing. Install hfsplus-tools, or pass --nomacboot") diff --git a/lorax.spec b/lorax.spec index 83347d4..6c14344 100644 --- a/lorax.spec +++ b/lorax.spec @@ -1,4 +1,4 @@ -%define anolis_release 6 +%define anolis_release 7 # NOTE: This specfile is generated from upstream at https://github.com/rhinstaller/lorax # NOTE: Please submit changes as a pull request %define debug_package %{nil} @@ -12,6 +12,8 @@ License: GPLv2+ URL: https://github.com/weldr/lorax Source0: https://github.com/weldr/lorax/archive/refs/tags/%{name}-%{version}.tar.gz +Patch0001: 0001-disable-edk2.patch + BuildRequires: python3-devel BuildRequires: make BuildRequires: systemd-rpm-macros @@ -84,11 +86,6 @@ Includes the full html documentation for lorax, livemedia-creator, and the pylor Summary: livemedia-creator libvirt dependencies Requires: lorax = %{version}-%{release} Requires: qemu - -# Fedora edk2 builds currently only support these arches -%ifarch x86_64 aarch64 -Requires: edk2-ovmf -%endif Recommends: qemu-kvm %description lmc-virt @@ -118,6 +115,7 @@ Lorax templates for creating the boot.iso and live isos are placed in %prep %setup -q -n %{name}-%{version} +%autopatch -p1 %build @@ -159,6 +157,9 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install %{_datadir}/lorax/templates.d/* %changelog +* Wed Nov 23 2022 mgb01105731 -37.0-7 +- remove edk2 from lorax-lmc-virt + * Fri Oct 28 2022 gaochang 37.0-6 - Reconfig the package requires -- Gitee