Gentoo Archives: gentoo-commits

From: Yixun Lan <dlan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/xen-tools/files/, app-emulation/xen-tools/
Date: Tue, 16 Apr 2019 06:27:58
Message-Id: 1555396068.0647ece2a5a3cf9dcd2983f145c33fde7173782b.dlan@gentoo
commit:     0647ece2a5a3cf9dcd2983f145c33fde7173782b
Author:     Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
AuthorDate: Sun Apr 14 03:31:11 2019 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Tue Apr 16 06:27:48 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0647ece2

app-emulation/xen-tools: improve ipxe support

Add choice to build ipxe from xen-tools or use the system provided
sys-firmware/ipxe package. Since ipxe depends on rombios, make it
and explicit USE. By default, qemu, rombios and ipxe are enabled in
xen so enable then in Gentoo too, with hvm as it's needed for
rombios/ipxe. Dropping unused patches from xen patchset 17.

Closes: https://github.com/gentoo/gentoo/pull/11675
Closes: https://bugs.gentoo.org/682710

Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 app-emulation/xen-tools/Manifest                   |  2 ++
 app-emulation/xen-tools/files/gentoo-patches.conf  |  2 ++
 app-emulation/xen-tools/metadata.xml               | 11 ++++---
 ...ls-4.12.0.ebuild => xen-tools-4.12.0-r1.ebuild} | 36 ++++++++++++++--------
 4 files changed, 35 insertions(+), 16 deletions(-)

diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest
index e92f3a49114..a7a4b99ecae 100644
--- a/app-emulation/xen-tools/Manifest
+++ b/app-emulation/xen-tools/Manifest
@@ -1,4 +1,5 @@
 DIST edk2-ef529e6ab7c31290a33045bb1f1837447cc0eb56.tar.gz 38714813 BLAKE2B 1c0670c6447aa7d2610e59481324eafe3dbf54cc0480c855380372cf5b95469de4182b569d1c4429df71ceb9be014cb414e070a808609d185b488519955b8677 SHA512 8eb88006500d9d6982e5565bdb71bf47dfe2b9669e107f48b6b237d7efbbfb54b9fd81841421c347e5c0ca45ef9c08f0b95983c8b922c2e1072b0e42b8ede92c
+DIST ipxe-git-d2063b7693e0e35db97b2264aa987eb6341ae779.tar.gz 3792227 BLAKE2B 720ac29ab3187d7abaec33823dda967caab7eea9631123a7619d2f83d3ad6c7bb47db01665a4c54548fe367866606936d36690a06ecf42323b9bd0ef00e41569 SHA512 2b4ae8e65cd678dbb376f24001294eb54aead8d66456e06fc270dec178d90b282c1eb19731234d8b458054e49c5b8b8c4a89345c63ed0a4dafaf205e642b00b7
 DIST ovmf-20170321.tar.xz 22141096 BLAKE2B 79e991c8f9deb297865c319e88b6e6d46b1d08067d3fd639c83f2a379670779ecc60c74c2671ea4eb4a6659fe08ac2d7d4ff337b010b42a908a50829a2d18eeb SHA512 f65dabde3df967224e2072817211786ee4fc3994ee31f8f9d6f67fd74e3479e1da459c720169dd81020cdc1777e4600e531bb124b4625c2ded42c6005bdc802a
 DIST seabios-1.10.0.tar.gz 588213 BLAKE2B 254eb4572a1dac06020a545820efb53a130a027aaab035cd916009b424475f89bd151f82f1bc5103c01c4657d09da3219d2fbcc7728add473011dcfc7bff7410 SHA512 f1b83ce37b59070b488e19f98c95ca9f413cf4969663331b631c3ccb884c90b2db793d32a779ef05cead538c2fd123be4b73391ad2fa20c900a1f14237178d8c
 DIST seabios-1.12.0.tar.gz 613542 BLAKE2B f145c2db716996bfa9e5c014086ccfaa8ae96ebc158f34303b122b7bf209408c567665d8691364df8d8e886f63e0e72a3f3cd319dfa86ef581023201b5d94e53 SHA512 e52c5363e5bb37b5286e55545aa06bd126218f9d0e3a06ac2e189de68fe3de3256c11ca1bb13357a9c384d7e3af6284083ff3aa587688b5de04ef11b97bdfa27
