From 8a3df79bc9bdd024fb463382ad35c8339c856306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20M=C3=B3zes?= Date: Thu, 23 Dec 2021 19:35:40 +0000 Subject: [PATCH] app-emulation/xen: add USE to disable boot symlinks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://bugs.gentoo.org/829765 Signed-off-by: Tomáš Mózes Closes: https://github.com/gentoo/gentoo/pull/23484 Signed-off-by: Joonas Niilola --- app-emulation/xen/files/xen-4.16-efi.patch | 38 ------------------- .../xen/files/xen-4.16-no-symlink.patch | 17 +++++++++ app-emulation/xen/metadata.xml | 1 + ...xen-4.16.0.ebuild => xen-4.16.0-r1.ebuild} | 13 ++++--- 4 files changed, 25 insertions(+), 44 deletions(-) delete mode 100644 app-emulation/xen/files/xen-4.16-efi.patch create mode 100644 app-emulation/xen/files/xen-4.16-no-symlink.patch rename app-emulation/xen/{xen-4.16.0.ebuild => xen-4.16.0-r1.ebuild} (95%) diff --git a/app-emulation/xen/files/xen-4.16-efi.patch b/app-emulation/xen/files/xen-4.16-efi.patch deleted file mode 100644 index 1285c421f3d2f..0000000000000 --- a/app-emulation/xen/files/xen-4.16-efi.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/xen/Makefile b/xen/Makefile -index dfb0efcc..3bd51ec1 100644 ---- a/xen/Makefile -+++ b/xen/Makefile -@@ -311,9 +311,17 @@ _install: Z=$(CONFIG_XEN_INSTALL_SUFFIX) - _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX) - [ -d $(D)$(BOOT_DIR) ] || $(INSTALL_DIR) $(D)$(BOOT_DIR) - $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_FULLVERSION)$(Z) -- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z) -- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z) -- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z) -+ -+ if [ 'x$(EFI_VENDOR)' == 'x' ]; then \ -+ ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z); \ -+ ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z); \ -+ ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z); \ -+ else \ -+ $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z); \ -+ $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z); \ -+ $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z); \ -+ fi; -+ - [ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR) - $(INSTALL_DATA) $(TARGET)-syms $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION) - $(INSTALL_DATA) $(TARGET)-syms.map $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION).map -diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile -index 69b6cfad..d8b09d95 100644 ---- a/xen/arch/x86/Makefile -+++ b/xen/arch/x86/Makefile -@@ -127,7 +127,7 @@ export XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o efi/check. - CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI - - # Check if the linker supports PE. --EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(XEN_LDFLAGS)) --subsystem=10 -+EFI_LDFLAGS = -mi386pep $(patsubst -m%,-mi386pep,$(XEN_LDFLAGS)) --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/app-emulation/xen/files/xen-4.16-no-symlink.patch b/app-emulation/xen/files/xen-4.16-no-symlink.patch new file mode 100644 index 0000000000000..8aed75b520c57 --- /dev/null +++ b/app-emulation/xen/files/xen-4.16-no-symlink.patch @@ -0,0 +1,17 @@ +diff --git a/xen/Makefile b/xen/Makefile +index dfb0efcc..1816eb66 100644 +--- a/xen/Makefile ++++ b/xen/Makefile +@@ -311,9 +311,9 @@ _install: Z=$(CONFIG_XEN_INSTALL_SUFFIX) + _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX) + [ -d $(D)$(BOOT_DIR) ] || $(INSTALL_DIR) $(D)$(BOOT_DIR) + $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_FULLVERSION)$(Z) +- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z) +- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z) +- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z) ++ $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z) ++ $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z) ++ $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z) + [ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR) + $(INSTALL_DATA) $(TARGET)-syms $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION) + $(INSTALL_DATA) $(TARGET)-syms.map $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION).map diff --git a/app-emulation/xen/metadata.xml b/app-emulation/xen/metadata.xml index c9b2f33aa70a8..68e9c297bc427 100644 --- a/app-emulation/xen/metadata.xml +++ b/app-emulation/xen/metadata.xml @@ -14,6 +14,7 @@ Gentoo Xen Project + Symlink xen.gz variants in /boot, disable on fat filesystems Enable the Flask XSM module from NSA Adds efi boot support, requires LDFLAG -melf_x86_64 for amd64 diff --git a/app-emulation/xen/xen-4.16.0.ebuild b/app-emulation/xen/xen-4.16.0-r1.ebuild similarity index 95% rename from app-emulation/xen/xen-4.16.0.ebuild rename to app-emulation/xen/xen-4.16.0-r1.ebuild index 5cbf9f9801413..ea9f254e98d21 100644 --- a/app-emulation/xen/xen-4.16.0.ebuild +++ b/app-emulation/xen/xen-4.16.0-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -37,7 +37,8 @@ DESCRIPTION="The Xen virtual machine monitor" HOMEPAGE="https://www.xenproject.org" LICENSE="GPL-2" SLOT="0" -IUSE="debug efi flask" +IUSE="+boot-symlinks debug efi flask" +REQUIRED_USE="arm? ( debug )" DEPEND="${PYTHON_DEPS} efi? ( >=sys-devel/binutils-2.22[multitarget] ) @@ -54,8 +55,6 @@ RESTRICT="test splitdebug strip" # Approved by QA team in bug #144032 QA_WX_LOAD="boot/xen-syms-${PV}" -REQUIRED_USE="arm? ( debug )" - S="${WORKDIR}/${MY_P}" pkg_setup() { @@ -94,8 +93,10 @@ src_prepare() { # Gentoo's patchset [[ -n ${GENTOO_VER} ]] && eapply "${WORKDIR}"/patches-gentoo - # Symlinks do not work on fat32 volumes - eapply "${FILESDIR}"/${PN}-4.16-efi.patch + # Symlinks do not work on fat32 volumes # 829765 + if ! use boot-symlinks || use efi; then + eapply "${FILESDIR}"/${PN}-4.16-no-symlink.patch + fi # Enable XSM-FLASK use flask && eapply "${FILESDIR}"/${PN}-4.15-flask.patch