diff --git a/xen.fedora.efi.patch b/xen.fedora.efi.patch new file mode 100644 index 0000000..d0c160b --- /dev/null +++ b/xen.fedora.efi.patch @@ -0,0 +1,12 @@ +--- xen-4.16.0/xen/arch/x86/Makefile.orig 2021-11-30 11:42:42.000000000 +0000 ++++ xen-4.16.0/xen/arch/x86/Makefile 2022-03-17 22:43:21.077990559 +0000 +@@ -127,7 +127,8 @@ + CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI + + # Check if the linker supports PE. +-EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(XEN_LDFLAGS)) --subsystem=10 ++#EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(XEN_LDFLAGS)) --subsystem=10 ++EFI_LDFLAGS = --as-needed --build-id=sha1 -mi386pep --subsystem=10 + XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(call ld-option,$(EFI_LDFLAGS) --image-base=0x100000000 -o efi/check.efi efi/check.o)) + # If the above failed, it may be merely because of the linker not dealing well + # with debug info. Try again with stripping it. diff --git a/xen.spec b/xen.spec index ad0f6fe..efc326e 100644 --- a/xen.spec +++ b/xen.spec @@ -55,7 +55,7 @@ Summary: Xen is a virtual machine monitor Name: xen Version: 4.16.0 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ and LGPLv2+ and BSD URL: http://xen.org/ Source0: https://downloads.xenproject.org/release/xen/%{version}/xen-%{version}.tar.gz @@ -126,6 +126,7 @@ Patch58: xen.git-6ef732726add103ee8f63293e326ad43b1643239.patch Patch59: xen.git-243026a2c5ad64c05281dc8ed2f1f57c0ee5988c.patch Patch60: xen.git-41e477b4f367269dc1b768a335cfa16f48f7f02f.patch Patch61: xsa398-4.16-6-x86-spec-ctrl-Cease-using-thunk-lfence-on-AMD.patch +Patch62: xen.efi.build.patch %if %build_qemutrad @@ -353,6 +354,7 @@ manage Xen virtual machines. %patch59 -p1 %patch60 -p1 %patch61 -p1 +%patch62 -p1 # qemu-xen-traditional patches pushd tools/qemu-xen-traditional @@ -483,8 +485,9 @@ find %{buildroot} -print | xargs ls -ld | sed -e 's|.*%{buildroot}||' > f1.list rm -rf %{buildroot}/usr/*-xen-elf # hypervisor symlinks -rm -rf %{buildroot}/boot/xen-4.0.gz +rm -rf %{buildroot}/boot/xen-%{hv_abi}.gz rm -rf %{buildroot}/boot/xen-4.gz +rm -rf %{buildroot}/boot/xen.gz %if !%build_hyp rm -rf %{buildroot}/boot %endif @@ -518,9 +521,14 @@ rm -rf %{buildroot}/%{_libdir}/*.a %if %build_efi # clean up extra efi files -rm -rf %{buildroot}/%{_libdir}/efi %ifarch %{ix86} -rm -rf %{buildroot}/usr/lib64/efi +rm -f %{buildroot}/usr/lib64/efi/xen-%{hv_abi}.efi +rm -f %{buildroot}/usr/lib64/efi/xen-4.efi +rm -f %{buildroot}/usr/lib64/efi/xen.efi +%else +rm -f %{buildroot}/%{_libdir}/efi/xen-%{hv_abi}.efi +rm -f %{buildroot}/%{_libdir}/efi/xen-4.efi +rm -f %{buildroot}/%{_libdir}/efi/xen.efi %endif %endif @@ -903,7 +911,6 @@ fi %if %build_hyp %ifnarch armv7hl aarch64 /boot/xen-*.gz -/boot/xen.gz /boot/xen*.config %else /boot/xen* @@ -914,6 +921,13 @@ fi %endif /usr/lib/debug/xen* %endif +%if %build_efi +%ifarch %{ix86} +/usr/lib64/efi/*.efi +%else +%{_libdir}/efi/*.efi +%endif +%endif %if %build_docs %files doc @@ -952,6 +966,9 @@ fi %endif %changelog +* Mon Mar 21 2022 Michael Young - 4.16.0-5 +- fix build of xen*.efi file and package it in /usr/lib*/efi + * Tue Mar 15 2022 Michael Young - 4.16.0-4 - Multiple speculative security issues [XSA-398] - additional patches so above applies cleanly