@@ -9,4 +10,5 @@ DIST xen-4.11.1-upstream-patches-0.tar.xz 45416 BLAKE2B 3990dbf338c2aebe1cd601d7
 DIST xen-4.11.1.tar.gz 25152217 BLAKE2B a8dfbeb3d490787725c589e1ce82dcbbcd0be7fb4743b38daf3a8704dffda34d1faabb07d74e01d2fab1572ce0b730c21192469317545e8b3edb3fae1130ef8c SHA512 c1655c5decdaed95a2b9a99652318cfc72f6cfdae957cfe60d635f7787e8850f33e8fafc4c4b8d61fb579c9b9d93028a6382903e71808a0418b931e76d72a649
 DIST xen-4.12.0.tar.gz 26949697 BLAKE2B 9175cc9054e4a2b5c34df89a4efd667f86b4861bef9c3310bf431d041f710a7cb265b4d34a76ab18a17a3121392942d2e5d76c5044eb9b957d4255af889fe69a SHA512 0ce366dcac607c9b592c5e9c0f40652eef743913b246bed4b0c380b8d59ac23a6adcd05befec37fc799a61476f47df76d4911cbf1da6ceb51441c546bf2464de
 DIST xen-gentoo-patches-16.tar.xz 36980 BLAKE2B a59fcb221a915e39fbbc463fa8b1ca1ef00007654936cc17f64853d91737478a6f78480a3e459b07b8c3ddcc81ab9400beb9ea3906750ba69864d1b97db349d2 SHA512 7727e5c7f4ef997eea830618bc26b26f3a99539a1c702264132401e41a328b384346a06b6721f18e3056fc91a2d2d2bf6320e0ae3c79432c7458a24a0d269c56
+DIST xen-gentoo-patches-17.tar.xz 15688 BLAKE2B d5e3bdb15e182c5f0c21adfa5cb5b88e3453e5035659823e3322074646c3ea89b55bf54d0ec6c54966d9739544d156de365a60acf928b799b68978be3380a002 SHA512 f1000ca36166fa21d4b18fb9ecf36f55b1450c312622fbe38545f78aabc150e2d6cce4bd58472c41bd9be8945940a0bc953ba7e470cd5095cf2e7d8a87769b2b
 DIST xen-ovmf-patches-3.tar.xz 4208 BLAKE2B 0df8f85667a33c91cbfd86c59aec2ae65eca892b45d66eed76f793a52e2748989bc2785861f8bfdf94235ef7a6c0be6572c6e6cce9695469e40f0facd0ce3947 SHA512 abe001053ca702138bbcdd6bea14e2daae5c785f862d6a15001ca894c8ed8617f0c5dc439c6f54a41433b988acf57c71911af1db074aa76732c39d98622a3b5b

diff --git a/app-emulation/xen-tools/files/gentoo-patches.conf b/app-emulation/xen-tools/files/gentoo-patches.conf
index 8b3a7b89fb0..7b4465859fe 100644
--- a/app-emulation/xen-tools/files/gentoo-patches.conf
+++ b/app-emulation/xen-tools/files/gentoo-patches.conf
@@ -1,5 +1,6 @@
 # Bug 496708
 _gx045=" xen-tools-4.10.1-unbundle-ipxe.patch"
+_gx054=" xen-tools-4.12.0-unbundle-ipxe.patch"
 
 # Bug 379537
 _gx017=" fix-gold-ld.patch"
@@ -78,4 +79,5 @@ ${_gx027}
 ${_gx028} ${_gx029}
 ${_gx037} ${_gx042}
 ${_gx053} ${_gx050} ${_gx051}
+${_gx054}
 "

diff --git a/app-emulation/xen-tools/metadata.xml b/app-emulation/xen-tools/metadata.xml
index 5009c6f323e..3d5273174a3 100644
--- a/app-emulation/xen-tools/metadata.xml
+++ b/app-emulation/xen-tools/metadata.xml
@@ -9,14 +9,17 @@
 		<flag name="api">Build the C libxenapi bindings</flag>
 		<flag name="flask">Enable the Flask XSM module from NSA</flag>
 		<flag name="hvm">Enable support for hardware based virtualization (VT-x,AMD-v)</flag>
+		<flag name="ipxe">Enable ipxe support</flag>
+		<flag name="ocaml">Enable support for the ocaml language</flag>
+		<flag name="ovmf">Enable support to boot UEFI guest vm, needed by hvm</flag>
+		<flag name="pam">Enable pam support</flag>
+		<flag name="pygrub">Install the pygrub boot loader</flag>
 		<flag name="qemu">Enable IOEMU support via the use of qemu-dm</flag>
 		<flag name="qemu-traditional">Build the old qemu traditional device model (useful only if you cannot change to the new device model e.g. Windows VMs)</flag>
-		<flag name="pygrub">Install the pygrub boot loader</flag>
+		<flag name="rombios">Enable rombios support, needed by ipxe</flag>
 		<flag name="screen">Enable support for running domain U console in an <pkg>app-misc/screen</pkg> session</flag>
+		<flag name="system-ipxe">Using <pkg>sys-firmware/ipxe</pkg> instead of the bundled one</flag>
 		<flag name="system-qemu">Using <pkg>app-emulation/qemu</pkg> instead of the bundled one</flag>
 		<flag name="system-seabios">Using <pkg>sys-firmware/seabios</pkg> instead of the bundled one</flag>
-		<flag name="ocaml">Enable support for the ocaml language</flag>
-		<flag name="ovmf">Enable support to boot UEFI guest vm, needed by hvm</flag>
-		<flag name="pam">Enable pam support</flag>
 	</use>
 </pkgmetadata>

diff --git a/app-emulation/xen-tools/xen-tools-4.12.0.ebuild b/app-emulation/xen-tools/xen-tools-4.12.0-r1.ebuild
similarity index 94%
rename from app-emulation/xen-tools/xen-tools-4.12.0.ebuild
rename to app-emulation/xen-tools/xen-tools-4.12.0-r1.ebuild
index f68edb0a8dd..3084ea4bee9 100644
--- a/app-emulation/xen-tools/xen-tools-4.12.0.ebuild
+++ b/app-emulation/xen-tools/xen-tools-4.12.0-r1.ebuild
@@ -20,7 +20,7 @@ else
 	UPSTREAM_VER=
 	SECURITY_VER=
 	# xen-tools's gentoo patches tarball
-	GENTOO_VER=16
+	GENTOO_VER=17
 	# xen-tools's gentoo patches version which apply to this specific ebuild
 	GENTOO_GPV=0
 	# xen-tools ovmf's patches
@@ -28,6 +28,7 @@ else
 
 	SEABIOS_VER=1.12.0
 	EDK2_COMMIT=ef529e6ab7c31290a33045bb1f1837447cc0eb56
+	IPXE_COMMIT=d2063b7693e0e35db97b2264aa987eb6341ae779
 
 	[[ -n ${UPSTREAM_VER} ]] && \
 		UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz
@@ -42,6 +43,7 @@ else
 
 	SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/xen-${MY_PV}.tar.gz
 	https://www.seabios.org/downloads/seabios-${SEABIOS_VER}.tar.gz
+	ipxe? ( http://xenbits.xen.org/xen-extfiles/ipxe-git-${IPXE_COMMIT}.tar.gz )
 	ovmf? ( https://github.com/tianocore/edk2/archive/${EDK2_COMMIT}.tar.gz -> edk2-${EDK2_COMMIT}.tar.gz
 		${OVMF_PATCHSET_URI} )
 	${UPSTREAM_PATCHSET_URI}
@@ -60,13 +62,17 @@ SLOT="0/$(ver_cut 1-2)"
 # Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make
 # >=dev-lang/ocaml-4 stable
 # Masked in profiles/eapi-5-files instead
-IUSE="api custom-cflags debug doc flask hvm ocaml ovmf +pam pygrub python +qemu +qemu-traditional screen sdl static-libs system-qemu system-seabios"
+IUSE="api custom-cflags debug doc flask +hvm +ipxe ocaml ovmf +pam pygrub python +qemu +qemu-traditional +rombios screen sdl static-libs system-ipxe system-qemu system-seabios"
 
 REQUIRED_USE="
 	${PYTHON_REQUIRED_USE}
-	pygrub? ( python )
+	ipxe? ( rombios )
 	ovmf? ( hvm )
-	^^ ( qemu system-qemu )"
+	pygrub? ( python )
+	rombios? ( hvm )
+	system-ipxe? ( rombios )
+	?? ( ipxe system-ipxe )
+	?? ( qemu system-qemu )"
 
 COMMON_DEPEND="
 	sys-apps/pciutils
@@ -92,11 +98,10 @@ DEPEND="${COMMON_DEPEND}
 		$(python_gen_impl_dep sqlite)
 		)
 	!amd64? ( >=sys-apps/dtc-1.4.0 )
-	amd64? ( sys-devel/bin86
+	amd64? ( sys-power/iasl
 		system-seabios? ( sys-firmware/seabios )
-		sys-firmware/ipxe
-		sys-devel/dev86
-		sys-power/iasl )
+		system-ipxe? ( sys-firmware/ipxe[qemu] )
+		rombios? ( sys-devel/bin86 sys-devel/dev86 ) )
 	dev-lang/perl
 	app-misc/pax-utils
 	doc? (
@@ -242,12 +247,17 @@ src_prepare() {
 		cp tools/firmware/ovmf-makefile tools/firmware/ovmf-dir-remote/Makefile || die
 	fi
 
+	# ipxe
+	if use ipxe; then
+		cp "${DISTDIR}/ipxe-git-${IPXE_COMMIT}.tar.gz" tools/firmware/etherboot/_ipxe.tar.gz || die
+	fi
+
 	mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
 
 	# Fix texi2html build error with new texi2html, qemu.doc.html
 	sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die
 
-	use api   || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
+	use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
 	sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \
 		-i tools/firmware/Makefile || die
 
@@ -354,11 +364,13 @@ src_configure() {
 		--disable-xen \
 		--enable-tools \
 		--enable-docs \
-		--with-system-ipxe=${PREFIX}/usr/share/ipxe \
-		$(use_enable pam) \
 		$(use_enable api xenapi) \
-		$(use_enable ovmf) \
+		$(use_enable ipxe) \
+		$(usex system-ipxe '--with-system-ipxe=/usr/share/ipxe' '') \
 		$(use_enable ocaml ocamltools) \
+		$(use_enable ovmf) \
+		$(use_enable pam) \
+		$(use_enable rombios) \
 		--with-xenstored=$(usex ocaml 'oxenstored' 'xenstored') \
 		"