All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation
@ 2020-02-26  0:15 Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 01/22] seabios: upgrade to version 1.13.0 at official URI and switch to python3 Christopher Clark
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Update the Xen recipes for python3 compatibility and separate recipes
for the hypervisor, the tools and legacy python2 scripts. Refresh ipxe
and seabios.

Changes since v2 of this series:
- update the deploy tasks to ensure that the hypervisor and tools binaries
  are staged (addtask after do_populate_sysroot) prior to being deployed
- set executable permissions on the installed python2 scripts

Upgrade Xen to latest point release of the same version and switch to
git branch tracking for easier incorporation of security fixes. Multiple
recipe fixes.

Separate recipes for the hypervisor and tools enables targetting
different architectures and build configurations (ref: multiconfig) and
improvements to build efficiency downstream.

Add wic support for building bootable images with Xen and dom0.

Remove the stubs task by satisfying the 32-bit dependencies when
necessary using multilib.

This change renames many of the packages produced: most packages that had a
"xen-" prefix now have a "xen-tools-" prefix instead, indicating the recipe
that now produces them, so dependent recipes will need to update package
references:
    eg. xen-tools-hvmloader replaces xen-hvmloader
    eg. xen-tools replaces xen-base
and recipe DEPENDS statements:
    eg. DEPENDS="xen" changes to DEPENDS="xen-tools"
A temporary append is provided for qemu to handle the renaming while its
recipe is updated in openembedded-core.

Christopher Clark (22):
  seabios: upgrade to version 1.13.0 at official URI and switch to
    python3
  ipxe: fix build with uprev to the latest git revision
  linux-yocto/xen.cfg: update Xen KConfig fragment entries
  xen: pass compiler flags via Xen-provided variables
  xen: upgrade to 4.12.2
  wic: add support for bootable pcbios partition with Xen hypervisor
  xen: package the EFI hypervisor binary /boot/xen.efi
  xen: add RDEPENDS for xen-pygrub and xen-python packages
  xen: retire Qemu packaging from the Xen recipe
  xen: separate recipes for hypervisor and tools; switch to git as
    source
  xen-tools: move xentrace_setmask into the xentrace package
  xen: add seabios to RRECOMMENDS of xen-tools when HVM-enabled
  xen-image-minimal: add kernel-module-tun for HVM guest networking
  xen-tools: change globbing to fix syntax highlighting
  xen, xen-tools: update recipes for python3
  xen, xen-tools: separate COMPATIBLE_HOST for hypervisor and tools
  xen, xen-tools: remove stubs task and use multilib when necessary
  xen, xen-tools: bug fix to post_patch task
  xen: add contact to recipe README file
  xen-image-minimal: add a build dependency on the xen hypervisor
  xen: add menuconfig instructions to the README
  xen, xen-tools: updates to the deploy task

 .gitignore                                    |   1 +
 recipes-devtools/qemu/qemu_%.bbappend         |   1 +
 recipes-extended/images/xen-image-minimal.bb  |  10 +-
 .../files/ipxe-fix-hostcc-nopie-cflags.patch  |  58 +-
 recipes-extended/ipxe/ipxe_git.bb             |   2 +-
 .../seabios/seabios/python3.patch             |  13 +
 .../{seabios_1.11.2.bb => seabios_1.13.0.bb}  |  13 +-
 recipes-extended/xen/README                   |  13 +-
 ...ython-pygrub-pass-DISTUTILS-xen.4.12.patch |   7 +-
 .../files/xen-tools-libxl-gentypes-py3.patch  | 140 +++
 ...tools-pygrub-change-tabs-into-spaces.patch |  40 +
 ...-python-scripts-work-with-2.6-and-up.patch | 529 ++++++++++
 .../xen/files/xen-tools-pygrub-py3.patch      | 233 +++++
 ...ls-python-fix-Wsign-compare-warnings.patch | 136 +++
 ...n-tools-update-python-scripts-to-py3.patch | 140 +++
 recipes-extended/xen/xen-blktap.inc           |  76 ++
 recipes-extended/xen/xen-hypervisor.inc       | 111 ++
 recipes-extended/xen/xen-python2.bb           |  68 ++
 recipes-extended/xen/xen-tools.inc            | 792 ++++++++++++++
 recipes-extended/xen/xen-tools_git.bb         |  24 +
 recipes-extended/xen/xen.inc                  | 970 +-----------------
 recipes-extended/xen/xen_4.12.0.bb            |  12 -
 recipes-extended/xen/xen_git.bb               |  19 +-
 recipes-kernel/linux/linux-yocto/xen.cfg      |   3 +-
 .../lib/wic/plugins/source/bootimg-biosxen.py | 212 ++++
 wic/directdisk-bootloader-xen.cfg             |  17 +
 wic/directdisk-bootloader-xen.wks             |  12 +
 wic/directdisk-xen.wks                        |  10 +
 28 files changed, 2642 insertions(+), 1020 deletions(-)
 create mode 100644 recipes-devtools/qemu/qemu_%.bbappend
 create mode 100644 recipes-extended/seabios/seabios/python3.patch
 rename recipes-extended/seabios/{seabios_1.11.2.bb => seabios_1.13.0.bb} (67%)
 create mode 100644 recipes-extended/xen/files/xen-tools-libxl-gentypes-py3.patch
 create mode 100644 recipes-extended/xen/files/xen-tools-pygrub-change-tabs-into-spaces.patch
 create mode 100644 recipes-extended/xen/files/xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch
 create mode 100644 recipes-extended/xen/files/xen-tools-pygrub-py3.patch
 create mode 100644 recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch
 create mode 100644 recipes-extended/xen/files/xen-tools-update-python-scripts-to-py3.patch
 create mode 100644 recipes-extended/xen/xen-blktap.inc
 create mode 100644 recipes-extended/xen/xen-hypervisor.inc
 create mode 100644 recipes-extended/xen/xen-python2.bb
 create mode 100644 recipes-extended/xen/xen-tools.inc
 create mode 100644 recipes-extended/xen/xen-tools_git.bb
 delete mode 100644 recipes-extended/xen/xen_4.12.0.bb
 create mode 100644 scripts/lib/wic/plugins/source/bootimg-biosxen.py
 create mode 100644 wic/directdisk-bootloader-xen.cfg
 create mode 100644 wic/directdisk-bootloader-xen.wks
 create mode 100644 wic/directdisk-xen.wks

-- 
2.17.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 01/22] seabios: upgrade to version 1.13.0 at official URI and switch to python3
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 02/22] ipxe: fix build with uprev to the latest git revision Christopher Clark
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Use native python3 for the build as python2 no longer available.
Official seabios release SRC_URI fixes QA warning about using GitHub archives.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/seabios/seabios/python3.patch      | 13 +++++++++++++
 .../{seabios_1.11.2.bb => seabios_1.13.0.bb}        | 13 ++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)
 create mode 100644 recipes-extended/seabios/seabios/python3.patch
 rename recipes-extended/seabios/{seabios_1.11.2.bb => seabios_1.13.0.bb} (67%)

diff --git a/recipes-extended/seabios/seabios/python3.patch b/recipes-extended/seabios/seabios/python3.patch
new file mode 100644
index 0000000..a2786fd
--- /dev/null
+++ b/recipes-extended/seabios/seabios/python3.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index 516cb38..7f6acaa 100644
+--- a/Makefile
++++ b/Makefile
+@@ -22,7 +22,7 @@ LD=$(CROSS_PREFIX)ld
+ OBJCOPY=$(CROSS_PREFIX)objcopy
+ OBJDUMP=$(CROSS_PREFIX)objdump
+ STRIP=$(CROSS_PREFIX)strip
+-PYTHON=python
++PYTHON=python3
+ CPP=$(CROSS_PREFIX)cpp
+ IASL:=iasl
+ LD32BIT_FLAG:=-melf_i386
diff --git a/recipes-extended/seabios/seabios_1.11.2.bb b/recipes-extended/seabios/seabios_1.13.0.bb
similarity index 67%
rename from recipes-extended/seabios/seabios_1.11.2.bb
rename to recipes-extended/seabios/seabios_1.13.0.bb
index 81eaec9..4cf4420 100644
--- a/recipes-extended/seabios/seabios_1.11.2.bb
+++ b/recipes-extended/seabios/seabios_1.13.0.bb
@@ -3,22 +3,25 @@ HOMEPAGE = "http://www.coreboot.org/SeaBIOS"
 LICENSE = "LGPLv3"
 SECTION = "firmware"
 
+inherit python3native
+
 SRC_URI = " \
-    https://github.com/qemu/seabios/archive/rel-${PV}.tar.gz \
+    https://www.seabios.org/downloads/seabios-${PV}.tar.gz \
     file://hostcc.patch \
+    file://python3.patch \
     "
-S = "${WORKDIR}/${PN}-rel-${PV}"
+S = "${WORKDIR}/${PN}-${PV}"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504         \
                     file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6  \
                     "
 
-SRC_URI[md5sum] = "3f78065837dbd8873513a1b7d5276e78"
-SRC_URI[sha256sum] = "73e73c8e406d97265782f6c942b3c1d178ed4f4afc9f381b22336c3968291693"
+SRC_URI[md5sum] = "1dc1725bac1d230bfd6b3204eed4f2f7"
+SRC_URI[sha256sum] = "37673dc2d6308591b15bdb94e5bcc3e99bdb40198d2247733c43f50b55dbe703"
 
 FILES_${PN} = "/usr/share/firmware"
 
-DEPENDS = "util-linux-native file-native bison-native flex-native gettext-native acpica-native python-native"
+DEPENDS += "util-linux-native file-native bison-native flex-native gettext-native acpica-native"
 
 TUNE_CCARGS = ""
 EXTRA_OEMAKE += "HOSTCC='${BUILD_CC}'"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 02/22] ipxe: fix build with uprev to the latest git revision
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 01/22] seabios: upgrade to version 1.13.0 at official URI and switch to python3 Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 03/22] linux-yocto/xen.cfg: update Xen KConfig fragment entries Christopher Clark
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Newer version allows for a simpler version of the cross-compile patch,
which is updated in this change.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 .../files/ipxe-fix-hostcc-nopie-cflags.patch  | 58 ++-----------------
 recipes-extended/ipxe/ipxe_git.bb             |  2 +-
 2 files changed, 7 insertions(+), 53 deletions(-)

diff --git a/recipes-extended/ipxe/files/ipxe-fix-hostcc-nopie-cflags.patch b/recipes-extended/ipxe/files/ipxe-fix-hostcc-nopie-cflags.patch
index da154a6..865e9bb 100644
--- a/recipes-extended/ipxe/files/ipxe-fix-hostcc-nopie-cflags.patch
+++ b/recipes-extended/ipxe/files/ipxe-fix-hostcc-nopie-cflags.patch
@@ -1,34 +1,17 @@
-Fix detection of host compiler "no-pie"/"nopie" and link flags.
-
-Detection of the "no-pie" vs "nopie" flag needs to be performed for both
-the host and target compilers; cannot assume that one works for the other.
-
-Use EXTRA_HOST_CFLAGS and EXTRA_HOST_LDFLAGS variables for passing
-host tool parameters if required. Removes previous hardcoded "-O2 -g".
-
-Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
-diff --git a/Makefile.housekeeping b/Makefile.housekeeping
-index f833492..5451c39 100644
+diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
+index 1dd1479..13f44dd 100644
 --- a/Makefile.housekeeping
 +++ b/Makefile.housekeeping
-@@ -133,6 +133,7 @@ eval :
- WORKAROUND_CFLAGS :=
- WORKAROUND_ASFLAGS :=
- WORKAROUND_LDFLAGS :=
-+WORKAROUND_HOST_CFLAGS :=
- 
- # Make syntax does not allow use of comma or space in certain places.
- # This ugly workaround is suggested in the manual.
-@@ -445,7 +446,7 @@ endif
+@@ -454,7 +454,7 @@ endif
  CFLAGS		+= $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS)
  ASFLAGS		+= $(WORKAROUND_ASFLAGS) $(EXTRA_ASFLAGS)
  LDFLAGS		+= $(WORKAROUND_LDFLAGS) $(EXTRA_LDFLAGS)
--HOST_CFLAGS	+= $(WORKAROUND_CFLAGS) -O2 -g
-+HOST_CFLAGS	+= $(WORKAROUND_HOST_CFLAGS) $(EXTRA_HOST_CFLAGS)
+-HOST_CFLAGS	+= -O2 -g
++HOST_CFLAGS	+= -O2 -g $(EXTRA_HOST_CFLAGS)
  
  # Inhibit -Werror if NO_WERROR is specified on make command line
  #
-@@ -1375,7 +1376,7 @@ endif # defined(BIN)
+@@ -1379,7 +1379,7 @@ endif # defined(BIN)
  # The compression utilities
  #
  
@@ -37,32 +20,3 @@ index f833492..5451c39 100644
  
  $(ZBIN) : util/zbin.c $(MAKEDEPS)
  	$(QM)$(ECHO) "  [HOSTCC] $@"
-diff --git a/arch/i386/Makefile b/arch/i386/Makefile
-index b7c2792..4a637ad 100644
---- a/arch/i386/Makefile
-+++ b/arch/i386/Makefile
-@@ -78,11 +78,20 @@ CFLAGS			+= -Ui386
- # -nopie.  We therefore test for both.
- #
- ifeq ($(CCTYPE),gcc)
--PIE_TEST = [ -z "`$(CC) -fno-PIE -no-pie -x c -c /dev/null -o /dev/null 2>&1`" ]
--PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE -no-pie')
--PIE_TEST2 = [ -z "`$(CC) -fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1`" ]
-+PIE_TEST1_FLAGS = "-fno-PIE -no-pie -x c -c /dev/null -o /dev/null 2>&1"
-+PIE_TEST2_FLAGS = "-fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1"
-+
-+PIE_TEST1 = [ -z "`$(CC) "$(PIE_TEST1_FLAGS)"`" ]
-+PIE_TEST2 = [ -z "`$(CC) "$(PIE_TEST2_FLAGS)"`" ]
-+PIE_FLAGS1 := $(shell $(PIE_TEST1) && $(ECHO) '-fno-PIE -no-pie')
- PIE_FLAGS2 := $(shell $(PIE_TEST2) && $(ECHO) '-fno-PIE -nopie')
--WORKAROUND_CFLAGS += $(PIE_FLAGS) $(PIE_FLAGS2)
-+WORKAROUND_CFLAGS += $(PIE_FLAGS1) $(PIE_FLAGS2)
-+
-+HOST_PIE_TEST1 = [ -z "`$(HOSTCC) "$(PIE_TEST1_FLAGS)"`" ]
-+HOST_PIE_TEST2 = [ -z "`$(HOSTCC) "$(PIE_TEST2_FLAGS)"`" ]
-+HOST_PIE_FLAGS1 := $(shell $(HOST_PIE_TEST1) && $(ECHO) '-fno-PIE -no-pie')
-+HOST_PIE_FLAGS2 := $(shell $(HOST_PIE_TEST2) && $(ECHO) '-fno-PIE -nopie')
-+WORKAROUND_HOST_CFLAGS += $(HOST_PIE_FLAGS1) $(HOST_PIE_FLAGS2)
- endif
- 
- # i386-specific directories containing source files
diff --git a/recipes-extended/ipxe/ipxe_git.bb b/recipes-extended/ipxe/ipxe_git.bb
index 1de0f21..47c5b7a 100644
--- a/recipes-extended/ipxe/ipxe_git.bb
+++ b/recipes-extended/ipxe/ipxe_git.bb
@@ -4,7 +4,7 @@ LICENSE = "GPLv2"
 DEPENDS = "binutils-native perl-native syslinux mtools-native cdrtools-native xz"
 LIC_FILES_CHKSUM = "file://../COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
-SRCREV = "64b4452bca04af433f1c98ab782c0e93cd5c88c0"
+SRCREV = "18dc73d27edb55ebe9cb13c58d59af3da3bd374b"
 PV = "gitr${SRCPV}"
 PR = "r0"
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 03/22] linux-yocto/xen.cfg: update Xen KConfig fragment entries
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 01/22] seabios: upgrade to version 1.13.0 at official URI and switch to python3 Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 02/22] ipxe: fix build with uprev to the latest git revision Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 04/22] xen: pass compiler flags via Xen-provided variables Christopher Clark
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

CONFIG_XEN_MAX_DOMAIN_MEMORY has been retired since kernel commit:
    197ecb3802c04499d8ff4f8cb28f6efa008067db
    xen/balloon: add runtime control for scrubbing ballooned out pages

CONFIG_XEN_SCRUB_PAGES has been replaced with CONFIG_XEN_SCRUB_PAGES_DEFAULT
since kernel commit: c70727a5bc18a5a233fddc6056d1de9144d7a293
    xen: allow more than 512 GB of RAM for 64 bit pv-domains

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-kernel/linux/linux-yocto/xen.cfg | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/recipes-kernel/linux/linux-yocto/xen.cfg b/recipes-kernel/linux/linux-yocto/xen.cfg
index 4780311..af821d2 100644
--- a/recipes-kernel/linux/linux-yocto/xen.cfg
+++ b/recipes-kernel/linux/linux-yocto/xen.cfg
@@ -3,7 +3,6 @@ CONFIG_PARAVIRT=y
 CONFIG_XEN=y
 CONFIG_XEN_DOM0=y
 CONFIG_XEN_PVHVM=y
-CONFIG_XEN_MAX_DOMAIN_MEMORY=500
 CONFIG_XEN_SAVE_RESTORE=y
 # CONFIG_XEN_DEBUG_FS is not set
 CONFIG_XEN_PVH=y
@@ -30,7 +29,7 @@ CONFIG_FB_SYS_FOPS=y
 CONFIG_FB_DEFERRED_IO=y
 CONFIG_XEN_FBDEV_FRONTEND=y
 CONFIG_XEN_BALLOON=y
-CONFIG_XEN_SCRUB_PAGES=y
+CONFIG_XEN_SCRUB_PAGES_DEFAULT=y
 CONFIG_XEN_DEV_EVTCHN=y
 CONFIG_XEN_BACKEND=y
 CONFIG_XENFS=y
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 04/22] xen: pass compiler flags via Xen-provided variables
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (2 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 03/22] linux-yocto/xen.cfg: update Xen KConfig fragment entries Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 05/22] xen: upgrade to 4.12.2 Christopher Clark
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Fix the method of passing compiler flags into the Xen build, which is
needed to fix compilation of hvmloader, a 32-bit firmware binary that is
required for Xen to be able to run HVM-mode guest VMs. It must not be
compiled with SSE compiler options enabled, so the Xen build clears
CFLAGS, which is a problem with _FORTIFY_SOURCE present in CC because
it must be paired with a compiler optimization flag that was in CFLAGS.
This change fixes the compilation failure that stated
 "_FORTIFY_SOURCE requires compiling with optimization (-O)".

32-bit ARM needs the TUNE_CCARGS to be retained as passed via CC
to ensure that configure is able to generate binaries for the
correct ABI, so is handled as a separate case.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 recipes-extended/xen/xen.inc | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index 36ab78e..4ac954e 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -867,15 +867,27 @@ export CROSS_COMPILE="${TARGET_PREFIX}"
 # overide LDFLAGS to allow xen to build without: "x86_64-oe-linux-ld: unrecognized option '-Wl,-O1'"
 export LDFLAGS=""
 
-# Yocto injects -mfpmath=sse for some machine types into the CFLAGS which
-# conflicts with -mno-sse so instead we strip -mfpmath=sse instead of
-# patching the build to be ok with this
-TUNE_CCARGS := "${@oe.utils.str_filter_out('-mfpmath=sse', '${TUNE_CCARGS}', d)}"
-TUNE_CCARGS := "${@oe.utils.str_filter_out('-msse4.2', '${TUNE_CCARGS}', d)}"
-
-# Supply the full set of compiler flags via the tool variables
-# Yocto supplys _FORTIFY_SOURCE via CC/CPP/CXX but optimization -O via C*FLAGS
-CC_append = " ${CFLAGS}"
+# Pass through the Yocto distro compiler flags via the Xen-provided variables.
+# Special handling:
+# - Yocto supplies the _FORTIFY_SOURCE flag via CC/CPP/CXX but then passes the
+#   optimization -O via C*FLAGS which is problematic when the CFLAGS are cleared
+#   within the build because compilation fails with the compiler stating
+#   "_FORTIFY_SOURCE requires compiling with optimization (-O)".
+# - Move HOST_CC_ARCH into the Xen-provided CFLAGS variables and keep
+#   TOOLCHAIN_OPTIONS set via CC: this enables hvmloader to be built correctly.
+#   It must not be compiled with SSE compiler options enabled and the Xen build
+#   explicitly clears CFLAGS to ensure that, so such options must not be passed
+#   in via the tool variable. hvmloader is required to run HVM-mode guest VMs.
+CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"
+EXTRA_CFLAGS_XEN_CORE="${HOST_CC_ARCH} ${CFLAGS}"
+EXTRA_CFLAGS_XEN_TOOLS="${HOST_CC_ARCH} ${CFLAGS}"
+# 32-bit ARM needs the TUNE_CCARGS component of HOST_CC_ARCH to be passed
+# in CC to ensure that configure can compile binaries for the right arch.
+CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS}"
+EXTRA_CFLAGS_XEN_CORE_arm="${SECURITY_CFLAGS} ${CFLAGS}"
+EXTRA_CFLAGS_XEN_TOOLS_arm="${SECURITY_CFLAGS} ${CFLAGS}"
+
+# There are no Xen-provided variables for C++, so append to the tool variables:
 CPP_append = " ${CPPFLAGS}"
 CXX_append = " ${CXXFLAGS}"
 
@@ -996,8 +1008,11 @@ do_configure() {
         bbfatal "Unable to copy defconfig to .config"
     fi
 
+    unset CFLAGS
+
     # do configure
-    oe_runconf
+    oe_runconf EXTRA_CFLAGS_XEN_CORE="${EXTRA_CFLAGS_XEN_CORE}" \
+               EXTRA_CFLAGS_XEN_TOOLS="${EXTRA_CFLAGS_XEN_TOOLS}"
     if [ ! -e ${STAGING_INCDIR}/bits/long-double-32.h ]; then
         cp ${STAGING_INCDIR}/bits/long-double-64.h ${STAGING_INCDIR}/bits/long-double-32.h
     fi
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 05/22] xen: upgrade to 4.12.2
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (3 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 04/22] xen: pass compiler flags via Xen-provided variables Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 06/22] wic: add support for bootable pcbios partition with Xen hypervisor Christopher Clark
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Fixes the build failure with 4.12.0 seen with the newer OE compiler.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/{xen_4.12.0.bb => xen_4.12.2.bb} | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename recipes-extended/xen/{xen_4.12.0.bb => xen_4.12.2.bb} (63%)

diff --git a/recipes-extended/xen/xen_4.12.0.bb b/recipes-extended/xen/xen_4.12.2.bb
similarity index 63%
rename from recipes-extended/xen/xen_4.12.0.bb
rename to recipes-extended/xen/xen_4.12.2.bb
index 246be7a..affeb4a 100644
--- a/recipes-extended/xen/xen_4.12.0.bb
+++ b/recipes-extended/xen/xen_4.12.2.bb
@@ -6,7 +6,7 @@ SRC_URI = " \
     file://0001-python-pygrub-pass-DISTUTILS-xen.4.12.patch \
     "
 
-SRC_URI[md5sum] = "7d24d4541e3025421e02384cabc3528b"
-SRC_URI[sha256sum] = "6e5455e4a58dcb2339bfcd2a89842728068b530aa62501843793f7cf743c4d64"
+SRC_URI[md5sum] = "57084e3f55bbec063d38b464e1b7e4f2"
+SRC_URI[sha256sum] = "1c75cbe728dfabf02b7f9a17ce96ee7d202d2fd4b4689490018d3a28b63f9fa3"
 
 S = "${WORKDIR}/xen-${PV}"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 06/22] wic: add support for bootable pcbios partition with Xen hypervisor
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (4 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 05/22] xen: upgrade to 4.12.2 Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 07/22] xen: package the EFI hypervisor binary /boot/xen.efi Christopher Clark
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

New bootimg-biosxen wic plugin to populate a boot partition for
launching Xen and dom0.

Includes example kickstart wks files to generate disk images to boot
into Xen from PC BIOS.

  eg: wic create directdisk-xen -e xen-image-minimal

and write the resulting image file to a disk for boot.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 .gitignore                                    |   1 +
 .../lib/wic/plugins/source/bootimg-biosxen.py | 212 ++++++++++++++++++
 wic/directdisk-bootloader-xen.cfg             |  17 ++
 wic/directdisk-bootloader-xen.wks             |  12 +
 wic/directdisk-xen.wks                        |  10 +
 5 files changed, 252 insertions(+)
 create mode 100644 scripts/lib/wic/plugins/source/bootimg-biosxen.py
 create mode 100644 wic/directdisk-bootloader-xen.cfg
 create mode 100644 wic/directdisk-bootloader-xen.wks
 create mode 100644 wic/directdisk-xen.wks

diff --git a/.gitignore b/.gitignore
index 45b1106..357aefe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ pyshtables.py
 *.rej
 /*.patch
 *~
+scripts/lib/wic/plugins/source/__pycache__
diff --git a/scripts/lib/wic/plugins/source/bootimg-biosxen.py b/scripts/lib/wic/plugins/source/bootimg-biosxen.py
new file mode 100644
index 0000000..f00747d
--- /dev/null
+++ b/scripts/lib/wic/plugins/source/bootimg-biosxen.py
@@ -0,0 +1,212 @@
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This implements the 'bootimg-biosxen' source plugin class for 'wic'
+#
+# Bootloader arguments: Xen args are separated from Linux ones at '---':
+# eg.
+#   bootloader --append="console=com1,vga com1=115200,8n1 --- console=hvc0"
+#
+# Optional source param: initrd
+# accepts multiple ramdisk files to be supplied to multiboot.
+#  eg.
+#   part /boot --source bootimg-biosxen --sourceparams="initrd=foo.initrd;bar.initrd"
+#
+# AUTHORS
+# Christopher Clark <christopher.w.clark [at] gmail.com>
+# Elements derived from bootimg-biosplusefi.py by:
+#   William Bourque <wbourque [at] gmail.com>
+
+import logging
+import os
+import types
+
+from wic import WicError
+import wic.pluginbase
+from importlib.machinery import SourceFileLoader
+from wic.misc import (exec_cmd, get_bitbake_var)
+
+logger = logging.getLogger('wic')
+
+class BootimgBiosXenPlugin(wic.pluginbase.SourcePlugin):
+    """
+    Create MBR boot partition including files for Xen
+
+    """
+
+    name = 'bootimg-biosxen'
+    __PCBIOS_MODULE_NAME = "bootimg-pcbios"
+    __imgBiosObj = None
+
+    @classmethod
+    def __init__(cls):
+        """
+        Constructor (init)
+        """
+        # original comment from bootimg-biosplusefi.py :
+        # "XXX For some reasons, __init__ constructor is never called.
+        #  Something to do with how pluginbase works?"
+        cls.__instanciateBIOSClass()
+
+    @classmethod
+    def __instanciateBIOSClass(cls):
+        """
+
+        """
+        # Import bootimg-pcbios (class name "BootimgPcbiosPlugin")
+        modulePath = os.path.join(os.path.dirname(wic.pluginbase.__file__),
+                                  "plugins", "source",
+                                  cls.__PCBIOS_MODULE_NAME + ".py")
+        loader = SourceFileLoader(cls.__PCBIOS_MODULE_NAME, modulePath)
+        mod = types.ModuleType(loader.name)
+        loader.exec_module(mod)
+        cls.__imgBiosObj = mod.BootimgPcbiosPlugin()
+
+    @classmethod
+    def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir,
+                        bootimg_dir, kernel_dir, native_sysroot):
+        """
+        Called after all partitions have been prepared and assembled into a
+        disk image.
+        """
+        if not cls.__imgBiosObj:
+            cls.__instanciateBIOSClass()
+
+        cls.__imgBiosObj.do_install_disk(disk, disk_name, creator, workdir,
+                                         oe_builddir, bootimg_dir, kernel_dir,
+                                         native_sysroot)
+
+    @classmethod
+    def do_configure_partition(cls, part, source_params, creator, cr_workdir,
+                               oe_builddir, bootimg_dir, kernel_dir,
+                               native_sysroot):
+        """
+        Called before do_prepare_partition(), creates syslinux config
+        """
+        if not cls.__imgBiosObj:
+            cls.__instanciateBIOSClass()
+
+        bootloader = creator.ks.bootloader
+
+        if not bootloader.configfile:
+            splash = os.path.join(cr_workdir, "/hdd/boot/splash.jpg")
+            if os.path.exists(splash):
+                splashline = "menu background splash.jpg"
+            else:
+                splashline = ""
+
+            syslinux_conf = ""
+            syslinux_conf += "PROMPT 0\n"
+            syslinux_conf += "TIMEOUT " + str(bootloader.timeout) + "\n"
+            syslinux_conf += "\n"
+            syslinux_conf += "ALLOWOPTIONS 1\n"
+            syslinux_conf += "\n"
+            if splashline:
+                syslinux_conf += "%s\n" % splashline
+
+            syslinux_conf += "DEFAULT boot\n"
+            syslinux_conf += "LABEL boot\n"
+            syslinux_conf += "  KERNEL mboot.c32\n"
+
+            # Split the bootloader args at '---' to separate the Xen args
+            # from the Linux kernel args.
+            # The Xen args here are defaults; overridden by bootloader append.
+            xen_args = "console=com1,vga com1=115200,8n1"
+            kernel_append = ""
+            if bootloader.append:
+                separator_pos = bootloader.append.find('---')
+                if separator_pos != -1:
+                    xen_args = bootloader.append[:separator_pos]
+                    kernel_append = bootloader.append[separator_pos+3:]
+                else:
+                    kernel_append = bootloader.append
+
+            kernel_args = "label=boot root=%s %s" % \
+                          (creator.rootdev, kernel_append)
+
+            syslinux_conf += "  APPEND /xen.gz %s --- /vmlinuz %s" % \
+                             (xen_args, kernel_args)
+
+            initrd = source_params.get('initrd')
+            if initrd:
+                initrds = initrd.split(';')
+                for initrd_file in initrds:
+                    syslinux_conf += " --- /%s" % os.path.basename(initrd_file)
+            syslinux_conf += "\n"
+
+            logger.debug("Writing syslinux config %s/hdd/boot/syslinux.cfg",
+                         cr_workdir)
+
+            hdddir = "%s/hdd/boot" % cr_workdir
+            install_cmd = "install -d %s" % hdddir
+            exec_cmd(install_cmd)
+
+            cfg = open("%s/hdd/boot/syslinux.cfg" % cr_workdir, "w")
+            cfg.write(syslinux_conf)
+            cfg.close()
+
+        else:
+            cls.__imgBiosObj.do_configure_partition(part, source_params,
+                                                    creator, cr_workdir,
+                                                    oe_builddir, bootimg_dir,
+                                                    kernel_dir, native_sysroot)
+
+    @classmethod
+    def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
+                             oe_builddir, bootimg_dir, kernel_dir,
+                             rootfs_dir, native_sysroot):
+        """
+        Called to do the actual content population for a partition i.e. it
+        'prepares' the partition to be incorporated into the image.
+        """
+        if not cls.__imgBiosObj:
+            cls.__instanciateBIOSClass()
+
+        bootimg_dir = cls.__imgBiosObj._get_bootimg_dir(bootimg_dir, 'syslinux')
+        hdddir = "%s/hdd/boot" % cr_workdir
+
+        # machine-deduction logic originally from isoimage-isohybrid.py
+        initrd_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+        if not initrd_dir:
+            raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting.")
+        machine = os.path.basename(initrd_dir)
+
+        xen = "xen-" + machine + ".gz"
+
+        cmds = ["install -m 0644 %s/%s %s/xen.gz" %
+                (kernel_dir, xen, hdddir),
+                "install -m 0644 %s/syslinux/mboot.c32 %s/mboot.c32" %
+                (bootimg_dir, hdddir)]
+
+        initrd = source_params.get('initrd')
+
+        # Allow multiple 'initrds', as per the bootimg-efi class.
+        # This can be used to install additional binaries for multiboot.
+        # eg. TXT ACMs, XSM/Flask policy file, microcode binary
+        if initrd:
+            initrds = initrd.split(';')
+            for initrd_file in initrds:
+                cmds.append("install -m 0644 %s/%s %s/%s" %
+                            (kernel_dir, initrd_file, hdddir,
+                             os.path.basename(initrd_file)))
+
+        for install_cmd in cmds:
+            exec_cmd(install_cmd)
+
+        cls.__imgBiosObj.do_prepare_partition(part, source_params,
+                                              creator, cr_workdir,
+                                              oe_builddir, bootimg_dir,
+                                              kernel_dir, rootfs_dir,
+                                              native_sysroot)
diff --git a/wic/directdisk-bootloader-xen.cfg b/wic/directdisk-bootloader-xen.cfg
new file mode 100644
index 0000000..3ad76d6
--- /dev/null
+++ b/wic/directdisk-bootloader-xen.cfg
@@ -0,0 +1,17 @@
+ALLOWOPTIONS 1
+DEFAULT boot
+TIMEOUT 10
+PROMPT 1
+SERIAL 0 115200
+
+UI vesamenu.c32
+menu title Select boot options
+menu tabmsg Press [Tab] to edit, [Return] to select
+
+LABEL boot
+  KERNEL mboot.c32
+  APPEND /xen.gz console=com1,vga com1=115200,8n1 --- /vmlinuz quiet console=hvc0 root=LABEL=root rw rootwait panic=10
+
+LABEL verbose
+  KERNEL mboot.c32
+  APPEND /xen.gz console=com1,vga com1=115200,8n1 loglvl=all guest_loglvl=all --- /vmlinuz quiet console=hvc0 earlyprintk=xen root=LABEL=root rw rootwait panic=10
diff --git a/wic/directdisk-bootloader-xen.wks b/wic/directdisk-bootloader-xen.wks
new file mode 100644
index 0000000..c34120a
--- /dev/null
+++ b/wic/directdisk-bootloader-xen.wks
@@ -0,0 +1,12 @@
+# short-description: Create a 'pcbios' direct disk image with Xen hypervisor and bootloader config
+# long-description: Creates a partitioned legacy BIOS disk image to boot Xen
+# with a bootloader config that the user can directly dd to boot media.
+# Boot files are located on the first vfat partition.
+
+part /boot --source bootimg-biosxen --ondisk sda --label boot --active --align 1024
+
+# For the main partition, it can be useful to add additional space for VMs;
+# eg. increase partition size by appending: --size 10G
+part / --source rootfs --ondisk sda --use-uuid --fstype=ext4 --label root --align 1024
+
+bootloader --configfile="directdisk-bootloader-xen.cfg"
diff --git a/wic/directdisk-xen.wks b/wic/directdisk-xen.wks
new file mode 100644
index 0000000..d6ca46a
--- /dev/null
+++ b/wic/directdisk-xen.wks
@@ -0,0 +1,10 @@
+# short-description: Create a 'pcbios' direct disk image with Xen hypervisor
+# long-description: Creates a partitioned legacy BIOS disk image to boot Xen
+# that the user can directly dd to boot media. Boot files are located on the
+# first vfat partition.
+
+part /boot --source bootimg-biosxen --ondisk sda --label boot --active --align 1024
+
+# For the main partition, it can be useful to add additional space for VMs:
+# eg. increase partition size by appending: --size 10G
+part / --source rootfs --ondisk sda --use-uuid --fstype=ext4 --label root --align 1024
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 07/22] xen: package the EFI hypervisor binary /boot/xen.efi
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (5 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 06/22] wic: add support for bootable pcbios partition with Xen hypervisor Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 08/22] xen: add RDEPENDS for xen-pygrub and xen-python packages Christopher Clark
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/xen.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index 4ac954e..380b193 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -429,6 +429,7 @@ FILES_${PN}-hypervisor = "\
 FILES_${PN}-init-xenstore-dom = "${libdir}/xen/bin/init-xenstore-domain"
 
 FILES_${PN}-efi = "\
+    /boot/xen.efi \
     ${exec_prefix}/lib64/efi/xen* \
     "
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 08/22] xen: add RDEPENDS for xen-pygrub and xen-python packages
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (6 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 07/22] xen: package the EFI hypervisor binary /boot/xen.efi Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 09/22] xen: retire Qemu packaging from the Xen recipe Christopher Clark
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/xen.inc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index 380b193..7b1397f 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -108,6 +108,14 @@ RDEPENDS_${PN}-misc = " \
     python \
     "
 
+RDEPENDS_${PN}-python = " \
+    python \
+    "
+
+RDEPENDS_${PN}-pygrub = " \
+    ${PN}-python \
+    "
+
 RDEPENDS_${PN}-remus = " \
     bash \
     python \
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 09/22] xen: retire Qemu packaging from the Xen recipe
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (7 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 08/22] xen: add RDEPENDS for xen-pygrub and xen-python packages Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 10/22] xen: separate recipes for hypervisor and tools; switch to git as source Christopher Clark
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Modern Qemu supports Xen and the qemu binary to be used with Xen should
be built with the Qemu recipe.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/xen.inc | 87 ------------------------------------
 1 file changed, 87 deletions(-)

diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index 7b1397f..2aed677 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -217,7 +217,6 @@ PACKAGES = "\
     ${PN}-misc \
     ${PN}-pygrub \
     ${PN}-python \
-    ${PN}-qemu \
     ${PN}-remus \
     ${PN}-scripts-block \
     ${PN}-scripts-common \
@@ -546,92 +545,6 @@ FILES_${PN}-python = "\
     "
 
 INSANE_SKIP_${PN} = "already-stripped"
-INSANE_SKIP_${PN}-qemu = "arch"
-FILES_${PN}-qemu = " \
-    ${datadir}/xen/qemu \
-    ${libdir}/xen/bin/qemu-system-i386 \
-    ${libdir}/xen/bin/qemu-system-x86_64 \
-    ${libdir}/xen/bin/qemu-img \
-    ${libdir}/xen/bin/qemu-nbd \
-    ${libdir}/xen/bin/qemu-ga \
-    ${libdir}/xen/bin/qemu-io \
-    ${libdir}/xen/bin/qemu-dm \
-    ${libdir}/xen/bin/virtfs-proxy-helper \
-    /usr/libexec/qemu-bridge-helper \
-    ${libdir}/xen/libexec/qemu-bridge-helper \
-    /usr/etc/qemu \
-    /usr/etc/qemu/target-x86_64.conf \
-    ${libdir}/xen/etc/qemu/target-x86_64.conf \
-    ${datadir}/qemu-xen \
-    ${datadir}/qemu-xen/qemu \
-    ${datadir}/qemu-xen/qemu/bamboo.dtb \
-    ${datadir}/qemu-xen/qemu/pxe-pcnet.rom \
-    ${datadir}/qemu-xen/qemu/vgabios-vmware.bin \
-    ${datadir}/qemu-xen/qemu/pxe-eepro100.rom \
-    ${datadir}/qemu-xen/qemu/pxe-e1000.rom \
-    ${datadir}/qemu-xen/qemu/openbios-ppc \
-    ${datadir}/qemu-xen/qemu/multiboot.bin \
-    ${datadir}/qemu-xen/qemu/vgabios-cirrus.bin \
-    ${datadir}/qemu-xen/qemu/bios.bin \
-    ${datadir}/qemu-xen/qemu/vgabios-stdvga.bin \
-    ${datadir}/qemu-xen/qemu/palcode-clipper \
-    ${datadir}/qemu-xen/qemu/pxe-ne2k_pci.rom \
-    ${datadir}/qemu-xen/qemu/spapr-rtas.bin \
-    ${datadir}/qemu-xen/qemu/slof.bin \
-    ${datadir}/qemu-xen/qemu/vgabios-qxl.bin \
-    ${datadir}/qemu-xen/qemu/pxe-rtl8139.rom \
-    ${datadir}/qemu-xen/qemu/openbios-sparc64 \
-    ${datadir}/qemu-xen/qemu/pxe-virtio.rom \
-    ${datadir}/qemu-xen/qemu/kvmvapic.bin \
-    ${datadir}/qemu-xen/qemu/openbios-sparc32 \
-    ${datadir}/qemu-xen/qemu/petalogix-s3adsp1800.dtb \
-    ${datadir}/qemu-xen/qemu/sgabios.bin \
-    ${datadir}/qemu-xen/qemu/linuxboot.bin \
-    ${datadir}/qemu-xen/qemu/qemu-icon.bmp \
-    ${datadir}/qemu-xen/qemu/ppc_rom.bin \
-    ${datadir}/qemu-xen/qemu/vgabios.bin \
-    ${datadir}/qemu-xen/qemu/s390-zipl.rom \
-    ${datadir}/qemu-xen/qemu/petalogix-ml605.dtb \
-    ${datadir}/qemu-xen/qemu/keymaps \
-    ${datadir}/qemu-xen/qemu/keymaps/common \
-    ${datadir}/qemu-xen/qemu/keymaps/th \
-    ${datadir}/qemu-xen/qemu/keymaps/is \
-    ${datadir}/qemu-xen/qemu/keymaps/en-gb \
-    ${datadir}/qemu-xen/qemu/keymaps/ar \
-    ${datadir}/qemu-xen/qemu/keymaps/fr-be \
-    ${datadir}/qemu-xen/qemu/keymaps/ru \
-    ${datadir}/qemu-xen/qemu/keymaps/hu \
-    ${datadir}/qemu-xen/qemu/keymaps/de-ch \
-    ${datadir}/qemu-xen/qemu/keymaps/no \
-    ${datadir}/qemu-xen/qemu/keymaps/fr \
-    ${datadir}/qemu-xen/qemu/keymaps/pl \
-    ${datadir}/qemu-xen/qemu/keymaps/fr-ca \
-    ${datadir}/qemu-xen/qemu/keymaps/de \
-    ${datadir}/qemu-xen/qemu/keymaps/fr-ch \
-    ${datadir}/qemu-xen/qemu/keymaps/bepo \
-    ${datadir}/qemu-xen/qemu/keymaps/lv \
-    ${datadir}/qemu-xen/qemu/keymaps/ja \
-    ${datadir}/qemu-xen/qemu/keymaps/da \
-    ${datadir}/qemu-xen/qemu/keymaps/lt \
-    ${datadir}/qemu-xen/qemu/keymaps/hr \
-    ${datadir}/qemu-xen/qemu/keymaps/es \
-    ${datadir}/qemu-xen/qemu/keymaps/modifiers \
-    ${datadir}/qemu-xen/qemu/keymaps/sl \
-    ${datadir}/qemu-xen/qemu/keymaps/it \
-    ${datadir}/qemu-xen/qemu/keymaps/nl \
-    ${datadir}/qemu-xen/qemu/keymaps/fo \
-    ${datadir}/qemu-xen/qemu/keymaps/mk \
-    ${datadir}/qemu-xen/qemu/keymaps/pt-br \
-    ${datadir}/qemu-xen/qemu/keymaps/tr \
-    ${datadir}/qemu-xen/qemu/keymaps/sv \
-    ${datadir}/qemu-xen/qemu/keymaps/fi \
-    ${datadir}/qemu-xen/qemu/keymaps/en-us \
-    ${datadir}/qemu-xen/qemu/keymaps/et \
-    ${datadir}/qemu-xen/qemu/keymaps/nl-be \
-    ${datadir}/qemu-xen/qemu/keymaps/pt \
-    ${bindir}/qemu-nbd-xen \
-    ${bindir}/qemu-img-xen \
-    "
 
 FILES_${PN}-remus = "\
     ${bindir}/remus \
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 10/22] xen: separate recipes for hypervisor and tools; switch to git as source
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (8 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 09/22] xen: retire Qemu packaging from the Xen recipe Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 11/22] xen-tools: move xentrace_setmask into the xentrace package Christopher Clark
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

This change changes the names of many packages produced: the
xen-tools recipe now builds packages previous built by the xen
recipe, so the package prefix changes from "xen-" to "xen-tools-".
A temporary bbappend is provided for qemu to ease the transition.

Multiple motivations for recipe separation:
- improves efficiency of incremental build and development
- supports building the hypervisor and tools with different toolchains
  and for different architectures

Switch to using a git recipe on the Xen stable branch:
- enables easier tracking of critical XSA security updates applied
  upstream by just advancing SRCREV along the branch
Revision has been set to the tip of the stable-4.12 branch, which
has the one XSA-312 patch applied on top of RELEASE-4.12.2.

The recipe refactor externalizes the block tap components, to enable optional
building of blktap in a separate recipe outside xen-tools, needed by OpenXT.

xenstored is made a virtual package to support switching between
alternative implementations (several exist).

Update xen-image-minimal to install the xen-tools package, which
replaces what was previously xen-base.

Determine the flask policy filename, which is Xen-version specific,
using the same method as the Xen build system.

qemu: update PACKAGECONFIG[xen] for xen package renaming: allows builds
to continue correctly in the meantime while openembedded core and poky
are updated.

OpenXT ticket reference: OXT-1694

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-devtools/qemu/qemu_%.bbappend        |   1 +
 recipes-extended/images/xen-image-minimal.bb |   2 +-
 recipes-extended/xen/xen-blktap.inc          |  76 ++
 recipes-extended/xen/xen-hypervisor.inc      |  94 +++
 recipes-extended/xen/xen-tools.inc           | 743 ++++++++++++++++
 recipes-extended/xen/xen-tools_git.bb        |  18 +
 recipes-extended/xen/xen.inc                 | 842 +------------------
 recipes-extended/xen/xen_4.12.2.bb           |  12 -
 recipes-extended/xen/xen_git.bb              |  19 +-
 9 files changed, 946 insertions(+), 861 deletions(-)
 create mode 100644 recipes-devtools/qemu/qemu_%.bbappend
 create mode 100644 recipes-extended/xen/xen-blktap.inc
 create mode 100644 recipes-extended/xen/xen-hypervisor.inc
 create mode 100644 recipes-extended/xen/xen-tools.inc
 create mode 100644 recipes-extended/xen/xen-tools_git.bb
 delete mode 100644 recipes-extended/xen/xen_4.12.2.bb

diff --git a/recipes-devtools/qemu/qemu_%.bbappend b/recipes-devtools/qemu/qemu_%.bbappend
new file mode 100644
index 0000000..150f92b
--- /dev/null
+++ b/recipes-devtools/qemu/qemu_%.bbappend
@@ -0,0 +1 @@
+PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen-tools,xen-tools-libxenstore xen-tools-libxenctrl xen-tools-libxenguest"
diff --git a/recipes-extended/images/xen-image-minimal.bb b/recipes-extended/images/xen-image-minimal.bb
index c39d378..63a1086 100644
--- a/recipes-extended/images/xen-image-minimal.bb
+++ b/recipes-extended/images/xen-image-minimal.bb
@@ -12,7 +12,7 @@ IMAGE_INSTALL += " \
     kernel-module-xen-netback \
     ${@bb.utils.contains('MACHINE_FEATURES', 'pci', "${XEN_PCIBACK_MODULE}", '', d)} \
     kernel-module-xen-wdt \
-    xen-base \
+    xen-tools \
     qemu \
     "
 
diff --git a/recipes-extended/xen/xen-blktap.inc b/recipes-extended/xen/xen-blktap.inc
new file mode 100644
index 0000000..5f385dd
--- /dev/null
+++ b/recipes-extended/xen/xen-blktap.inc
@@ -0,0 +1,76 @@
+# The Xen block tap components are packaged separately here to support
+# the option to build them in a separate recipe from xen-tools.
+
+BLKTAP_PACKAGES ?= " \
+    ${PN}-blktap \
+    ${PN}-libblktap \
+    ${PN}-libblktapctl \
+    ${PN}-libblktapctl-dev \
+    ${PN}-libblktap-dev \
+    ${PN}-libvhd \
+    ${PN}-libvhd-dev \
+    ${PN}-blktap-staticdev \
+    "
+
+BLKTAP_PROVIDES ?= " \
+    virtual/blktap \
+    virtual/libblktap \
+    virtual/libblktapctl \
+    virtual/libvhd \
+    "
+
+BLKTAP_RRECOMMENDS ?= " \
+    virtual/blktap \
+    virtual/libblktap \
+    virtual/libblktapctl \
+    virtual/libvhd \
+    "
+
+RPROVIDES_${PN}-blktap = "virtual/blktap"
+RPROVIDES_${PN}-libblktap = "virtual/libblktap"
+RPROVIDES_${PN}-libblktapctl = "virtual/libblktapctl"
+RPROVIDES_${PN}-libvhd = "virtual/libvhd"
+
+FILES_${PN}-blktap-staticdev += "\
+    ${libdir}/libblktapctl.a \
+    ${libdir}/libvhd.a \
+    ${libdir}/libblktap.a \
+    "
+
+FILES_${PN}-libblktapctl = "${libdir}/libblktapctl.so.*"
+FILES_${PN}-libblktapctl-dev = " \
+    ${libdir}/libblktapctl.so \
+    ${libdir}/pkgconfig/xenblktapctl.pc \
+    ${datadir}/pkgconfig/xenblktapctl.pc \
+    "
+
+FILES_${PN}-libvhd = "${libdir}/libvhd.so.*"
+FILES_${PN}-libvhd-dev = " \
+    ${libdir}/libvhd.so \
+    ${libdir}/pkgconfig/vhd.pc \
+    ${datadir}/pkgconfig/vhd.pc \
+    "
+
+FILES_${PN}-libblktap = "${libdir}/libblktap.so.*"
+FILES_${PN}-libblktap-dev = " \
+    ${libdir}/libblktap.so \
+    ${libdir}/pkgconfig/blktap.pc \
+    ${datadir}/pkgconfig/blktap.pc \
+    "
+
+FILES_${PN}-blktap = "\
+    ${sbindir}/blktapctrl \
+    ${sbindir}/img2qcow \
+    ${sbindir}/lock-util \
+    ${sbindir}/qcow2raw \
+    ${sbindir}/qcow-create \
+    ${sbindir}/tap-ctl \
+    ${sbindir}/tapdisk \
+    ${sbindir}/tapdisk2 \
+    ${sbindir}/tapdisk-client \
+    ${sbindir}/tapdisk-diff \
+    ${sbindir}/tapdisk-stream \
+    ${sbindir}/td-util \
+    ${sbindir}/vhd-update \
+    ${sbindir}/vhd-util \
+    "
diff --git a/recipes-extended/xen/xen-hypervisor.inc b/recipes-extended/xen/xen-hypervisor.inc
new file mode 100644
index 0000000..c0df158
--- /dev/null
+++ b/recipes-extended/xen/xen-hypervisor.inc
@@ -0,0 +1,94 @@
+SUMMARY = "Xen hypervisor"
+DESCRIPTION = "The Xen hypervisor"
+
+# This recipe is for just the Xen hypervisor.
+# Separate recipes are used to build Xen and its components:
+# this allows for varying the target architecture or toolchain used
+# to build the different components. eg. 32-bit tools and a 64-bit hypervisor.
+
+inherit deploy
+
+PACKAGES = " \
+    ${PN} \
+    ${PN}-dbg \
+    ${PN}-efi \
+    "
+
+FILES_${PN} = " \
+    /boot/xen-* \
+    /boot/xen \
+    /boot/xen-*.gz \
+    /boot/xen.gz \
+    /boot/xen-syms-* \
+    "
+
+FILES_${PN}-dbg += "${libdir}/debug/*"
+
+FILES_${PN}-efi = " \
+    /boot/xen.efi \
+    ${exec_prefix}/lib64/efi/xen* \
+    "
+
+do_configure() {
+    do_configure_common
+}
+
+do_compile() {
+    oe_runmake xen
+}
+
+do_install() {
+    oe_runmake DESTDIR="${D}" install-xen
+}
+
+do_deploy() {
+    install -d ${DEPLOYDIR}
+
+    if [ -f ${D}/boot/xen ]; then
+        install -m 0644 ${D}/boot/xen ${DEPLOYDIR}/xen-${MACHINE}
+    fi
+
+    if [ -f ${D}/boot/xen.gz ]; then
+        install -m 0644 ${D}/boot/xen.gz ${DEPLOYDIR}/xen-${MACHINE}.gz
+    fi
+
+    if [ -f ${D}/usr/lib64/efi/xen.efi ]; then
+        install -m 0644 ${D}/usr/lib64/efi/xen.efi ${DEPLOYDIR}/xen-${MACHINE}.efi
+    fi
+}
+
+addtask deploy after do_populate_sysroot
+
+# Enable use of menuconfig directly from bitbake and also within the devshell
+OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO"
+HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}"
+HOSTLDFLAGS = "${BUILD_LDFLAGS}"
+TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"
+do_devshell[depends] += "ncurses-native:do_populate_sysroot"
+
+KCONFIG_CONFIG_COMMAND ??= "menuconfig"
+python do_menuconfig() {
+    import shutil
+
+    try:
+        mtime = os.path.getmtime("xen/.config")
+        shutil.copy("xen/.config", "xen/.config.orig")
+    except OSError:
+        mtime = 0
+
+    oe_terminal("${SHELL} -c \"cd xen; XEN_CONFIG_EXPERT=y make %s; if [ \$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),
+        d.getVar('PN') + ' Configuration', d)
+
+    try:
+        newmtime = os.path.getmtime("xen/.config")
+    except OSError:
+        newmtime = 0
+
+    if newmtime > mtime:
+        bb.note("Configuration changed, recompile will be forced")
+        bb.build.write_taint('do_compile', d)
+}
+do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
+do_menuconfig[nostamp] = "1"
+do_menuconfig[dirs] = "${B}"
+addtask menuconfig after do_configure
diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
new file mode 100644
index 0000000..f37968b
--- /dev/null
+++ b/recipes-extended/xen/xen-tools.inc
@@ -0,0 +1,743 @@
+SUMMARY = "Xen hypervisor tools"
+DESCRIPTION = "Tools and utility software for the Xen hypervisor"
+
+inherit setuptools update-rc.d systemd deploy
+require xen-blktap.inc
+
+RDEPENDS_${PN} = "\
+    bash perl xz \
+    ${PN}-console \
+    ${PN}-libxenguest \
+    ${PN}-libxenlight \
+    ${PN}-libxenvchan \
+    ${PN}-libxenctrl \
+    ${PN}-libxlutil \
+    ${PN}-libxenstat \
+    ${PN}-libxenstore \
+    ${PN}-libfsimage \
+    ${PN}-fsimage \
+    ${PN}-scripts-block \
+    ${PN}-scripts-network \
+    ${PN}-xen-watchdog \
+    ${PN}-xencommons \
+    ${PN}-xendomains \
+    ${PN}-xenstore \
+    virtual/xenstored \
+    ${PN}-xl \
+    "
+
+RDEPENDS_${PN}-dev = ""
+
+RRECOMMENDS_${PN} = " \
+    ${@bb.utils.contains('PACKAGECONFIG', 'externalblktap', '', '${BLKTAP_RRECOMMENDS}', d)} \
+    ${PN}-flask \
+    ${PN}-hvmloader \
+    ${PN}-shim \
+    ${PN}-xenpaging \
+    "
+
+RDEPENDS_${PN}-devd = " \
+    ${PN}-xl \
+    "
+
+RDEPENDS_${PN}-fsimage = " \
+    libext2fs \
+    "
+
+RDEPENDS_${PN}-misc = " \
+    perl \
+    python \
+    "
+
+RDEPENDS_${PN}-python = " \
+    python \
+    "
+
+RDEPENDS_${PN}-pygrub = " \
+    ${PN}-python \
+    "
+
+RDEPENDS_${PN}-remus = " \
+    bash \
+    python \
+    "
+
+RDEPENDS_${PN}-scripts-block = "\
+    bash \
+    ${PN}-scripts-common \
+    ${PN}-volatiles \
+    "
+
+RDEPENDS_${PN}-scripts-common = "bash"
+
+RDEPENDS_${PN}-scripts-network = "\
+    bash \
+    bridge-utils \
+    ${PN}-scripts-common \
+    ${PN}-volatiles \
+    "
+
+RDEPENDS_${PN}-xencommons = "\
+    bash \
+    ${PN}-console \
+    ${PN}-xenstore \
+    virtual/xenstored \
+    ${PN}-xl \
+    ${PN}-scripts-common \
+    "
+
+RDEPENDS_${PN}-xendomains = "\
+    bash \
+    ${PN}-console \
+    ${PN}-scripts-block \
+    ${PN}-scripts-common \
+    virtual/xenstored \
+    "
+
+RDEPENDS_${PN}-xl = "libgcc"
+
+RDEPENDS_${PN}-xentrace = "python"
+
+RDEPENDS_${PN}-xen-watchdog = "bash"
+
+PACKAGES = " \
+    ${PN} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'externalblktap', '', '${BLKTAP_PACKAGES}', d)} \
+    ${PN}-console \
+    ${PN}-cpuid \
+    ${PN}-dbg \
+    ${PN}-dev \
+    ${PN}-devd \
+    ${PN}-doc \
+    ${PN}-flask \
+    ${PN}-flask-tools \
+    ${PN}-fsimage \
+    ${PN}-gdbsx \
+    ${PN}-hvmloader \
+    ${PN}-init-xenstore-dom \
+    ${PN}-kdd \
+    ${PN}-libfsimage \
+    ${PN}-libfsimage-dev \
+    ${PN}-libxencall \
+    ${PN}-libxencall-dev \
+    ${PN}-libxenctrl \
+    ${PN}-libxenctrl-dev \
+    ${PN}-libxendevicemodel \
+    ${PN}-libxendevicemodel-dev \
+    ${PN}-libxenevtchn \
+    ${PN}-libxenevtchn-dev \
+    ${PN}-libxenforeignmemory \
+    ${PN}-libxenforeignmemory-dev \
+    ${PN}-libxengnttab \
+    ${PN}-libxengnttab-dev \
+    ${PN}-libxenguest \
+    ${PN}-libxenguest-dev \
+    ${PN}-libxenlight \
+    ${PN}-libxenlight-dev \
+    ${PN}-libxenstat \
+    ${PN}-libxenstat-dev \
+    ${PN}-libxenstore \
+    ${PN}-libxenstore-dev \
+    ${PN}-libxentoolcore \
+    ${PN}-libxentoolcore-dev \
+    ${PN}-libxentoollog \
+    ${PN}-libxentoollog-dev \
+    ${PN}-libxenvchan \
+    ${PN}-libxenvchan-dev \
+    ${PN}-libxlutil \
+    ${PN}-libxlutil-dev \
+    ${PN}-livepatch \
+    ${PN}-misc \
+    ${PN}-pygrub \
+    ${PN}-python \
+    ${PN}-remus \
+    ${PN}-scripts-block \
+    ${PN}-scripts-common \
+    ${PN}-scripts-network \
+    ${PN}-shim \
+    ${PN}-staticdev \
+    ${PN}-volatiles \
+    ${PN}-xcutils \
+    ${PN}-xencommons \
+    ${PN}-xend \
+    ${PN}-xend-examples \
+    ${PN}-xendomains \
+    ${PN}-xenmon \
+    ${PN}-xenpaging \
+    ${PN}-xenpmd \
+    ${PN}-xenstat \
+    ${PN}-xenstore \
+    ${PN}-xenstored \
+    ${PN}-xentrace \
+    ${PN}-xen-watchdog \
+    ${PN}-xl \
+    ${PN}-xl-examples \
+    ${PN}-xm \
+    ${PN}-xm-examples \
+    "
+
+PROVIDES =+ " \
+    virtual/xenstored \
+    ${@bb.utils.contains('PACKAGECONFIG', 'externalblktap', '', '${BLKTAP_PROVIDES}', d)} \
+    "
+
+# There are multiple implementations of the XenStore daemon, so we use a
+# virtual package to allow for substitution.
+RPROVIDES_${PN}-xenstored = "virtual/xenstored"
+
+FILES_${PN}-dbg += "\
+    ${libdir}/xen/bin/.debug \
+    ${libdir}/python2.7/site-packages/.debug \
+    ${libdir}/python2.7/site-packages/xen/lowlevel/.debug \
+    ${libdir}/fs/xfs/.debug \
+    ${libdir}/fs/ufs/.debug \
+    ${libdir}/fs/ext2fs-lib/.debug \
+    ${libdir}/fs/fat/.debug \
+    ${libdir}/fs/zfs/.debug \
+    ${libdir}/fs/reiserfs/.debug \
+    ${libdir}/fs/iso9660/.debug \
+    ${libdir}/fs/*/.debug \
+    ${sbindir}/.debug \
+    ${libdir}exec/.debug \
+    ${libdir}/xen/libexec/.debug \
+    ${bindir}/.debug \
+    ${libdir}/python2.7/dist-packages/.debug \
+    ${libdir}/python2.7/dist-packages/xen/lowlevel/.debug \
+    "
+
+FILES_${PN}-dev = "\
+    ${includedir} \
+    "
+
+FILES_${PN}-doc = "\
+    ${sysconfdir}/xen/README \
+    ${sysconfdir}/xen/README.incompatibilities \
+    ${datadir}/doc \
+    ${datadir}/man \
+    "
+
+FILES_${PN}-staticdev += "\
+    ${libdir}/libxenguest.a \
+    ${libdir}/libxenlight.a \
+    ${libdir}/libxenvchan.a \
+    ${libdir}/libxenctrl.a \
+    ${libdir}/libxlutil.a \
+    ${libdir}/libxenstat.a \
+    ${libdir}/libxenstore.a \
+    "
+
+FILES_${PN}-libxencall = "${libdir}/libxencall.so.*"
+FILES_${PN}-libxencall-dev = " \
+    ${libdir}/libxencall.so \
+    ${libdir}/pkgconfig/xencall.pc \
+    ${datadir}/pkgconfig/xencall.pc \
+    "
+
+FILES_${PN}-libxenctrl = "${libdir}/libxenctrl.so.*"
+FILES_${PN}-libxenctrl-dev = " \
+    ${libdir}/libxenctrl.so \
+    ${libdir}/pkgconfig/xencontrol.pc \
+    ${datadir}/pkgconfig/xencontrol.pc \
+    "
+
+FILES_${PN}-libxendevicemodel = "${libdir}/libxendevicemodel.so.*"
+FILES_${PN}-libxendevicemodel-dev = " \
+    ${libdir}/libxendevicemodel.so \
+    ${libdir}/pkgconfig/xendevicemodel.pc \
+    ${datadir}/pkgconfig/xendevicemodel.pc \
+    "
+
+FILES_${PN}-libxenevtchn = "${libdir}/libxenevtchn.so.*"
+FILES_${PN}-libxenevtchn-dev = " \
+    ${libdir}/libxenevtchn.so \
+    ${libdir}/pkgconfig/xenevtchn.pc \
+    ${datadir}/pkgconfig/xenevtchn.pc \
+    "
+
+FILES_${PN}-libxenforeignmemory = "${libdir}/libxenforeignmemory.so.*"
+FILES_${PN}-libxenforeignmemory-dev = " \
+    ${libdir}/libxenforeignmemory.so \
+    ${libdir}/pkgconfig/xenforeignmemory.pc \
+    ${datadir}/pkgconfig/xenforeignmemory.pc \
+    "
+
+FILES_${PN}-libxengnttab = "${libdir}/libxengnttab.so.*"
+FILES_${PN}-libxengnttab-dev = " \
+    ${libdir}/libxengnttab.so \
+    ${libdir}/pkgconfig/xengnttab.pc \
+    ${datadir}/pkgconfig/xengnttab.pc \
+    "
+
+FILES_${PN}-libxenguest = "${libdir}/libxenguest.so.*"
+FILES_${PN}-libxenguest-dev = " \
+    ${libdir}/libxenguest.so \
+    ${libdir}/pkgconfig/xenguest.pc \
+    ${datadir}/pkgconfig/xenguest.pc \
+    "
+
+FILES_${PN}-libxenlight = "${libdir}/libxenlight.so.*"
+FILES_${PN}-libxenlight-dev = " \
+    ${libdir}/libxenlight.so \
+    ${libdir}/pkgconfig/xenlight.pc \
+    ${datadir}/pkgconfig/xenlight.pc \
+    "
+
+FILES_${PN}-libxenstat = "${libdir}/libxenstat.so.*"
+FILES_${PN}-libxenstat-dev = " \
+    ${libdir}/libxenstat.so \
+    ${libdir}/pkgconfig/xenstat.pc \
+    ${datadir}/pkgconfig/xenstat.pc \
+    "
+
+FILES_${PN}-libxenstore = "${libdir}/libxenstore.so.*"
+FILES_${PN}-libxenstore-dev = " \
+    ${libdir}/libxenstore.so \
+    ${libdir}/pkgconfig/xenstore.pc \
+    ${datadir}/pkgconfig/xenstore.pc \
+    "
+
+FILES_${PN}-libxentoolcore = "${libdir}/libxentoolcore.so.*"
+FILES_${PN}-libxentoolcore-dev = " \
+    ${libdir}/libxentoolcore.so \
+    ${libdir}/pkgconfig/xentoolcore.pc \
+    ${datadir}/pkgconfig/xentoolcore.pc \
+    "
+
+FILES_${PN}-libxentoollog = "${libdir}/libxentoollog.so.*"
+FILES_${PN}-libxentoollog-dev = " \
+    ${libdir}/libxentoollog.so \
+    ${libdir}/pkgconfig/xentoollog.pc \
+    ${datadir}/pkgconfig/xentoollog.pc \
+    "
+
+FILES_${PN}-libxenvchan = "${libdir}/libxenvchan.so.*"
+FILES_${PN}-libxenvchan-dev = " \
+    ${libdir}/libxenvchan.so \
+    ${libdir}/pkgconfig/xenvchan.pc \
+    ${datadir}/pkgconfig/xenvchan.pc \
+    "
+
+FILES_${PN}-libxlutil = "${libdir}/libxlutil.so.*"
+FILES_${PN}-libxlutil-dev = " \
+    ${libdir}/libxlutil.so \
+    ${libdir}/pkgconfig/xlutil.pc \
+    ${datadir}/pkgconfig/xlutil.pc \
+    "
+FILES_${PN}-libvhd = "${libdir}/libvhd.so.*"
+FILES_${PN}-libvhd-dev = " \
+    ${libdir}/libvhd.so \
+    ${libdir}/pkgconfig/vhd.pc \
+    ${datadir}/pkgconfig/vhd.pc \
+    "
+
+FILES_${PN}-libfsimage = " \
+    ${libdir}/libfsimage.so.* \
+    ${libdir}/libxenfsimage.so.* \
+    "
+
+FILES_${PN}-libfsimage-dev = " \
+    ${libdir}/libfsimage.so \
+    ${libdir}/libxenfsimage.so \
+    ${libdir}/pkgconfig/fsimage.pc \
+    ${datadir}/pkgconfig/fsimage.pc \
+    ${libdir}/pkgconfig/xenfsimage.pc \
+    ${datadir}/pkgconfig/xenfsimage.pc \
+    "
+
+FILES_${PN}-fsimage = " \
+    ${libdir}/fs/*/*fsimage.so \
+    ${libdir}/xenfsimage/*/fsimage.so \
+    "
+
+FILES_${PN}-init-xenstore-dom = "${libdir}/xen/bin/init-xenstore-domain"
+
+FILES_${PN} = "\
+    ${sysconfdir}/xen/auto \
+    ${sysconfdir}/xen/cpupool \
+    ${localstatedir}/xen/dump \
+    "
+
+FILES_${PN}-console = "\
+    ${libdir}/xen/bin/xenconsole \
+    ${sbindir}/xenconsoled \
+    "
+
+FILES_${PN}-cpuid = "\
+    ${bindir}/xen-cpuid \
+    "
+
+FILES_${PN}-devd = "\
+    ${sysconfdir}/init.d/xendriverdomain \
+    ${systemd_unitdir}/system/xendriverdomain.service \
+    "
+
+FILES_${PN}-flask = "\
+    /boot/xenpolicy-* \
+    "
+
+FILES_${PN}-flask-tools = "\
+    ${sbindir}/flask-get-bool \
+    ${sbindir}/flask-getenforce \
+    ${sbindir}/flask-label-pci \
+    ${sbindir}/flask-loadpolicy \
+    ${sbindir}/flask-set-bool \
+    ${sbindir}/flask-setenforce \
+    "
+
+FILES_${PN}-gdbsx = "\
+    ${sbindir}/gdbsx \
+    "
+
+INSANE_SKIP_${PN}-hvmloader = "arch"
+FILES_${PN}-hvmloader = "\
+    ${libdir}/xen/boot/hvmloader \
+    "
+
+FILES_${PN}-kdd = "\
+    ${sbindir}/kdd \
+    ${sbindir}/xen-kdd \
+    "
+
+FILES_${PN}-livepatch += " \
+    ${sbindir}/xen-livepatch \
+    "
+
+FILES_${PN}-misc = "\
+    ${bindir}/xencons \
+    ${bindir}/xencov_split \
+    ${bindir}/xen-detect \
+    ${libdir}/xen/bin/xenpvnetboot \
+    ${libdir}/xen/bin/depriv-fd-checker \
+    ${sbindir}/gtracestat \
+    ${sbindir}/gtraceview \
+    ${sbindir}/xen-bugtool \
+    ${sbindir}/xencov \
+    ${sbindir}/xenperf \
+    ${sbindir}/xenpm \
+    ${sbindir}/xsview \
+    ${sbindir}/xen-diag \
+    ${sbindir}/xen-tmem-list-parse \
+    ${sbindir}/xen-python-path \
+    ${sbindir}/xen-ringwatch \
+    ${sbindir}/xen-hptool \
+    ${sbindir}/xen-hvmcrash \
+    ${sbindir}/xen-hvmctx \
+    ${sbindir}/xenlockprof \
+    ${sbindir}/xen-lowmemd \
+    ${sbindir}/xen-mfndump \
+    ${libdir}/xen/bin/verify-stream-v2 \
+    ${libdir}/xen/bin/convert-legacy-stream \
+    "
+
+FILES_${PN}-pygrub = "\
+    ${bindir}/pygrub \
+    ${libdir}/xen/bin/pygrub \
+    "
+
+FILES_${PN}-python = "\
+    ${libdir}/python2.7 \
+    "
+
+FILES_${PN}-remus = "\
+    ${bindir}/remus \
+    ${sysconfdir}/xen/scripts/remus-netbuf-setup \
+    "
+
+FILES_${PN}-scripts-network = " \
+    ${sysconfdir}/xen/scripts/colo-proxy-setup \
+    ${sysconfdir}/xen/scripts/network-bridge \
+    ${sysconfdir}/xen/scripts/network-nat \
+    ${sysconfdir}/xen/scripts/network-route \
+    ${sysconfdir}/xen/scripts/qemu-ifup \
+    ${sysconfdir}/xen/scripts/vif2 \
+    ${sysconfdir}/xen/scripts/vif-bridge \
+    ${sysconfdir}/xen/scripts/vif-common.sh \
+    ${sysconfdir}/xen/scripts/vif-nat \
+    ${sysconfdir}/xen/scripts/vif-openvswitch \
+    ${sysconfdir}/xen/scripts/vif-route \
+    ${sysconfdir}/xen/scripts/vif-setup \
+    "
+
+FILES_${PN}-scripts-block = " \
+    ${sysconfdir}/xen/scripts/blktap \
+    ${sysconfdir}/xen/scripts/block \
+    ${sysconfdir}/xen/scripts/block-common.sh \
+    ${sysconfdir}/xen/scripts/block-dummy \
+    ${sysconfdir}/xen/scripts/block-enbd \
+    ${sysconfdir}/xen/scripts/block-iscsi \
+    ${sysconfdir}/xen/scripts/block-nbd \
+    ${sysconfdir}/xen/scripts/block-drbd-probe \
+    ${sysconfdir}/xen/scripts/block-tap \
+    ${sysconfdir}/xen/scripts/vscsi \
+    "
+
+FILES_${PN}-scripts-common = " \
+    ${sysconfdir}/xen/scripts/external-device-migrate \
+    ${sysconfdir}/xen/scripts/hotplugpath.sh \
+    ${sysconfdir}/xen/scripts/locking.sh \
+    ${sysconfdir}/xen/scripts/logging.sh \
+    ${sysconfdir}/xen/scripts/xen-hotplug-cleanup \
+    ${sysconfdir}/xen/scripts/xen-hotplug-common.sh \
+    ${sysconfdir}/xen/scripts/xen-network-common.sh \
+    ${sysconfdir}/xen/scripts/xen-script-common.sh \
+    "
+
+INSANE_SKIP_${PN}-shim = "arch"
+FILES_${PN}-shim = " \
+    ${libdir}/xen/boot/xen-shim \
+    "
+
+FILES_${PN}-volatiles = "\
+    ${sysconfdir}/default/volatiles/99_xen \
+    ${sysconfdir}/tmpfiles.d/xen.conf \
+    "
+
+FILES_${PN}-xcutils = "\
+    ${libdir}/xen/bin/lsevtchn \
+    ${libdir}/xen/bin/readnotes \
+    ${libdir}/xen/bin/xc_restore \
+    ${libdir}/xen/bin/xc_save \
+    "
+
+FILES_${PN}-xend-examples = "\
+    ${sysconfdir}/xen/xend-config.sxp \
+    ${sysconfdir}/xen/xend-pci-permissive.sxp \
+    ${sysconfdir}/xen/xend-pci-quirks.sxp \
+    "
+
+FILES_${PN}-xenpaging = "\
+    ${libdir}/xen/bin/xenpaging \
+    ${localstatedir}/lib/xen/xenpaging \
+    "
+
+FILES_${PN}-xenpmd = "\
+    ${sbindir}/xenpmd \
+    "
+
+FILES_${PN}-xenstat = "\
+    ${sbindir}/xentop \
+    "
+
+FILES_${PN}-xenstore = "\
+    ${bindir}/xenstore \
+    ${bindir}/xenstore-chmod \
+    ${bindir}/xenstore-control \
+    ${bindir}/xenstore-exists \
+    ${bindir}/xenstore-list \
+    ${bindir}/xenstore-ls \
+    ${bindir}/xenstore-read \
+    ${bindir}/xenstore-rm \
+    ${bindir}/xenstore-watch \
+    ${bindir}/xenstore-write \
+    "
+
+FILES_${PN}-xenstored = "\
+    ${sbindir}/xenstored \
+    ${localstatedir}/lib/xenstored \
+    "
+
+FILES_${PN}-xentrace = "\
+    ${bindir}/xentrace \
+    ${bindir}/xentrace_format \
+    ${bindir}/xentrace_setsize \
+    ${libdir}/xen/bin/xenctx \
+    ${bindir}/xenalyze \
+    ${sbindir}/xentrace \
+    ${sbindir}/xentrace_setsize \
+    "
+
+FILES_${PN}-xen-watchdog = "\
+    ${sbindir}/xenwatchdogd \
+    ${sysconfdir}/init.d/xen-watchdog \
+    ${systemd_unitdir}/system/xen-watchdog.service \
+    "
+
+FILES_${PN}-xl = "\
+    ${sysconfdir}/bash_completion.d/xl.sh \
+    ${sysconfdir}/xen/xl.conf \
+    ${libdir}/xen/bin/libxl-save-helper \
+    ${sbindir}/xl \
+    ${libdir}/xen/bin/xen-init-dom0 \
+    "
+
+FILES_${PN}-xl-examples = "\
+    ${sysconfdir}/xen/xlexample.hvm \
+    ${sysconfdir}/xen/xlexample.pvlinux \
+    "
+
+FILES_${PN}-xm-examples = "\
+    ${sysconfdir}/xen/xmexample1 \
+    ${sysconfdir}/xen/xmexample2 \
+    ${sysconfdir}/xen/xmexample3 \
+    ${sysconfdir}/xen/xmexample.hvm \
+    ${sysconfdir}/xen/xmexample.hvm-stubdom \
+    ${sysconfdir}/xen/xmexample.nbd \
+    ${sysconfdir}/xen/xmexample.pv-grub \
+    ${sysconfdir}/xen/xmexample.vti \
+    "
+
+FILES_${PN}-xenmon = "\
+    ${sbindir}/xenbaked \
+    ${sbindir}/xentrace_setmask \
+    ${sbindir}/xenmon.py \
+    ${sbindir}/xenmon \
+    "
+
+FILES_${PN}-xm = "\
+    ${sysconfdir}/xen/xm-config.xml \
+    ${datadir}/xen/create.dtd \
+    ${sbindir}/xm \
+    "
+
+FILES_${PN}-xencommons += "\
+    ${sysconfdir}/default/xencommons \
+    ${sysconfdir}/init.d/xencommons \
+    ${sysconfdir}/xen/scripts/launch-xenstore \
+    ${systemd_unitdir}/modules-load.d/xen.conf \
+    ${systemd_unitdir}/system/proc-xen.mount \
+    ${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service \
+    ${systemd_unitdir}/system/xenconsoled.service \
+    ${systemd_unitdir}/system/xen-init-dom0.service \
+    ${systemd_unitdir}/system/xenstored.service \
+    ${systemd_unitdir}/system/var-lib-xenstored.mount \
+    "
+
+FILES_${PN}-xend += " \
+    ${sysconfdir}/init.d/xend \
+    ${sbindir}/xend \
+    "
+
+FILES_${PN}-xendomains += "\
+    ${libdir}/xen/bin/xendomains \
+    ${sysconfdir}/default/xendomains \
+    ${sysconfdir}/init.d/xendomains \
+    ${sysconfdir}/sysconfig/xendomains \
+    ${systemd_unitdir}/system/xendomains.service \
+    "
+
+INSANE_SKIP_${PN} = "already-stripped"
+
+# configure init.d scripts
+INITSCRIPT_PACKAGES = "${PN}-xend ${PN}-xencommons ${PN}-xen-watchdog ${PN}-xendomains ${PN}-devd"
+INITSCRIPT_NAME_${PN}-xencommons = "xencommons"
+INITSCRIPT_PARAMS_${PN}-xencommons = "defaults 80"
+INITSCRIPT_NAME_${PN}-xen-watchdog = "xen-watchdog"
+INITSCRIPT_PARAMS_${PN}-xen-watchdog = "defaults 81"
+INITSCRIPT_NAME_${PN}-xend = "xend"
+INITSCRIPT_PARAMS_${PN}-xend = "defaults 82"
+INITSCRIPT_NAME_${PN}-xendomains = "xendomains"
+INITSCRIPT_PARAMS_${PN}-xendomains = "defaults 83"
+INITSCRIPT_NAME_${PN}-devd = "xendriverdomain"
+INITSCRIPT_PARAMS_${PN}-devd = "defaults 82"
+
+# systemd packages
+SYSTEMD_PACKAGES = "${PN}-xen-watchdog ${PN}-xencommons ${PN}-xendomains ${PN}-devd"
+SYSTEMD_SERVICE_${PN}-devd = "xendriverdomain.service"
+SYSTEMD_SERVICE_${PN}-xen-watchdog = "xen-watchdog.service"
+SYSTEMD_SERVICE_${PN}-xencommons = " \
+    proc-xen.mount \
+    var-lib-xenstored.mount \
+    xen-qemu-dom0-disk-backend.service \
+    xenconsoled.service \
+    xen-init-dom0.service \
+    xenstored.service \
+    "
+SYSTEMD_SERVICE_${PN}-xendomains = "xendomains.service"
+
+do_configure() {
+    do_configure_common
+}
+
+do_stubs() {
+    # no stubs-32.h in our 64-bit sysroot - hack it into tools/include/gnu
+    if ! test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-32.h ; then
+        if test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h ; then
+            test -d ${S}/tools/include/gnu || mkdir ${S}/tools/include/gnu
+            cat ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h | grep -v stub_bdflush | grep -v stub_getmsg | grep -v stub_putmsg > ${S}/tools/include/gnu/stubs-32.h
+            echo \#define __stub___kernel_cosl >> ${S}/tools/include/gnu/stubs-32.h
+            echo \#define __stub___kernel_sinl >> ${S}/tools/include/gnu/stubs-32.h
+            echo \#define __stub___kernel_tanl >> ${S}/tools/include/gnu/stubs-32.h
+        fi
+    fi
+}
+
+addtask stubs after do_configure before do_compile
+
+do_compile() {
+    oe_runmake tools
+}
+
+do_install() {
+    oe_runmake DESTDIR="${D}" install-tools
+
+    # remove installed volatiles
+    rm -rf ${D}${base_prefix}/run \
+        ${D}${localstatedir}/run \
+        ${D}${localstatedir}/lock \
+        ${D}${localstatedir}/log \
+        ${D}${localstatedir}/volatile \
+        ${D}${localstatedir}/lib/xen
+
+    VOLATILE_DIRS=" \
+        ${base_prefix}/run/xenstored \
+        ${base_prefix}/run/xend \
+        ${base_prefix}/run/xend/boot \
+        ${base_prefix}/run/xen \
+        ${localstatedir}/log/xen \
+        ${localstatedir}/lock/xen \
+        ${localstatedir}/lock/subsys \
+        ${localstatedir}/lib/xen \
+        "
+
+    # install volatiles using populate_volatiles mechanism
+    install -d ${D}${sysconfdir}/default/volatiles
+    for i in $VOLATILE_DIRS; do
+        echo "d root root 0755 $i none"  >> ${D}${sysconfdir}/default/volatiles/99_xen
+    done
+
+    # workaround for xendomains script which searchs sysconfig if directory exists
+    install -d ${D}${sysconfdir}/sysconfig
+    ln -sf ${sysconfdir}/default/xendomains ${D}${sysconfdir}/sysconfig/xendomains
+
+    # systemd
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        # install volatiles using systemd tmpfiles.d
+        install -d ${D}${sysconfdir}/tmpfiles.d
+        for i in $VOLATILE_DIRS; do
+            echo "d $i 0755 root root - -"  >> ${D}${sysconfdir}/tmpfiles.d/xen.conf
+        done
+    fi
+
+    # fixup default path to qemu-system-i386
+    sed -i 's#\(test -z "$QEMU_XEN" && QEMU_XEN=\).*$#\1"/usr/bin/qemu-system-i386"#' ${D}/etc/init.d/xencommons
+
+    if [ -e ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service ]; then
+        sed -i 's#ExecStart=.*qemu-system-i386\(.*\)$#ExecStart=/usr/bin/qemu-system-i386\1#' \
+            ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service
+    fi
+}
+
+pkg_postinst_${PN}-volatiles() {
+    if [ -z "$D" ]; then
+        if command -v systemd-tmpfiles >/dev/null; then
+            systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/xen.conf
+        elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+            ${sysconfdir}/init.d/populate-volatile.sh update
+        fi
+    fi
+}
+
+do_deploy() {
+    XEN_FULLVERSION=$(oe_runmake -C ${S}/xen xenversion --no-print-directory)
+    FLASK_POLICY_FILE="xenpolicy-${XEN_FULLVERSION}"
+
+    install -d ${DEPLOYDIR}
+
+    # Install the flask policy in the deploy directory if it exists
+    if [ -f ${D}/boot/${FLASK_POLICY_FILE} ]; then
+        install -m 0644 ${D}/boot/${FLASK_POLICY_FILE} ${DEPLOYDIR}
+        ln -sf ${FLASK_POLICY_FILE} ${DEPLOYDIR}/xenpolicy-${MACHINE}
+    fi
+}
+
+addtask deploy after do_populate_sysroot
diff --git a/recipes-extended/xen/xen-tools_git.bb b/recipes-extended/xen/xen-tools_git.bb
new file mode 100644
index 0000000..7042c53
--- /dev/null
+++ b/recipes-extended/xen/xen-tools_git.bb
@@ -0,0 +1,18 @@
+SRCREV ?= "a5fcafbfbee55261853fba07149c1c795f2baf58"
+
+XEN_REL ?= "4.12"
+XEN_BRANCH ?= "stable-${XEN_REL}"
+
+SRC_URI = " \
+    git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
+    file://0001-python-pygrub-pass-DISTUTILS-xen.4.12.patch \
+    "
+
+LIC_FILES_CHKSUM ?= "file://COPYING;md5=bbb4b1bdc2c3b6743da3c39d03249095"
+
+PV = "${XEN_REL}+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+require xen.inc
+require xen-tools.inc
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index 2aed677..b2af8aa 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -1,13 +1,10 @@
-DESCRIPTION = "Xen hypervisor"
 HOMEPAGE = "http://xen.org"
 LICENSE = "GPLv2"
 SECTION = "console/tools"
 
-LIC_FILES_CHKSUM = "file://COPYING;md5=bbb4b1bdc2c3b6743da3c39d03249095"
-
 COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
 
-inherit autotools-brokensep setuptools3 update-rc.d systemd deploy
+inherit autotools-brokensep
 
 require xen-arch.inc
 
@@ -17,12 +14,11 @@ PACKAGECONFIG ??= " \
     ${@bb.utils.contains('XEN_TARGET_ARCH', 'x86_64', 'hvm', '', d)} \
     "
 
-FLASK_POLICY_FILE ?= "xenpolicy-${PV}"
-
 PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,virtual/libsdl,"
 PACKAGECONFIG[xsm] = "--enable-xsmpolicy,--disable-xsmpolicy,checkpolicy-native,"
 PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd,"
 PACKAGECONFIG[hvm] = "--with-system-seabios="/usr/share/firmware/bios.bin",--disable-seabios,seabios ipxe vgabios,"
+PACKAGECONFIG[externalblktap] = ",,,"
 
 DEPENDS = " \
     ${@bb.utils.contains('XEN_TARGET_ARCH', 'x86_64', 'dev86-native', '', d)} \
@@ -57,699 +53,6 @@ DEPENDS = " \
     gnu-efi \
     "
 
-# inherit setuptools adds python to RDEPENDS, override it
-RDEPENDS_${PN} = ""
-
-RDEPENDS_${PN}-base = "\
-    bash perl xz \
-    ${PN}-console \
-    ${PN}-libxenguest \
-    ${PN}-libxenlight \
-    ${PN}-libxenvchan \
-    ${PN}-libxenctrl \
-    ${PN}-libxlutil \
-    ${PN}-libxenstat \
-    ${PN}-libxenstore \
-    ${PN}-libfsimage \
-    ${PN}-fsimage \
-    ${PN}-scripts-block \
-    ${PN}-scripts-network \
-    ${PN}-xen-watchdog \
-    ${PN}-xencommons \
-    ${PN}-xendomains \
-    ${PN}-xenstore \
-    ${PN}-xenstored \
-    ${PN}-xl \
-    "
-
-RDEPENDS_${PN}-dev = ""
-
-RRECOMMENDS_${PN}-base = " \
-    ${PN}-blktap \
-    ${PN}-libblktap \
-    ${PN}-libblktapctl \
-    ${PN}-libvhd \
-    ${PN}-flask \
-    ${PN}-hvmloader \
-    ${PN}-shim \
-    ${PN}-xenpaging \
-    "
-
-RDEPENDS_${PN}-devd = " \
-    ${PN}-xl \
-    "
-
-RDEPENDS_${PN}-fsimage = " \
-    libext2fs \
-    "
-
-RDEPENDS_${PN}-misc = " \
-    perl \
-    python \
-    "
-
-RDEPENDS_${PN}-python = " \
-    python \
-    "
-
-RDEPENDS_${PN}-pygrub = " \
-    ${PN}-python \
-    "
-
-RDEPENDS_${PN}-remus = " \
-    bash \
-    python \
-    "
-
-RDEPENDS_${PN}-scripts-block = "\
-    bash \
-    ${PN}-scripts-common \
-    ${PN}-volatiles \
-    "
-
-RDEPENDS_${PN}-scripts-common = "bash"
-
-RDEPENDS_${PN}-scripts-network = "\
-    bash \
-    bridge-utils \
-    ${PN}-scripts-common \
-    ${PN}-volatiles \
-    "
-
-RDEPENDS_${PN}-xencommons = "\
-    bash \
-    ${PN}-console \
-    ${PN}-xenstore \
-    ${PN}-xenstored \
-    ${PN}-xl \
-    ${PN}-scripts-common \
-    "
-
-RDEPENDS_${PN}-xendomains = "\
-    bash \
-    ${PN}-console \
-    ${PN}-scripts-block \
-    ${PN}-scripts-common \
-    ${PN}-xenstored \
-    "
-
-RDEPENDS_${PN}-xl = "libgcc"
-
-RDEPENDS_${PN}-xentrace = "python"
-
-RDEPENDS_${PN}-xen-watchdog = "bash"
-
-PACKAGES = "\
-    ${PN}-base \
-    ${PN}-blktap \
-    ${PN}-console \
-    ${PN}-cpuid \
-    ${PN}-dbg \
-    ${PN}-dev \
-    ${PN}-devd \
-    ${PN}-doc \
-    ${PN}-efi \
-    ${PN}-flask \
-    ${PN}-flask-tools \
-    ${PN}-fsimage \
-    ${PN}-gdbsx \
-    ${PN}-hvmloader \
-    ${PN}-hypervisor \
-    ${PN}-init-xenstore-dom \
-    ${PN}-kdd \
-    ${PN}-libblktap \
-    ${PN}-libblktapctl \
-    ${PN}-libblktapctl-dev \
-    ${PN}-libblktap-dev \
-    ${PN}-libfsimage \
-    ${PN}-libfsimage-dev \
-    ${PN}-libvhd \
-    ${PN}-libvhd-dev \
-    ${PN}-libxencall \
-    ${PN}-libxencall-dev \
-    ${PN}-libxenctrl \
-    ${PN}-libxenctrl-dev \
-    ${PN}-libxendevicemodel \
-    ${PN}-libxendevicemodel-dev \
-    ${PN}-libxenevtchn \
-    ${PN}-libxenevtchn-dev \
-    ${PN}-libxenforeignmemory \
-    ${PN}-libxenforeignmemory-dev \
-    ${PN}-libxengnttab \
-    ${PN}-libxengnttab-dev \
-    ${PN}-libxenguest \
-    ${PN}-libxenguest-dev \
-    ${PN}-libxenlight \
-    ${PN}-libxenlight-dev \
-    ${PN}-libxenstat \
-    ${PN}-libxenstat-dev \
-    ${PN}-libxenstore \
-    ${PN}-libxenstore-dev \
-    ${PN}-libxentoolcore \
-    ${PN}-libxentoolcore-dev \
-    ${PN}-libxentoollog \
-    ${PN}-libxentoollog-dev \
-    ${PN}-libxenvchan \
-    ${PN}-libxenvchan-dev \
-    ${PN}-libxlutil \
-    ${PN}-libxlutil-dev \
-    ${PN}-livepatch \
-    ${PN}-misc \
-    ${PN}-pygrub \
-    ${PN}-python \
-    ${PN}-remus \
-    ${PN}-scripts-block \
-    ${PN}-scripts-common \
-    ${PN}-scripts-network \
-    ${PN}-shim \
-    ${PN}-staticdev \
-    ${PN}-volatiles \
-    ${PN}-xcutils \
-    ${PN}-xencommons \
-    ${PN}-xend \
-    ${PN}-xend-examples \
-    ${PN}-xendomains \
-    ${PN}-xenmon \
-    ${PN}-xenpaging \
-    ${PN}-xenpmd \
-    ${PN}-xenstat \
-    ${PN}-xenstore \
-    ${PN}-xenstored \
-    ${PN}-xentrace \
-    ${PN}-xen-watchdog \
-    ${PN}-xl \
-    ${PN}-xl-examples \
-    ${PN}-xm \
-    ${PN}-xm-examples \
-    "
-
-FILES_${PN}-dbg += "\
-    ${libdir}/.debug \
-    ${libdir}/debug/* \
-    ${libdir}/xen/bin/.debug \
-    ${libdir}/python2.7/site-packages/.debug \
-    ${libdir}/python2.7/site-packages/xen/lowlevel/.debug \
-    ${libdir}/fs/xfs/.debug \
-    ${libdir}/fs/ufs/.debug \
-    ${libdir}/fs/ext2fs-lib/.debug \
-    ${libdir}/fs/fat/.debug \
-    ${libdir}/fs/zfs/.debug \
-    ${libdir}/fs/reiserfs/.debug \
-    ${libdir}/fs/iso9660/.debug \
-    ${libdir}/fs/*/.debug \
-    ${sbindir}/.debug \
-    ${libdir}exec/.debug \
-    ${libdir}/xen/libexec/.debug \
-    ${bindir}/.debug \
-    ${libdir}/python2.7/dist-packages/.debug \
-    ${libdir}/python2.7/dist-packages/xen/lowlevel/.debug \
-    "
-
-FILES_${PN}-dev = "\
-    ${includedir} \
-    "
-
-FILES_${PN}-doc = "\
-    ${sysconfdir}/xen/README \
-    ${sysconfdir}/xen/README.incompatibilities \
-    ${datadir}/doc \
-    ${datadir}/man \
-    "
-
-FILES_${PN}-staticdev += "\
-    ${libdir}/libblktapctl.a \
-    ${libdir}/libxenguest.a \
-    ${libdir}/libxenlight.a \
-    ${libdir}/libxenvchan.a \
-    ${libdir}/libxenctrl.a \
-    ${libdir}/libxlutil.a \
-    ${libdir}/libvhd.a \
-    ${libdir}/libxenstat.a \
-    ${libdir}/libxenstore.a \
-    ${libdir}/libblktap.a \
-    "
-
-FILES_${PN}-libblktapctl = "${libdir}/libblktapctl.so.*"
-FILES_${PN}-libblktapctl-dev = " \
-    ${libdir}/libblktapctl.so \
-    ${libdir}/pkgconfig/xenblktapctl.pc \
-    ${datadir}/pkgconfig/xenblktapctl.pc \
-    "
-
-FILES_${PN}-libxencall = "${libdir}/libxencall.so.*"
-FILES_${PN}-libxencall-dev = " \
-    ${libdir}/libxencall.so \
-    ${libdir}/pkgconfig/xencall.pc \
-    ${datadir}/pkgconfig/xencall.pc \
-    "
-
-FILES_${PN}-libxenctrl = "${libdir}/libxenctrl.so.*"
-FILES_${PN}-libxenctrl-dev = " \
-    ${libdir}/libxenctrl.so \
-    ${libdir}/pkgconfig/xencontrol.pc \
-    ${datadir}/pkgconfig/xencontrol.pc \
-    "
-
-FILES_${PN}-libxendevicemodel = "${libdir}/libxendevicemodel.so.*"
-FILES_${PN}-libxendevicemodel-dev = " \
-    ${libdir}/libxendevicemodel.so \
-    ${libdir}/pkgconfig/xendevicemodel.pc \
-    ${datadir}/pkgconfig/xendevicemodel.pc \
-    "
-
-FILES_${PN}-libxenevtchn = "${libdir}/libxenevtchn.so.*"
-FILES_${PN}-libxenevtchn-dev = " \
-    ${libdir}/libxenevtchn.so \
-    ${libdir}/pkgconfig/xenevtchn.pc \
-    ${datadir}/pkgconfig/xenevtchn.pc \
-    "
-
-FILES_${PN}-libxenforeignmemory = "${libdir}/libxenforeignmemory.so.*"
-FILES_${PN}-libxenforeignmemory-dev = " \
-    ${libdir}/libxenforeignmemory.so \
-    ${libdir}/pkgconfig/xenforeignmemory.pc \
-    ${datadir}/pkgconfig/xenforeignmemory.pc \
-    "
-
-FILES_${PN}-libxengnttab = "${libdir}/libxengnttab.so.*"
-FILES_${PN}-libxengnttab-dev = " \
-    ${libdir}/libxengnttab.so \
-    ${libdir}/pkgconfig/xengnttab.pc \
-    ${datadir}/pkgconfig/xengnttab.pc \
-    "
-
-FILES_${PN}-libxenguest = "${libdir}/libxenguest.so.*"
-FILES_${PN}-libxenguest-dev = " \
-    ${libdir}/libxenguest.so \
-    ${libdir}/pkgconfig/xenguest.pc \
-    ${datadir}/pkgconfig/xenguest.pc \
-    "
-
-FILES_${PN}-libxenlight = "${libdir}/libxenlight.so.*"
-FILES_${PN}-libxenlight-dev = " \
-    ${libdir}/libxenlight.so \
-    ${libdir}/pkgconfig/xenlight.pc \
-    ${datadir}/pkgconfig/xenlight.pc \
-    "
-
-FILES_${PN}-libxenstat = "${libdir}/libxenstat.so.*"
-FILES_${PN}-libxenstat-dev = " \
-    ${libdir}/libxenstat.so \
-    ${libdir}/pkgconfig/xenstat.pc \
-    ${datadir}/pkgconfig/xenstat.pc \
-    "
-
-FILES_${PN}-libxenstore = "${libdir}/libxenstore.so.*"
-FILES_${PN}-libxenstore-dev = " \
-    ${libdir}/libxenstore.so \
-    ${libdir}/pkgconfig/xenstore.pc \
-    ${datadir}/pkgconfig/xenstore.pc \
-    "
-
-FILES_${PN}-libxentoolcore = "${libdir}/libxentoolcore.so.*"
-FILES_${PN}-libxentoolcore-dev = " \
-    ${libdir}/libxentoolcore.so \
-    ${libdir}/pkgconfig/xentoolcore.pc \
-    ${datadir}/pkgconfig/xentoolcore.pc \
-    "
-
-FILES_${PN}-libxentoollog = "${libdir}/libxentoollog.so.*"
-FILES_${PN}-libxentoollog-dev = " \
-    ${libdir}/libxentoollog.so \
-    ${libdir}/pkgconfig/xentoollog.pc \
-    ${datadir}/pkgconfig/xentoollog.pc \
-    "
-
-FILES_${PN}-libxenvchan = "${libdir}/libxenvchan.so.*"
-FILES_${PN}-libxenvchan-dev = " \
-    ${libdir}/libxenvchan.so \
-    ${libdir}/pkgconfig/xenvchan.pc \
-    ${datadir}/pkgconfig/xenvchan.pc \
-    "
-
-FILES_${PN}-libxlutil = "${libdir}/libxlutil.so.*"
-FILES_${PN}-libxlutil-dev = " \
-    ${libdir}/libxlutil.so \
-    ${libdir}/pkgconfig/xlutil.pc \
-    ${datadir}/pkgconfig/xlutil.pc \
-    "
-FILES_${PN}-libvhd = "${libdir}/libvhd.so.*"
-FILES_${PN}-libvhd-dev = " \
-    ${libdir}/libvhd.so \
-    ${libdir}/pkgconfig/vhd.pc \
-    ${datadir}/pkgconfig/vhd.pc \
-    "
-
-FILES_${PN}-libblktap = "${libdir}/libblktap.so.*"
-FILES_${PN}-libblktap-dev = " \
-    ${libdir}/libblktap.so \
-    ${libdir}/pkgconfig/blktap.pc \
-    ${datadir}/pkgconfig/blktap.pc \
-    "
-
-FILES_${PN}-libfsimage = " \
-    ${libdir}/libfsimage.so.* \
-    ${libdir}/libxenfsimage.so.* \
-    "
-FILES_${PN}-libfsimage-dev = " \
-    ${libdir}/libfsimage.so \
-    ${libdir}/libxenfsimage.so \
-    ${libdir}/pkgconfig/fsimage.pc \
-    ${datadir}/pkgconfig/fsimage.pc \
-    ${libdir}/pkgconfig/xenfsimage.pc \
-    ${datadir}/pkgconfig/xenfsimage.pc \
-    "
-
-FILES_${PN}-fsimage = " \
-    ${libdir}/fs/*/*fsimage.so \
-    ${libdir}/xenfsimage/*/fsimage.so \
-    "
-
-FILES_${PN}-hypervisor = "\
-    /boot/xen-* \
-    /boot/xen \
-    /boot/xen-*.gz \
-    /boot/xen.gz \
-    /boot/xen-syms-* \
-    "
-
-FILES_${PN}-init-xenstore-dom = "${libdir}/xen/bin/init-xenstore-domain"
-
-FILES_${PN}-efi = "\
-    /boot/xen.efi \
-    ${exec_prefix}/lib64/efi/xen* \
-    "
-
-FILES_${PN}-base = "\
-    ${sysconfdir}/xen/auto \
-    ${sysconfdir}/xen/cpupool \
-    ${localstatedir}/xen/dump \
-    "
-
-FILES_${PN}-blktap = "\
-    ${sbindir}/blktapctrl \
-    ${sbindir}/img2qcow \
-    ${sbindir}/lock-util \
-    ${sbindir}/qcow2raw \
-    ${sbindir}/qcow-create \
-    ${sbindir}/tap-ctl \
-    ${sbindir}/tapdisk \
-    ${sbindir}/tapdisk2 \
-    ${sbindir}/tapdisk-client \
-    ${sbindir}/tapdisk-diff \
-    ${sbindir}/tapdisk-stream \
-    ${sbindir}/td-util \
-    ${sbindir}/vhd-update \
-    ${sbindir}/vhd-util \
-    "
-
-FILES_${PN}-console = "\
-    ${libdir}/xen/bin/xenconsole \
-    ${sbindir}/xenconsoled \
-    "
-
-FILES_${PN}-cpuid = "\
-    ${bindir}/xen-cpuid \
-    "
-
-FILES_${PN}-devd = "\
-    ${sysconfdir}/init.d/xendriverdomain \
-    ${systemd_unitdir}/system/xendriverdomain.service \
-    "
-
-FILES_${PN}-flask = "\
-    /boot/${FLASK_POLICY_FILE} \
-    "
-
-FILES_${PN}-flask-tools = "\
-    ${sbindir}/flask-get-bool \
-    ${sbindir}/flask-getenforce \
-    ${sbindir}/flask-label-pci \
-    ${sbindir}/flask-loadpolicy \
-    ${sbindir}/flask-set-bool \
-    ${sbindir}/flask-setenforce \
-    "
-
-FILES_${PN}-gdbsx = "\
-    ${sbindir}/gdbsx \
-    "
-
-INSANE_SKIP_${PN}-hvmloader = "arch"
-FILES_${PN}-hvmloader = "\
-    ${libdir}/xen/boot/hvmloader \
-    "
-
-FILES_${PN}-kdd = "\
-    ${sbindir}/kdd \
-    ${sbindir}/xen-kdd \
-    "
-
-FILES_${PN}-livepatch += " \
-    ${sbindir}/xen-livepatch \
-    "
-
-FILES_${PN}-misc = "\
-    ${bindir}/xencons \
-    ${bindir}/xencov_split \
-    ${bindir}/xen-detect \
-    ${libdir}/xen/bin/xenpvnetboot \
-    ${libdir}/xen/bin/depriv-fd-checker \
-    ${sbindir}/gtracestat \
-    ${sbindir}/gtraceview \
-    ${sbindir}/xen-bugtool \
-    ${sbindir}/xencov \
-    ${sbindir}/xenperf \
-    ${sbindir}/xenpm \
-    ${sbindir}/xsview \
-    ${sbindir}/xen-diag \
-    ${sbindir}/xen-tmem-list-parse \
-    ${sbindir}/xen-python-path \
-    ${sbindir}/xen-ringwatch \
-    ${sbindir}/xen-hptool \
-    ${sbindir}/xen-hvmcrash \
-    ${sbindir}/xen-hvmctx \
-    ${sbindir}/xenlockprof \
-    ${sbindir}/xen-lowmemd \
-    ${sbindir}/xen-mfndump \
-    ${libdir}/xen/bin/verify-stream-v2 \
-    ${libdir}/xen/bin/convert-legacy-stream \
-    "
-
-FILES_${PN}-pygrub = "\
-    ${bindir}/pygrub \
-    ${libdir}/xen/bin/pygrub \
-    "
-
-FILES_${PN}-python = "\
-    ${libdir}/python2.7 \
-    "
-
-INSANE_SKIP_${PN} = "already-stripped"
-
-FILES_${PN}-remus = "\
-    ${bindir}/remus \
-    ${sysconfdir}/xen/scripts/remus-netbuf-setup \
-    "
-
-FILES_${PN}-scripts-network = " \
-    ${sysconfdir}/xen/scripts/colo-proxy-setup \
-    ${sysconfdir}/xen/scripts/network-bridge \
-    ${sysconfdir}/xen/scripts/network-nat \
-    ${sysconfdir}/xen/scripts/network-route \
-    ${sysconfdir}/xen/scripts/qemu-ifup \
-    ${sysconfdir}/xen/scripts/vif2 \
-    ${sysconfdir}/xen/scripts/vif-bridge \
-    ${sysconfdir}/xen/scripts/vif-common.sh \
-    ${sysconfdir}/xen/scripts/vif-nat \
-    ${sysconfdir}/xen/scripts/vif-openvswitch \
-    ${sysconfdir}/xen/scripts/vif-route \
-    ${sysconfdir}/xen/scripts/vif-setup \
-    "
-
-FILES_${PN}-scripts-block = " \
-    ${sysconfdir}/xen/scripts/blktap \
-    ${sysconfdir}/xen/scripts/block \
-    ${sysconfdir}/xen/scripts/block-common.sh \
-    ${sysconfdir}/xen/scripts/block-dummy \
-    ${sysconfdir}/xen/scripts/block-enbd \
-    ${sysconfdir}/xen/scripts/block-iscsi \
-    ${sysconfdir}/xen/scripts/block-nbd \
-    ${sysconfdir}/xen/scripts/block-drbd-probe \
-    ${sysconfdir}/xen/scripts/block-tap \
-    ${sysconfdir}/xen/scripts/vscsi \
-    "
-
-FILES_${PN}-scripts-common = " \
-    ${sysconfdir}/xen/scripts/external-device-migrate \
-    ${sysconfdir}/xen/scripts/hotplugpath.sh \
-    ${sysconfdir}/xen/scripts/locking.sh \
-    ${sysconfdir}/xen/scripts/logging.sh \
-    ${sysconfdir}/xen/scripts/xen-hotplug-cleanup \
-    ${sysconfdir}/xen/scripts/xen-hotplug-common.sh \
-    ${sysconfdir}/xen/scripts/xen-network-common.sh \
-    ${sysconfdir}/xen/scripts/xen-script-common.sh \
-    "
-
-INSANE_SKIP_${PN}-shim = "arch"
-FILES_${PN}-shim = " \
-    ${libdir}/xen/boot/xen-shim \
-    "
-
-FILES_${PN}-volatiles = "\
-    ${sysconfdir}/default/volatiles/99_xen \
-    ${sysconfdir}/tmpfiles.d/xen.conf \
-    "
-
-FILES_${PN}-xcutils = "\
-    ${libdir}/xen/bin/lsevtchn \
-    ${libdir}/xen/bin/readnotes \
-    ${libdir}/xen/bin/xc_restore \
-    ${libdir}/xen/bin/xc_save \
-    "
-
-FILES_${PN}-xend-examples = "\
-    ${sysconfdir}/xen/xend-config.sxp \
-    ${sysconfdir}/xen/xend-pci-permissive.sxp \
-    ${sysconfdir}/xen/xend-pci-quirks.sxp \
-    "
-
-FILES_${PN}-xenpaging = "\
-    ${libdir}/xen/bin/xenpaging \
-    ${localstatedir}/lib/xen/xenpaging \
-    "
-
-FILES_${PN}-xenpmd = "\
-    ${sbindir}/xenpmd \
-    "
-
-FILES_${PN}-xenstat = "\
-    ${sbindir}/xentop \
-    "
-
-FILES_${PN}-xenstore = "\
-    ${bindir}/xenstore \
-    ${bindir}/xenstore-chmod \
-    ${bindir}/xenstore-control \
-    ${bindir}/xenstore-exists \
-    ${bindir}/xenstore-list \
-    ${bindir}/xenstore-ls \
-    ${bindir}/xenstore-read \
-    ${bindir}/xenstore-rm \
-    ${bindir}/xenstore-watch \
-    ${bindir}/xenstore-write \
-    "
-
-FILES_${PN}-xenstored = "\
-    ${sbindir}/xenstored \
-    ${localstatedir}/lib/xenstored \
-    "
-
-FILES_${PN}-xentrace = "\
-    ${bindir}/xentrace \
-    ${bindir}/xentrace_format \
-    ${bindir}/xentrace_setsize \
-    ${libdir}/xen/bin/xenctx \
-    ${bindir}/xenalyze \
-    ${sbindir}/xentrace \
-    ${sbindir}/xentrace_setsize \
-    "
-
-FILES_${PN}-xen-watchdog = "\
-    ${sbindir}/xenwatchdogd \
-    ${sysconfdir}/init.d/xen-watchdog \
-    ${systemd_unitdir}/system/xen-watchdog.service \
-    "
-
-FILES_${PN}-xl = "\
-    ${sysconfdir}/bash_completion.d/xl.sh \
-    ${sysconfdir}/xen/xl.conf \
-    ${libdir}/xen/bin/libxl-save-helper \
-    ${sbindir}/xl \
-    ${libdir}/xen/bin/xen-init-dom0 \
-    "
-
-FILES_${PN}-xl-examples = "\
-    ${sysconfdir}/xen/xlexample.hvm \
-    ${sysconfdir}/xen/xlexample.pvlinux \
-    "
-
-FILES_${PN}-xm-examples = "\
-    ${sysconfdir}/xen/xmexample1 \
-    ${sysconfdir}/xen/xmexample2 \
-    ${sysconfdir}/xen/xmexample3 \
-    ${sysconfdir}/xen/xmexample.hvm \
-    ${sysconfdir}/xen/xmexample.hvm-stubdom \
-    ${sysconfdir}/xen/xmexample.nbd \
-    ${sysconfdir}/xen/xmexample.pv-grub \
-    ${sysconfdir}/xen/xmexample.vti \
-    "
-
-FILES_${PN}-xenmon = "\
-    ${sbindir}/xenbaked \
-    ${sbindir}/xentrace_setmask \
-    ${sbindir}/xenmon.py \
-    ${sbindir}/xenmon \
-    "
-
-FILES_${PN}-xm = "\
-    ${sysconfdir}/xen/xm-config.xml \
-    ${datadir}/xen/create.dtd \
-    ${sbindir}/xm \
-    "
-
-FILES_${PN}-xencommons += "\
-    ${sysconfdir}/default/xencommons \
-    ${sysconfdir}/init.d/xencommons \
-    ${sysconfdir}/xen/scripts/launch-xenstore \
-    ${systemd_unitdir}/modules-load.d/xen.conf \
-    ${systemd_unitdir}/system/proc-xen.mount \
-    ${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service \
-    ${systemd_unitdir}/system/xenconsoled.service \
-    ${systemd_unitdir}/system/xen-init-dom0.service \
-    ${systemd_unitdir}/system/xenstored.service \
-    ${systemd_unitdir}/system/var-lib-xenstored.mount \
-    "
-
-FILES_${PN}-xend += " \
-    ${sysconfdir}/init.d/xend \
-    ${sbindir}/xend \
-    "
-
-FILES_${PN}-xendomains += "\
-    ${libdir}/xen/bin/xendomains \
-    ${sysconfdir}/default/xendomains \
-    ${sysconfdir}/init.d/xendomains \
-    ${sysconfdir}/sysconfig/xendomains \
-    ${systemd_unitdir}/system/xendomains.service \
-    "
-
-# configure init.d scripts
-INITSCRIPT_PACKAGES = "${PN}-xend ${PN}-xencommons ${PN}-xen-watchdog ${PN}-xendomains ${PN}-devd"
-INITSCRIPT_NAME_${PN}-xencommons = "xencommons"
-INITSCRIPT_PARAMS_${PN}-xencommons = "defaults 80"
-INITSCRIPT_NAME_${PN}-xen-watchdog = "xen-watchdog"
-INITSCRIPT_PARAMS_${PN}-xen-watchdog = "defaults 81"
-INITSCRIPT_NAME_${PN}-xend = "xend"
-INITSCRIPT_PARAMS_${PN}-xend = "defaults 82"
-INITSCRIPT_NAME_${PN}-xendomains = "xendomains"
-INITSCRIPT_PARAMS_${PN}-xendomains = "defaults 83"
-INITSCRIPT_NAME_${PN}-devd = "xendriverdomain"
-INITSCRIPT_PARAMS_${PN}-devd = "defaults 82"
-
-# systemd packages
-SYSTEMD_PACKAGES = "${PN}-xen-watchdog ${PN}-xencommons ${PN}-xendomains ${PN}-devd"
-SYSTEMD_SERVICE_${PN}-devd = "xendriverdomain.service"
-SYSTEMD_SERVICE_${PN}-xen-watchdog = "xen-watchdog.service"
-SYSTEMD_SERVICE_${PN}-xencommons = " \
-    proc-xen.mount \
-    var-lib-xenstored.mount \
-    xen-qemu-dom0-disk-backend.service \
-    xenconsoled.service \
-    xen-init-dom0.service \
-    xenstored.service \
-    "
-SYSTEMD_SERVICE_${PN}-xendomains = "xendomains.service"
-
 #### REQUIRED ENVIRONMENT VARIABLES ####
 export BUILD_SYS
 export HOST_SYS
@@ -896,21 +199,6 @@ do_post_patch_append_arm()  {
 
 addtask post_patch after do_patch before do_configure
 
-do_stubs() {
-    # no stubs-32.h in our 64-bit sysroot - hack it into tools/include/gnu
-    if ! test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-32.h ; then
-        if test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h ; then
-            test -d ${S}/tools/include/gnu || mkdir ${S}/tools/include/gnu
-            cat ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h | grep -v stub_bdflush | grep -v stub_getmsg | grep -v stub_putmsg > ${S}/tools/include/gnu/stubs-32.h
-            echo \#define __stub___kernel_cosl >> ${S}/tools/include/gnu/stubs-32.h
-            echo \#define __stub___kernel_sinl >> ${S}/tools/include/gnu/stubs-32.h
-            echo \#define __stub___kernel_tanl >> ${S}/tools/include/gnu/stubs-32.h
-        fi
-    fi
-}
-
-addtask stubs after do_configure before do_compile
-
 # Allow all hypervisor settings in a defconfig
 EXTRA_OEMAKE += "XEN_CONFIG_EXPERT=y"
 # Build release versions always. Technically since we track release
@@ -918,7 +206,7 @@ EXTRA_OEMAKE += "XEN_CONFIG_EXPERT=y"
 # from staging that reverts this
 EXTRA_OEMAKE += "debug=n"
 
-do_configure() {
+do_configure_common() {
 
     #./configure --enable-xsmpolicy does not set XSM_ENABLE must be done manually
     if [ "${XSM_ENABLED}" = "1" ]; then
@@ -940,134 +228,14 @@ do_configure() {
     fi
 }
 
-do_compile() {
+do_compile_prepend() {
     # workaround for build bug when CFLAGS is exported
     # https://www.mail-archive.com/xen-devel@lists.xen.org/msg67822.html
     unset CFLAGS
-
-    # Workaround for parallel build bug: build xen first.
-    # https://lists.xenproject.org/archives/html/xen-devel/2018-07/msg02551.html
-    oe_runmake xen
-    oe_runmake
 }
 
-do_install() {
+do_install_prepend() {
     # CFLAGS is used to set PY_CFLAGS which affects the pygrub install
     # so also need to unset CFLAGS here:
     unset CFLAGS
-    oe_runmake DESTDIR="${D}" install
-
-    # remove installed volatiles
-    rm -rf ${D}${base_prefix}/run \
-        ${D}${localstatedir}/run \
-        ${D}${localstatedir}/lock \
-        ${D}${localstatedir}/log \
-        ${D}${localstatedir}/volatile \
-        ${D}${localstatedir}/lib/xen
-
-    VOLATILE_DIRS=" \
-        ${base_prefix}/run/xenstored \
-        ${base_prefix}/run/xend \
-        ${base_prefix}/run/xend/boot \
-        ${base_prefix}/run/xen \
-        ${localstatedir}/log/xen \
-        ${localstatedir}/lock/xen \
-        ${localstatedir}/lock/subsys \
-        ${localstatedir}/lib/xen \
-        "
-
-    # install volatiles using populate_volatiles mechanism
-    install -d ${D}${sysconfdir}/default/volatiles
-    for i in $VOLATILE_DIRS; do
-        echo "d root root 0755 $i none"  >> ${D}${sysconfdir}/default/volatiles/99_xen
-    done
-
-    # workaround for xendomains script which searchs sysconfig if directory exists
-    install -d ${D}${sysconfdir}/sysconfig
-    ln -sf ${sysconfdir}/default/xendomains ${D}${sysconfdir}/sysconfig/xendomains
-
-    # systemd
-    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        # install volatiles using systemd tmpfiles.d
-        install -d ${D}${sysconfdir}/tmpfiles.d
-        for i in $VOLATILE_DIRS; do
-            echo "d $i 0755 root root - -"  >> ${D}${sysconfdir}/tmpfiles.d/xen.conf
-        done
-    fi
-
-    # fixup default path to qemu-system-i386
-    sed -i 's#\(test -z "$QEMU_XEN" && QEMU_XEN=\).*$#\1"/usr/bin/qemu-system-i386"#' ${D}/etc/init.d/xencommons
-
-    if [ -e ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service ]; then
-        sed -i 's#ExecStart=.*qemu-system-i386\(.*\)$#ExecStart=/usr/bin/qemu-system-i386\1#' \
-            ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service
-    fi
-}
-
-pkg_postinst_${PN}-volatiles() {
-    if [ -z "$D" ]; then
-        if command -v systemd-tmpfiles >/dev/null; then
-            systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/xen.conf
-        elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
-            ${sysconfdir}/init.d/populate-volatile.sh update
-        fi
-    fi
-}
-
-do_deploy() {
-    install -d ${DEPLOYDIR}
-
-    if [ -f ${D}/boot/xen ]; then
-        install -m 0644 ${D}/boot/xen ${DEPLOYDIR}/xen-${MACHINE}
-    fi
-
-    if [ -f ${D}/boot/xen.gz ]; then
-        install -m 0644 ${D}/boot/xen.gz ${DEPLOYDIR}/xen-${MACHINE}.gz
-    fi
-
-    if [ -f ${D}/usr/lib64/efi/xen.efi ]; then
-        install -m 0644 ${D}/usr/lib64/efi/xen.efi ${DEPLOYDIR}/xen-${MACHINE}.efi
-    fi
-
-    # Install the flask policy in the deploy directory if it exists
-    if [ -f ${D}/boot/${FLASK_POLICY_FILE} ]; then
-        install -m 0644 ${D}/boot/${FLASK_POLICY_FILE} ${DEPLOYDIR}
-        ln -sf ${FLASK_POLICY_FILE} ${DEPLOYDIR}/xenpolicy-${MACHINE}
-    fi
-}
-
-addtask deploy after do_populate_sysroot
-
-# Enable use of menuconfig directly from bitbake and also within the devshell
-OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO"
-HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}"
-HOSTLDFLAGS = "${BUILD_LDFLAGS}"
-TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"
-do_devshell[depends] += "ncurses-native:do_populate_sysroot"
-
-KCONFIG_CONFIG_COMMAND ??= "menuconfig"
-python do_menuconfig() {
-    import shutil
-
-    try:
-        mtime = os.path.getmtime("xen/.config")
-        shutil.copy("xen/.config", "xen/.config.orig")
-    except OSError:
-        mtime = 0
-
-    oe_terminal("${SHELL} -c \"cd xen; XEN_CONFIG_EXPERT=y make %s; if [ \$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),
-        d.getVar('PN') + ' Configuration', d)
-
-    try:
-        newmtime = os.path.getmtime("xen/.config")
-    except OSError:
-        newmtime = 0
-
-    if newmtime > mtime:
-        bb.note("Configuration changed, recompile will be forced")
-        bb.build.write_taint('do_compile', d)
 }
-do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
-do_menuconfig[nostamp] = "1"
-do_menuconfig[dirs] = "${B}"
-addtask menuconfig after do_configure
diff --git a/recipes-extended/xen/xen_4.12.2.bb b/recipes-extended/xen/xen_4.12.2.bb
deleted file mode 100644
index affeb4a..0000000
--- a/recipes-extended/xen/xen_4.12.2.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-require xen.inc
-
-SRC_URI = " \
-    https://downloads.xenproject.org/release/xen/${PV}/xen-${PV}.tar.gz \
-    file://0001-python-pygrub-pass-DISTUTILS-xen.4.12.patch \
-    "
-
-SRC_URI[md5sum] = "57084e3f55bbec063d38b464e1b7e4f2"
-SRC_URI[sha256sum] = "1c75cbe728dfabf02b7f9a17ce96ee7d202d2fd4b4689490018d3a28b63f9fa3"
-
-S = "${WORKDIR}/xen-${PV}"
diff --git a/recipes-extended/xen/xen_git.bb b/recipes-extended/xen/xen_git.bb
index 5f950e6..a7475ac 100644
--- a/recipes-extended/xen/xen_git.bb
+++ b/recipes-extended/xen/xen_git.bb
@@ -1,18 +1,15 @@
-require xen.inc
+SRCREV ?= "a5fcafbfbee55261853fba07149c1c795f2baf58"
+
+XEN_REL ?= "4.12"
+XEN_BRANCH ?= "stable-${XEN_REL}"
 
-SRCREV ?= "cb70a26f78848fe45f593f7ebc9cfaac760a791b"
+SRC_URI = "git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH}"
 
-XEN_REL = "4.13"
-XEN_BRANCH = "staging"
-FLASK_POLICY_FILE = "xenpolicy-${XEN_REL}-unstable"
+LIC_FILES_CHKSUM ?= "file://COPYING;md5=bbb4b1bdc2c3b6743da3c39d03249095"
 
 PV = "${XEN_REL}+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
-SRC_URI = " \
-    git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
-    file://0001-python-pygrub-pass-DISTUTILS-xen.4.12.patch \
-    "
-
-DEFAULT_PREFERENCE = "-1"
+require xen.inc
+require xen-hypervisor.inc
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 11/22] xen-tools: move xentrace_setmask into the xentrace package
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (9 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 10/22] xen: separate recipes for hypervisor and tools; switch to git as source Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 12/22] xen: add seabios to RRECOMMENDS of xen-tools when HVM-enabled Christopher Clark
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/xen-tools.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
index f37968b..e012020 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -544,6 +544,7 @@ FILES_${PN}-xentrace = "\
     ${bindir}/xenalyze \
     ${sbindir}/xentrace \
     ${sbindir}/xentrace_setsize \
+    ${sbindir}/xentrace_setmask \
     "
 
 FILES_${PN}-xen-watchdog = "\
@@ -578,7 +579,6 @@ FILES_${PN}-xm-examples = "\
 
 FILES_${PN}-xenmon = "\
     ${sbindir}/xenbaked \
-    ${sbindir}/xentrace_setmask \
     ${sbindir}/xenmon.py \
     ${sbindir}/xenmon \
     "
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 12/22] xen: add seabios to RRECOMMENDS of xen-tools when HVM-enabled
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (10 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 11/22] xen-tools: move xentrace_setmask into the xentrace package Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 13/22] xen-image-minimal: add kernel-module-tun for HVM guest networking Christopher Clark
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Launching HVM guest VMs requires a BIOS firmware binary.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/xen-tools.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
index e012020..5b0a339 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -29,6 +29,7 @@ RDEPENDS_${PN} = "\
 RDEPENDS_${PN}-dev = ""
 
 RRECOMMENDS_${PN} = " \
+    ${@bb.utils.contains('PACKAGECONFIG', 'hvm', 'seabios', '', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'externalblktap', '', '${BLKTAP_RRECOMMENDS}', d)} \
     ${PN}-flask \
     ${PN}-hvmloader \
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 13/22] xen-image-minimal: add kernel-module-tun for HVM guest networking
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (11 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 12/22] xen: add seabios to RRECOMMENDS of xen-tools when HVM-enabled Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 14/22] xen-tools: change globbing to fix syntax highlighting Christopher Clark
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Xen HVM guests are only on x86 platforms so add the module via overrides.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/images/xen-image-minimal.bb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/recipes-extended/images/xen-image-minimal.bb b/recipes-extended/images/xen-image-minimal.bb
index 63a1086..c98314e 100644
--- a/recipes-extended/images/xen-image-minimal.bb
+++ b/recipes-extended/images/xen-image-minimal.bb
@@ -16,6 +16,10 @@ IMAGE_INSTALL += " \
     qemu \
     "
 
+# Networking for HVM-mode guests (x86/64 only) requires the tun kernel module
+IMAGE_INSTALL_append_x86    = "kernel-module-tun"
+IMAGE_INSTALL_append_x86-64 = "kernel-module-tun"
+
 # Linux kernel option CONFIG_XEN_PCIDEV_BACKEND depends on X86
 XEN_PCIBACK_MODULE = ""
 XEN_PCIBACK_MODULE_x86    = "kernel-module-xen-pciback"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 14/22] xen-tools: change globbing to fix syntax highlighting
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (12 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 13/22] xen-image-minimal: add kernel-module-tun for HVM guest networking Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 15/22] xen, xen-tools: update recipes for python3 Christopher Clark
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

A text editor can interpret /* as the beginning of a comment
and then fail to find the matching */ it expects as a terminator.
This causes it to mishighlight the rest of the file. Avoid this
by using a different matching pattern.

Fixes an annoyance when editing the file. No functional change intended.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/xen-tools.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
index 5b0a339..e166c74 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -197,7 +197,7 @@ FILES_${PN}-dbg += "\
     ${libdir}/fs/zfs/.debug \
     ${libdir}/fs/reiserfs/.debug \
     ${libdir}/fs/iso9660/.debug \
-    ${libdir}/fs/*/.debug \
+    ${libdir}/fs/**/.debug \
     ${sbindir}/.debug \
     ${libdir}exec/.debug \
     ${libdir}/xen/libexec/.debug \
@@ -346,8 +346,8 @@ FILES_${PN}-libfsimage-dev = " \
     "
 
 FILES_${PN}-fsimage = " \
-    ${libdir}/fs/*/*fsimage.so \
-    ${libdir}/xenfsimage/*/fsimage.so \
+    ${libdir}/fs/**/[a-z]*fsimage.so \
+    ${libdir}/xenfsimage/**/fsimage.so \
     "
 
 FILES_${PN}-init-xenstore-dom = "${libdir}/xen/bin/init-xenstore-domain"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 15/22] xen, xen-tools: update recipes for python3
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (13 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 14/22] xen-tools: change globbing to fix syntax highlighting Christopher Clark
@ 2020-02-26  0:15 ` Christopher Clark
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 16/22] xen, xen-tools: separate COMPATIBLE_HOST for hypervisor and tools Christopher Clark
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:15 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Adds patches for packaged scripts to enable deployment with python3
where they have been ported to python 3 upstream.

setuptools3 inherits distutils3 which modifies ${B}, so cd ${S} is
needed in the do_configure, do_compile and do_install steps.

Remove python 2 dependency from the Xen recipes by adding a new
separate recipe, xen-python2, for packaging the remaining optional
scripts which are yet to be ported to python 3. Package naming in
the separate recipe is chosen to support transition back into the
xen-tools recipe if the scripts are ported later.

Use RSUGGESTS to support inclusion of the xen-python2 scripts in
images that include python 2.

Drop the remus package python dependency since the script was removed
in 2014: commit 5b66f84e37a45038f9e5dae7a5768a5525d1e6ba

Add python3 RDEPENDS needed to run xenmon.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 ...ython-pygrub-pass-DISTUTILS-xen.4.12.patch |   7 +-
 .../files/xen-tools-libxl-gentypes-py3.patch  | 140 +++++
 ...tools-pygrub-change-tabs-into-spaces.patch |  40 ++
 ...-python-scripts-work-with-2.6-and-up.patch | 529 ++++++++++++++++++
 .../xen/files/xen-tools-pygrub-py3.patch      | 233 ++++++++
 ...ls-python-fix-Wsign-compare-warnings.patch | 136 +++++
 ...n-tools-update-python-scripts-to-py3.patch | 140 +++++
 recipes-extended/xen/xen-hypervisor.inc       |   4 +-
 recipes-extended/xen/xen-python2.bb           |  68 +++
 recipes-extended/xen/xen-tools.inc            |  57 +-
 recipes-extended/xen/xen-tools_git.bb         |   6 +
 recipes-extended/xen/xen.inc                  |  11 +-
 12 files changed, 1344 insertions(+), 27 deletions(-)
 create mode 100644 recipes-extended/xen/files/xen-tools-libxl-gentypes-py3.patch
 create mode 100644 recipes-extended/xen/files/xen-tools-pygrub-change-tabs-into-spaces.patch
 create mode 100644 recipes-extended/xen/files/xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch
 create mode 100644 recipes-extended/xen/files/xen-tools-pygrub-py3.patch
 create mode 100644 recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch
 create mode 100644 recipes-extended/xen/files/xen-tools-update-python-scripts-to-py3.patch
 create mode 100644 recipes-extended/xen/xen-python2.bb

diff --git a/recipes-extended/xen/files/0001-python-pygrub-pass-DISTUTILS-xen.4.12.patch b/recipes-extended/xen/files/0001-python-pygrub-pass-DISTUTILS-xen.4.12.patch
index 6504d86..96e907d 100644
--- a/recipes-extended/xen/files/0001-python-pygrub-pass-DISTUTILS-xen.4.12.patch
+++ b/recipes-extended/xen/files/0001-python-pygrub-pass-DISTUTILS-xen.4.12.patch
@@ -13,11 +13,14 @@ Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
 Forward-ported to Xen 4.12.0
 Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
 
+Modified to support pygrub installation with python 3
+Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
+
 diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
 index 3063c49..513314b 100644
 --- a/tools/pygrub/Makefile
 +++ b/tools/pygrub/Makefile
-@@ -10,14 +10,15 @@ INSTALL_LOG = build/installed_files.txt
+@@ -10,14 +10,17 @@ INSTALL_LOG = build/installed_files.txt
  all: build
  .PHONY: build
  build:
@@ -32,6 +35,8 @@ index 3063c49..513314b 100644
 -		 --root="$(DESTDIR)" --install-scripts=$(LIBEXEC_BIN) --force
 +		 --root="$(DESTDIR)" --install-scripts=$(LIBEXEC_BIN) --force \
 +		 $(DISTUTILS_INSTALL_ARGS)
++	rm -f $(DESTDIR)/$(LIBEXEC_BIN)/pygrub
++	$(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(LIBEXEC_BIN)/pygrub
  	set -e; if [ $(bindir) != $(LIBEXEC_BIN) -a \
  	             "`readlink -f $(DESTDIR)/$(bindir)`" != \
  	             "`readlink -f $(LIBEXEC_BIN)`" ]; then \
diff --git a/recipes-extended/xen/files/xen-tools-libxl-gentypes-py3.patch b/recipes-extended/xen/files/xen-tools-libxl-gentypes-py3.patch
new file mode 100644
index 0000000..2399786
--- /dev/null
+++ b/recipes-extended/xen/files/xen-tools-libxl-gentypes-py3.patch
@@ -0,0 +1,140 @@
+From 660d2dd863802ef464c90b32f187cb65861f8185 Mon Sep 17 00:00:00 2001
+From: Wei Liu <wei.liu2@citrix.com>
+Date: Thu, 7 Mar 2019 12:33:38 +0000
+Subject: [PATCH] libxl: make python scripts work with python 2.6 and up
+
+Go through transformations suggested by 2to3 and pick the necessary
+ones.
+
+Signed-off-by: Wei Liu <wei.liu2@citrix.com>
+Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
+---
+ tools/libxl/gentest.py  |  4 +++-
+ tools/libxl/gentypes.py | 12 +++++++-----
+ tools/libxl/idl.py      | 15 ++++++++-------
+ 3 files changed, 18 insertions(+), 13 deletions(-)
+
+diff --git a/tools/libxl/gentest.py b/tools/libxl/gentest.py
+index 989959fc68..1cc7eebc82 100644
+--- a/tools/libxl/gentest.py
++++ b/tools/libxl/gentest.py
+@@ -1,5 +1,7 @@
+ #!/usr/bin/python
+ 
++from __future__ import print_function
++
+ import os
+ import sys
+ import re
+@@ -86,7 +88,7 @@ def gen_rand_init(ty, v, indent = "    ", parent = None):
+ 
+ if __name__ == '__main__':
+     if len(sys.argv) < 3:
+-        print >>sys.stderr, "Usage: gentest.py <idl> <implementation>"
++        print("Usage: gentest.py <idl> <implementation>", file=sys.stderr)
+         sys.exit(1)
+ 
+     random.seed(os.getenv('LIBXL_TESTIDL_SEED'))
+diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
+index 88e5c5f30e..6417c9dd8c 100644
+--- a/tools/libxl/gentypes.py
++++ b/tools/libxl/gentypes.py
+@@ -1,5 +1,7 @@
+ #!/usr/bin/python
+ 
++from __future__ import print_function
++
+ import sys
+ import re
+ 
+@@ -576,14 +578,14 @@ def libxl_C_enum_from_string(ty, str, e, indent = "    "):
+ 
+ if __name__ == '__main__':
+     if len(sys.argv) != 6:
+-        print >>sys.stderr, "Usage: gentypes.py <idl> <header> <header-private> <header-json> <implementation>"
++        print("Usage: gentypes.py <idl> <header> <header-private> <header-json> <implementation>", file=sys.stderr)
+         sys.exit(1)
+ 
+     (_, idlname, header, header_private, header_json, impl) = sys.argv
+ 
+     (builtins,types) = idl.parse(idlname)
+ 
+-    print "outputting libxl type definitions to %s" % header
++    print("outputting libxl type definitions to %s" % header)
+ 
+     f = open(header, "w")
+ 
+@@ -633,7 +635,7 @@ if __name__ == '__main__':
+     f.write("""#endif /* %s */\n""" % (header_define))
+     f.close()
+ 
+-    print "outputting libxl JSON definitions to %s" % header_json
++    print("outputting libxl JSON definitions to %s" % header_json)
+ 
+     f = open(header_json, "w")
+ 
+@@ -657,7 +659,7 @@ if __name__ == '__main__':
+     f.write("""#endif /* %s */\n""" % header_json_define)
+     f.close()
+ 
+-    print "outputting libxl type internal definitions to %s" % header_private
++    print("outputting libxl type internal definitions to %s" % header_private)
+ 
+     f = open(header_private, "w")
+ 
+@@ -683,7 +685,7 @@ if __name__ == '__main__':
+     f.write("""#endif /* %s */\n""" % header_json_define)
+     f.close()
+ 
+-    print "outputting libxl type implementations to %s" % impl
++    print("outputting libxl type implementations to %s" % impl)
+ 
+     f = open(impl, "w")
+     f.write("""
+diff --git a/tools/libxl/idl.py b/tools/libxl/idl.py
+index 2a7f3c44fe..d7367503b4 100644
+--- a/tools/libxl/idl.py
++++ b/tools/libxl/idl.py
+@@ -1,3 +1,5 @@
++from __future__ import print_function
++
+ import sys
+ 
+ PASS_BY_VALUE = 1
+@@ -11,7 +13,7 @@ DIR_BOTH = 3
+ _default_namespace = ""
+ def namespace(s):
+     if type(s) != str:
+-        raise TypeError, "Require a string for the default namespace."
++        raise TypeError("Require a string for the default namespace.")
+     global _default_namespace
+     _default_namespace = s
+ 
+@@ -346,7 +348,7 @@ class OrderedDict(dict):
+         return [(x,self[x]) for x in self.__ordered]
+ 
+ def parse(f):
+-    print >>sys.stderr, "Parsing %s" % f
++    print("Parsing %s" % f, file=sys.stderr)
+ 
+     globs = {}
+     locs = OrderedDict()
+@@ -362,11 +364,10 @@ def parse(f):
+             globs[n] = t
+ 
+     try:
+-        execfile(f, globs, locs)
+-    except SyntaxError,e:
+-        raise SyntaxError, \
+-              "Errors were found at line %d while processing %s:\n\t%s"\
+-              %(e.lineno,f,e.text)
++        exec(compile(open(f).read(), f, 'exec'), globs, locs)
++    except SyntaxError as e:
++        raise SyntaxError("Errors were found at line %d while processing %s:\n\t%s"
++                          % (e.lineno, f, e.text))
+ 
+     types = [t for t in locs.ordered_values() if isinstance(t,Type)]
+ 
+-- 
+2.17.1
+
diff --git a/recipes-extended/xen/files/xen-tools-pygrub-change-tabs-into-spaces.patch b/recipes-extended/xen/files/xen-tools-pygrub-change-tabs-into-spaces.patch
new file mode 100644
index 0000000..d913be2
--- /dev/null
+++ b/recipes-extended/xen/files/xen-tools-pygrub-change-tabs-into-spaces.patch
@@ -0,0 +1,40 @@
+From b9e1368af14ded6aee3bdf64e8329628b16291ff Mon Sep 17 00:00:00 2001
+From: Wei Liu <wei.liu2@citrix.com>
+Date: Mon, 11 Mar 2019 12:55:29 +0000
+Subject: [PATCH] pygrub: change tabs into spaces
+
+Not sure why Python 2 never complained, but Python 3 does.
+
+Change tabs to spaces.
+
+Signed-off-by: Wei Liu <wei.liu2@citrix.com>
+Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
+---
+ tools/pygrub/src/pygrub | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
+index 52a8965ad9..1189b1ca48 100755
+--- a/tools/pygrub/src/pygrub
++++ b/tools/pygrub/src/pygrub
+@@ -858,7 +858,7 @@ if __name__ == "__main__":
+             output_directory = a
+ 
+     if debug:
+-	logging.basicConfig(level=logging.DEBUG)
++        logging.basicConfig(level=logging.DEBUG)
+ 
+ 
+     try:
+@@ -917,7 +917,7 @@ if __name__ == "__main__":
+             # IOErrors raised by fsimage.open
+             # RuntimeErrors raised by run_grub if no menu.lst present
+             if debug:
+-		traceback.print_exc()
++                traceback.print_exc()
+             fs = None
+             continue
+ 
+-- 
+2.17.1
+
diff --git a/recipes-extended/xen/files/xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch b/recipes-extended/xen/files/xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch
new file mode 100644
index 0000000..f4cbb67
--- /dev/null
+++ b/recipes-extended/xen/files/xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch
@@ -0,0 +1,529 @@
+From 0aabd89dcfee9ee2a6caaa2ec7a475daf5cada53 Mon Sep 17 00:00:00 2001
+From: Wei Liu <wei.liu2@citrix.com>
+Date: Thu, 7 Mar 2019 12:45:47 +0000
+Subject: [PATCH] pygrub: make python scripts work with 2.6 and up
+
+Run 2to3 and pick the sensible suggestions.
+
+Import print_function and absolute_import so 2.6 can work.
+
+There has never been a curses.wrapper module according to 2.x and 3.x
+doc, only a function, so "import curses.wrapper" is not correct. It
+happened to work because 2.x implemented a (undocumented) module.
+
+We only need to import curses to make curses.wrapper available to
+pygrub.
+
+Signed-off-by: Wei Liu <wei.liu2@citrix.com>
+Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
+---
+ tools/pygrub/src/ExtLinuxConf.py | 19 +++++----
+ tools/pygrub/src/GrubConf.py     | 39 ++++++++++--------
+ tools/pygrub/src/LiloConf.py     | 19 +++++----
+ tools/pygrub/src/pygrub          | 71 ++++++++++++++++----------------
+ 4 files changed, 78 insertions(+), 70 deletions(-)
+
+diff --git a/tools/pygrub/src/ExtLinuxConf.py b/tools/pygrub/src/ExtLinuxConf.py
+index d1789bf020..9fd635b9cf 100644
+--- a/tools/pygrub/src/ExtLinuxConf.py
++++ b/tools/pygrub/src/ExtLinuxConf.py
+@@ -10,9 +10,11 @@
+ # along with this program; If not, see <http://www.gnu.org/licenses/>.
+ #
+ 
++from __future__ import print_function, absolute_import
++
+ import sys, re, os
+ import logging
+-import GrubConf
++from . import GrubConf
+ 
+ class ExtLinuxImage(object):
+     def __init__(self, lines, path):
+@@ -32,7 +34,8 @@ class ExtLinuxImage(object):
+         self.lines = []
+         self.path = path
+         self.root = ""
+-        map(self.set_from_line, lines)
++        for line in lines:
++            self.set_from_line(line)
+ 
+     def set_from_line(self, line, replace = None):
+         (com, arg) = GrubConf.grub_exact_split(line, 2)
+@@ -67,7 +70,7 @@ class ExtLinuxImage(object):
+                         setattr(self, "initrd", a.replace("initrd=", ""))
+                         arg = arg.replace(a, "")
+ 
+-        if com is not None and self.commands.has_key(com):
++        if com is not None and com in self.commands:
+             if self.commands[com] is not None:
+                 setattr(self, self.commands[com], re.sub('^"(.+)"$', r"\1", arg.strip()))
+             else:
+@@ -136,7 +139,7 @@ class ExtLinuxConfigFile(object):
+     def parse(self, buf = None):
+         if buf is None:
+             if self.filename is None:
+-                raise ValueError, "No config file defined to parse!"
++                raise ValueError("No config file defined to parse!")
+ 
+             f = open(self.filename, 'r')
+             lines = f.readlines()
+@@ -167,7 +170,7 @@ class ExtLinuxConfigFile(object):
+ 
+             (com, arg) = GrubConf.grub_exact_split(l, 2)
+             com = com.lower()
+-            if self.commands.has_key(com):
++            if com in self.commands:
+                 if self.commands[com] is not None:
+                     setattr(self, self.commands[com], arg.strip())
+                 else:
+@@ -207,8 +210,8 @@ class ExtLinuxConfigFile(object):
+         
+ if __name__ == "__main__":
+     if len(sys.argv) < 2:
+-        raise RuntimeError, "Need a configuration file to read"
++        raise RuntimeError("Need a configuration file to read")
+     g = ExtLinuxConfigFile(sys.argv[1])
+     for i in g.images:
+-        print i
+-    print g.default
++        print(i)
++    print(g.default)
+diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py
+index dc810d55cb..f8d3799dc0 100644
+--- a/tools/pygrub/src/GrubConf.py
++++ b/tools/pygrub/src/GrubConf.py
+@@ -12,6 +12,8 @@
+ # along with this program; If not, see <http://www.gnu.org/licenses/>.
+ #
+ 
++from __future__ import print_function, absolute_import
++
+ import os, sys
+ import logging
+ import re
+@@ -44,7 +46,7 @@ def get_path(s):
+         return (None, s)
+     idx = s.find(')')
+     if idx == -1:
+-        raise ValueError, "Unable to find matching ')'"
++        raise ValueError("Unable to find matching ')'")
+     d = s[:idx]
+     return (GrubDiskPart(d), s[idx + 1:])
+ 
+@@ -100,7 +102,8 @@ class _GrubImage(object):
+                 "  initrd: %s\n" %(self.title, self.root, self.kernel,
+                                    self.args, self.initrd))
+     def _parse(self, lines):
+-        map(self.set_from_line, lines)
++        for line in lines:
++            self.set_from_line(line)
+ 
+     def reset(self, lines):
+         self._root = self._initrd = self._kernel = self._args = None
+@@ -141,7 +144,7 @@ class GrubImage(_GrubImage):
+     def set_from_line(self, line, replace = None):
+         (com, arg) = grub_exact_split(line, 2)
+ 
+-        if self.commands.has_key(com):
++        if com in self.commands:
+             if self.commands[com] is not None:
+                 setattr(self, self.commands[com], arg.strip())
+             else:
+@@ -177,7 +180,7 @@ class _GrubConfigFile(object):
+             self.parse()
+ 
+     def parse(self, buf = None):
+-        raise RuntimeError, "unimplemented parse function"   
++        raise RuntimeError("unimplemented parse function")
+ 
+     def hasPasswordAccess(self):
+         return self.passwordAccess
+@@ -201,7 +204,7 @@ class _GrubConfigFile(object):
+                 import crypt
+                 if crypt.crypt(password, pwd[1]) == pwd[1]:
+                     return True
+-            except Exception, e:
++            except Exception as e:
+                 self.passExc = "Can't verify password: %s" % str(e)
+                 return False
+ 
+@@ -213,7 +216,7 @@ class _GrubConfigFile(object):
+ 
+     def set(self, line):
+         (com, arg) = grub_exact_split(line, 2)
+-        if self.commands.has_key(com):
++        if com in self.commands:
+             if self.commands[com] is not None:
+                 setattr(self, self.commands[com], arg.strip())
+             else:
+@@ -233,7 +236,7 @@ class _GrubConfigFile(object):
+             self._default = val
+ 
+         if self._default < 0:
+-            raise ValueError, "default must be positive number"
++            raise ValueError("default must be positive number")
+     default = property(_get_default, _set_default)
+ 
+     def set_splash(self, val):
+@@ -265,7 +268,7 @@ class GrubConfigFile(_GrubConfigFile):
+     def parse(self, buf = None):
+         if buf is None:
+             if self.filename is None:
+-                raise ValueError, "No config file defined to parse!"
++                raise ValueError("No config file defined to parse!")
+ 
+             f = open(self.filename, 'r')
+             lines = f.readlines()
+@@ -296,7 +299,7 @@ class GrubConfigFile(_GrubConfigFile):
+                 continue
+ 
+             (com, arg) = grub_exact_split(l, 2)
+-            if self.commands.has_key(com):
++            if com in self.commands:
+                 if self.commands[com] is not None:
+                     setattr(self, self.commands[com], arg.strip())
+                 else:
+@@ -328,7 +331,7 @@ class Grub2Image(_GrubImage):
+         if com == "set":
+             (com,arg) = grub2_handle_set(arg)
+             
+-        if self.commands.has_key(com):
++        if com in self.commands:
+             if self.commands[com] is not None:
+                 setattr(self, self.commands[com], arg.strip())
+             else:
+@@ -364,7 +367,7 @@ class Grub2ConfigFile(_GrubConfigFile):
+     def parse(self, buf = None):
+         if buf is None:
+             if self.filename is None:
+-                raise ValueError, "No config file defined to parse!"
++                raise ValueError("No config file defined to parse!")
+ 
+             f = open(self.filename, 'r')
+             lines = f.readlines()
+@@ -398,7 +401,7 @@ class Grub2ConfigFile(_GrubConfigFile):
+             title_match = re.match('^menuentry ["\'](.*?)["\'] (.*){', l)
+             if title_match:
+                 if img is not None:
+-                    raise RuntimeError, "syntax error: cannot nest menuentry (%d %s)" % (len(img),img)
++                    raise RuntimeError("syntax error: cannot nest menuentry (%d %s)" % (len(img),img))
+                 img = []
+                 title = title_match.group(1)
+                 continue
+@@ -413,7 +416,7 @@ class Grub2ConfigFile(_GrubConfigFile):
+                         menu_level -= 1
+                         continue
+                     else:
+-                        raise RuntimeError, "syntax error: closing brace without menuentry"
++                        raise RuntimeError("syntax error: closing brace without menuentry")
+ 
+                 self.add_image(Grub2Image(title, img))
+                 img = None
+@@ -428,7 +431,7 @@ class Grub2ConfigFile(_GrubConfigFile):
+             if com == "set":
+                 (com,arg) = grub2_handle_set(arg)
+                 
+-            if self.commands.has_key(com):
++            if com in self.commands:
+                 if self.commands[com] is not None:
+                     arg_strip = arg.strip()
+                     if arg_strip == "${saved_entry}" or arg_strip == "${next_entry}":
+@@ -443,7 +446,7 @@ class Grub2ConfigFile(_GrubConfigFile):
+                 logging.warning("Unknown directive %s" %(com,))
+             
+         if img is not None:
+-            raise RuntimeError, "syntax error: end of file with open menuentry(%d %s)" % (len(img),img)
++            raise RuntimeError("syntax error: end of file with open menuentry(%d %s)" % (len(img),img))
+ 
+         if self.hasPassword():
+             self.setPasswordAccess(False)
+@@ -462,12 +465,12 @@ class Grub2ConfigFile(_GrubConfigFile):
+         
+ if __name__ == "__main__":
+     if len(sys.argv) < 3:
+-        raise RuntimeError, "Need a grub version (\"grub\" or \"grub2\") and a grub.conf or grub.cfg to read"
++        raise RuntimeError('Need a grub version ("grub" or "grub2") and a grub.conf or grub.cfg to read')
+     if sys.argv[1] == "grub":
+         g = GrubConfigFile(sys.argv[2])
+     elif sys.argv[1] == "grub2":
+         g = Grub2ConfigFile(sys.argv[2])
+     else:
+-        raise RuntimeError, "Unknown config type %s" % sys.argv[1]
++        raise RuntimeError("Unknown config type %s" % sys.argv[1])
+     for i in g.images:
+-        print i #, i.title, i.root, i.kernel, i.args, i.initrd
++        print(i) #, i.title, i.root, i.kernel, i.args, i.initrd
+diff --git a/tools/pygrub/src/LiloConf.py b/tools/pygrub/src/LiloConf.py
+index 2cb649f115..e3bfcb5244 100644
+--- a/tools/pygrub/src/LiloConf.py
++++ b/tools/pygrub/src/LiloConf.py
+@@ -2,9 +2,11 @@
+ #LiloConf.py
+ #
+ 
++from __future__ import print_function, absolute_import
++
+ import sys, re, os
+ import logging
+-import GrubConf
++from . import GrubConf
+ 
+ class LiloImage(object):
+     def __init__(self, lines, path):
+@@ -24,12 +26,13 @@ class LiloImage(object):
+         self.lines = []
+         self.path = path
+         self.root = ""
+-        map(self.set_from_line, lines)
++        for line in lines:
++            self.set_from_line(line)
+ 
+     def set_from_line(self, line, replace = None):
+         (com, arg) = GrubConf.grub_exact_split(line, 2)
+ 
+-        if self.commands.has_key(com):
++        if com in self.commands:
+             if self.commands[com] is not None:
+                 setattr(self, self.commands[com], re.sub('^"(.+)"$', r"\1", arg.strip()))
+             else:
+@@ -97,7 +100,7 @@ class LiloConfigFile(object):
+     def parse(self, buf = None):
+         if buf is None:
+             if self.filename is None:
+-                raise ValueError, "No config file defined to parse!"
++                raise ValueError("No config file defined to parse!")
+ 
+             f = open(self.filename, 'r')
+             lines = f.readlines()
+@@ -127,7 +130,7 @@ class LiloConfigFile(object):
+                 continue
+ 
+             (com, arg) = GrubConf.grub_exact_split(l, 2)
+-            if self.commands.has_key(com):
++            if com in self.commands:
+                 if self.commands[com] is not None:
+                     setattr(self, self.commands[com], arg.strip())
+                 else:
+@@ -170,8 +173,8 @@ class LiloConfigFile(object):
+ 
+ if __name__ == "__main__":
+     if len(sys.argv) < 2:
+-        raise RuntimeError, "Need a lilo.conf to read"
++        raise RuntimeError("Need a lilo.conf to read")
+     g = LiloConfigFile(sys.argv[1])
+     for i in g.images:
+-        print i #, i.title, i.root, i.kernel, i.args, i.initrd
+-    print g.default
++        print(i) #, i.title, i.root, i.kernel, i.args, i.initrd
++    print(g.default)
+diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
+index 1189b1ca48..dbdce315c6 100755
+--- a/tools/pygrub/src/pygrub
++++ b/tools/pygrub/src/pygrub
+@@ -12,13 +12,15 @@
+ # along with this program; If not, see <http://www.gnu.org/licenses/>.
+ #
+ 
++from __future__ import print_function
++
+ import os, sys, string, struct, tempfile, re, traceback, stat, errno
+ import copy
+ import logging
+ import platform
+ import xen.lowlevel.xc
+ 
+-import curses, _curses, curses.wrapper, curses.textpad, curses.ascii
++import curses, _curses, curses.textpad, curses.ascii
+ import getopt
+ 
+ import xenfsimage
+@@ -77,7 +79,7 @@ def get_solaris_slice(file, offset):
+     buf = os.read(fd, 512)
+     os.close(fd)
+     if struct.unpack("<H", buf[508:510])[0] != DKL_MAGIC:
+-        raise RuntimeError, "Invalid disklabel magic"
++        raise RuntimeError("Invalid disklabel magic")
+ 
+     nslices = struct.unpack("<H", buf[30:32])[0]
+ 
+@@ -88,7 +90,7 @@ def get_solaris_slice(file, offset):
+         if slicetag == V_ROOT:
+             return slicesect * SECTOR_SIZE
+ 
+-    raise RuntimeError, "No root slice found"      
++    raise RuntimeError("No root slice found")
+ 
+ def get_fs_offset_gpt(file):
+     fd = os.open(file, os.O_RDONLY)
+@@ -423,20 +425,17 @@ class Grub:
+         we're being given a raw config file rather than a disk image."""
+         
+         if not os.access(fn, os.R_OK):
+-            raise RuntimeError, "Unable to access %s" %(fn,)
++            raise RuntimeError("Unable to access %s" %(fn,))
+ 
+-        cfg_list = map(lambda x: (x,grub.GrubConf.Grub2ConfigFile),
+-                       ["/boot/grub/grub.cfg", "/grub/grub.cfg",
+-                        "/boot/grub2/grub.cfg", "/grub2/grub.cfg"]) + \
+-                   map(lambda x: (x,grub.ExtLinuxConf.ExtLinuxConfigFile),
+-                       ["/boot/isolinux/isolinux.cfg",
++        cfg_list = [(x,grub.GrubConf.Grub2ConfigFile) for x in ["/boot/grub/grub.cfg", "/grub/grub.cfg",
++                        "/boot/grub2/grub.cfg", "/grub2/grub.cfg"]] + \
++                   [(x,grub.ExtLinuxConf.ExtLinuxConfigFile) for x in ["/boot/isolinux/isolinux.cfg",
+                         "/boot/extlinux/extlinux.conf",
+                         "/boot/extlinux.conf",
+                         "/extlinux/extlinux.conf",
+-                        "/extlinux.conf"]) + \
+-                   map(lambda x: (x,grub.GrubConf.GrubConfigFile),
+-                       ["/boot/grub/menu.lst", "/boot/grub/grub.conf",
+-                        "/grub/menu.lst", "/grub/grub.conf"])
++                        "/extlinux.conf"]] + \
++                   [(x,grub.GrubConf.GrubConfigFile) for x in ["/boot/grub/menu.lst", "/boot/grub/grub.conf",
++                        "/grub/menu.lst", "/grub/grub.conf"]]
+ 
+         if not fs:
+             # set the config file and parse it
+@@ -448,12 +447,12 @@ class Grub:
+ 
+         for f,parser in cfg_list:
+             if fs.file_exists(f):
+-                print >>sys.stderr, "Using %s to parse %s" % (parser,f)
++                print("Using %s to parse %s" % (parser,f), file=sys.stderr)
+                 self.cf = parser()
+                 self.cf.filename = f
+                 break
+         if self.__dict__.get('cf', None) is None:
+-            raise RuntimeError, "couldn't find bootloader config file in the image provided."
++            raise RuntimeError("couldn't find bootloader config file in the image provided.")
+         f = fs.open_file(self.cf.filename)
+         # limit read size to avoid pathological cases
+         buf = f.read(FS_READ_MAX)
+@@ -628,11 +627,11 @@ def run_grub(file, entry, fs, cfg_args):
+     if list_entries:
+         for i in range(len(g.cf.images)):
+             img = g.cf.images[i]
+-            print "title: %s" % img.title
+-            print "  root: %s" % img.root
+-            print "  kernel: %s" % img.kernel[1]
+-            print "  args: %s" % img.args
+-            print "  initrd: %s" % img.initrd[1]
++            print("title: %s" % img.title)
++            print("  root: %s" % img.root)
++            print("  kernel: %s" % img.kernel[1])
++            print("  args: %s" % img.args)
++            print("  initrd: %s" % img.initrd[1])
+ 
+     if interactive and not list_entries:
+         curses.wrapper(run_main)
+@@ -646,7 +645,7 @@ def run_grub(file, entry, fs, cfg_args):
+            sel = idx
+ 
+     if sel == -1:
+-        print "No kernel image selected!"
++        print("No kernel image selected!")
+         sys.exit(1)
+ 
+     try:
+@@ -731,7 +730,7 @@ def format_sxp(kernel, ramdisk, args):
+ def format_simple(kernel, ramdisk, args, sep):
+     for check in (kernel, ramdisk, args):
+         if check is not None and sep in check:
+-            raise RuntimeError, "simple format cannot represent delimiter-containing value"
++            raise RuntimeError("simple format cannot represent delimiter-containing value")
+     s = ("kernel %s" % kernel) + sep
+     if ramdisk:
+         s += ("ramdisk %s" % ramdisk) + sep
+@@ -744,7 +743,7 @@ if __name__ == "__main__":
+     sel = None
+     
+     def usage():
+-        print >> sys.stderr, "Usage: %s [-q|--quiet] [-i|--interactive] [-l|--list-entries] [-n|--not-really] [--output=] [--kernel=] [--ramdisk=] [--args=] [--entry=] [--output-directory=] [--output-format=sxp|simple|simple0] [--offset=] <image>" %(sys.argv[0],)
++        print("Usage: %s [-q|--quiet] [-i|--interactive] [-l|--list-entries] [-n|--not-really] [--output=] [--kernel=] [--ramdisk=] [--args=] [--entry=] [--output-directory=] [--output-format=sxp|simple|simple0] [--offset=] <image>" %(sys.argv[0],), file=sys.stderr)
+ 
+     def copy_from_image(fs, file_to_read, file_type, output_directory,
+                         not_really):
+@@ -755,8 +754,8 @@ if __name__ == "__main__":
+                 sys.exit("The requested %s file does not exist" % file_type)
+         try:
+             datafile = fs.open_file(file_to_read)
+-        except Exception, e:
+-            print >>sys.stderr, e
++        except Exception as e:
++            print(e, file=sys.stderr)
+             sys.exit("Error opening %s in guest" % file_to_read)
+         (tfd, ret) = tempfile.mkstemp(prefix="boot_"+file_type+".",
+                                       dir=output_directory)
+@@ -769,8 +768,8 @@ if __name__ == "__main__":
+                 return ret
+             try:
+                 os.write(tfd, data)
+-            except Exception, e:
+-                print >>sys.stderr, e
++            except Exception as e:
++                print(e, file=sys.stderr)
+                 os.close(tfd)
+                 os.unlink(ret)
+                 del datafile
+@@ -834,7 +833,7 @@ if __name__ == "__main__":
+             try:
+                 part_offs = [ int(a) ]
+             except ValueError:
+-                print "offset value must be an integer"
++                print("offset value must be an integer")
+                 usage()
+                 sys.exit(1)
+         elif o in ("--entry",):
+@@ -847,13 +846,13 @@ if __name__ == "__main__":
+             debug = True
+         elif o in ("--output-format",):
+             if a not in ["sxp", "simple", "simple0"]:
+-                print "unknown output format %s" % a
++                print("unknown output format %s" % a)
+                 usage()
+                 sys.exit(1)
+             output_format = a
+         elif o in ("--output-directory",):
+             if not os.path.isdir(a):
+-                print "%s is not an existing directory" % a
++                print("%s is not an existing directory" % a)
+                 sys.exit(1)
+             output_directory = a
+ 
+@@ -862,8 +861,8 @@ if __name__ == "__main__":
+ 
+ 
+     try:
+-        os.makedirs(output_directory, 0700)
+-    except OSError,e:
++        os.makedirs(output_directory, 0o700)
++    except OSError as e:
+         if (e.errno == errno.EEXIST) and os.path.isdir(output_directory):
+             pass
+         else:
+@@ -877,10 +876,10 @@ if __name__ == "__main__":
+     # debug
+     if isconfig:
+         chosencfg = run_grub(file, entry, fs, incfg["args"])
+-        print "  kernel: %s" % chosencfg["kernel"]
++        print("  kernel: %s" % chosencfg["kernel"])
+         if chosencfg["ramdisk"]:
+-            print "  initrd: %s" % chosencfg["ramdisk"]
+-        print "  args: %s" % chosencfg["args"]
++            print("  initrd: %s" % chosencfg["ramdisk"])
++        print("  args: %s" % chosencfg["args"])
+         sys.exit(0)
+ 
+     # if boot filesystem is set then pass to fsimage.open
+@@ -926,7 +925,7 @@ if __name__ == "__main__":
+ 
+     # Did looping through partitions find us a kernel?
+     if fs is None:
+-        raise RuntimeError, "Unable to find partition containing kernel"
++        raise RuntimeError("Unable to find partition containing kernel")
+ 
+     bootcfg["kernel"] = copy_from_image(fs, chosencfg["kernel"], "kernel",
+                                         output_directory, not_really)
+-- 
+2.17.1
+
diff --git a/recipes-extended/xen/files/xen-tools-pygrub-py3.patch b/recipes-extended/xen/files/xen-tools-pygrub-py3.patch
new file mode 100644
index 0000000..e486646
--- /dev/null
+++ b/recipes-extended/xen/files/xen-tools-pygrub-py3.patch
@@ -0,0 +1,233 @@
+From 83a204e6951c6358f995da3b60dd61224e9d41ac Mon Sep 17 00:00:00 2001
+From: Wei Liu <wei.liu2@citrix.com>
+Date: Tue, 5 Mar 2019 14:13:17 +0000
+Subject: [PATCH] pygrub/fsimage: make it work with python 3
+
+With the help of two porting guides and cpython source code:
+
+1. Use PyBytes to replace PyString counterparts.
+2. Use PyVarObject_HEAD_INIT.
+3. Remove usage of Py_FindMethod.
+4. Use new module initialisation routine.
+
+For #3, Py_FindMethod was removed, yet an alternative wasn't
+documented.  The code is the result of reverse-engineering cpython
+commit 6116d4a1d1
+
+https://docs.python.org/3/howto/cporting.html
+http://python3porting.com/cextensions.html
+
+Signed-off-by: Wei Liu <wei.liu2@citrix.com>
+Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
+---
+ tools/pygrub/src/fsimage/fsimage.c | 123 ++++++++++++++++-------------
+ 1 file changed, 69 insertions(+), 54 deletions(-)
+
+diff --git a/tools/pygrub/src/fsimage/fsimage.c b/tools/pygrub/src/fsimage/fsimage.c
+index 780207791c..2ebbbe35df 100644
+--- a/tools/pygrub/src/fsimage/fsimage.c
++++ b/tools/pygrub/src/fsimage/fsimage.c
+@@ -26,12 +26,6 @@
+ #include <xenfsimage.h>
+ #include <stdlib.h>
+ 
+-#if (PYTHON_API_VERSION >= 1011)
+-#define PY_PAD 0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L
+-#else
+-#define PY_PAD 0L,0L,0L,0L
+-#endif
+-
+ typedef struct fsimage_fs {
+ 	PyObject_HEAD
+ 	fsi_t *fs;
+@@ -59,12 +53,24 @@ fsimage_file_read(fsimage_file_t *file, PyObject *args, PyObject *kwargs)
+ 
+ 	bufsize = size ? size : 4096;
+ 
+-	if ((buffer = PyString_FromStringAndSize(NULL, bufsize)) == NULL)
++	buffer =
++#if PY_MAJOR_VERSION < 3
++		PyString_FromStringAndSize(NULL, bufsize);
++#else
++		PyBytes_FromStringAndSize(NULL, bufsize);
++#endif
++
++	if (buffer == NULL)
+ 		return (NULL);
+  
+ 	while (1) {
+ 		int err;
+-		void *buf = PyString_AS_STRING(buffer) + bytesread;
++		void *buf =
++#if PY_MAJOR_VERSION < 3
++			PyString_AS_STRING(buffer) + bytesread;
++#else
++			PyBytes_AS_STRING(buffer) + bytesread;
++#endif
+ 
+ 		err = fsi_pread_file(file->file, buf, bufsize,
+ 		    bytesread + offset);
+@@ -84,12 +90,20 @@ fsimage_file_read(fsimage_file_t *file, PyObject *args, PyObject *kwargs)
+ 			if (bufsize == 0)
+ 				break;
+ 		} else {
++#if PY_MAJOR_VERSION < 3
+ 			if (_PyString_Resize(&buffer, bytesread + bufsize) < 0)
++#else
++			if (_PyBytes_Resize(&buffer, bytesread + bufsize) < 0)
++#endif
+ 				return (NULL);
+ 		}
+ 	}
+ 
++#if PY_MAJOR_VERSION < 3
+ 	_PyString_Resize(&buffer, bytesread);
++#else
++	_PyBytes_Resize(&buffer, bytesread);
++#endif
+ 	return (buffer);
+ }
+ 
+@@ -106,11 +120,13 @@ static struct PyMethodDef fsimage_file_methods[] = {
+ 	{ NULL, NULL, 0, NULL }	
+ };
+ 
++#if PY_MAJOR_VERSION < 3
+ static PyObject *
+ fsimage_file_getattr(fsimage_file_t *file, char *name)
+ {
+ 	return (Py_FindMethod(fsimage_file_methods, (PyObject *)file, name));
+ }
++#endif
+ 
+ static void
+ fsimage_file_dealloc(fsimage_file_t *file)
+@@ -123,29 +139,18 @@ fsimage_file_dealloc(fsimage_file_t *file)
+ 
+ static char fsimage_file_type__doc__[] = "Filesystem image file";
+ PyTypeObject fsimage_file_type = {
+-	PyObject_HEAD_INIT(&PyType_Type)
+-	0,					/* ob_size */
+-	"xenfsimage.file",			/* tp_name */
+-	sizeof(fsimage_file_t),			/* tp_size */
+-	0,					/* tp_itemsize */
+-	(destructor) fsimage_file_dealloc, 	/* tp_dealloc */
+-	0,					/* tp_print */
+-	(getattrfunc) fsimage_file_getattr, 	/* tp_getattr */
+-	0,					/* tp_setattr */
+-	0,					/* tp_compare */
+-	0,					/* tp_repr */
+-	0,					/* tp_as_number */
+-	0,	 				/* tp_as_sequence */
+-	0,					/* tp_as_mapping */
+-	0,	   				/* tp_hash */
+-	0,					/* tp_call */
+-	0,					/* tp_str */
+-	0,					/* tp_getattro */
+-	0,					/* tp_setattro */
+-	0,					/* tp_as_buffer */
+-	Py_TPFLAGS_DEFAULT,			/* tp_flags */
+-	fsimage_file_type__doc__,
+-	PY_PAD
++	PyVarObject_HEAD_INIT(&PyType_Type, 0)
++	.tp_name = "xenfsimage.file",
++	.tp_basicsize = sizeof(fsimage_file_t),
++	.tp_dealloc = (destructor) fsimage_file_dealloc,
++#if PY_MAJOR_VERSION < 3
++	.tp_getattr = (getattrfunc) fsimage_file_getattr,
++#endif
++	.tp_flags = Py_TPFLAGS_DEFAULT,
++	.tp_doc = fsimage_file_type__doc__,
++#if PY_MAJOR_VERSION >= 3
++	.tp_methods = fsimage_file_methods,
++#endif
+ };
+ 
+ static PyObject *
+@@ -208,11 +213,13 @@ static struct PyMethodDef fsimage_fs_methods[] = {
+ 	{ NULL, NULL, 0, NULL }	
+ };
+ 
++#if PY_MAJOR_VERSION < 3
+ static PyObject *
+ fsimage_fs_getattr(fsimage_fs_t *fs, char *name)
+ {
+ 	return (Py_FindMethod(fsimage_fs_methods, (PyObject *)fs, name));
+ }
++#endif
+ 
+ static void
+ fsimage_fs_dealloc (fsimage_fs_t *fs)
+@@ -225,29 +232,18 @@ fsimage_fs_dealloc (fsimage_fs_t *fs)
+ PyDoc_STRVAR(fsimage_fs_type__doc__, "Filesystem image");
+ 
+ PyTypeObject fsimage_fs_type = {
+-	PyObject_HEAD_INIT(&PyType_Type)
+-	0,					/* ob_size */
+-	"xenfsimage.fs",			/* tp_name */
+-	sizeof(fsimage_fs_t),			/* tp_size */
+-	0,					/* tp_itemsize */
+-	(destructor) fsimage_fs_dealloc, 	/* tp_dealloc */
+-	0,					/* tp_print */
+-	(getattrfunc) fsimage_fs_getattr, 	/* tp_getattr */
+-	0,					/* tp_setattr */
+-	0,					/* tp_compare */
+-	0,					/* tp_repr */
+-	0,					/* tp_as_number */
+-	0,	 				/* tp_as_sequence */
+-	0,					/* tp_as_mapping */
+-	0,	   				/* tp_hash */
+-	0,					/* tp_call */
+-	0,					/* tp_str */
+-	0,					/* tp_getattro */
+-	0,					/* tp_setattro */
+-	0,					/* tp_as_buffer */
+-	Py_TPFLAGS_DEFAULT,			/* tp_flags */
+-	fsimage_fs_type__doc__,
+-	PY_PAD
++	PyVarObject_HEAD_INIT(&PyType_Type, 0)
++	.tp_name = "xenfsimage.fs",
++	.tp_basicsize = sizeof(fsimage_fs_t),
++	.tp_dealloc = (destructor) fsimage_fs_dealloc,
++#if PY_MAJOR_VERSION < 3
++	.tp_getattr = (getattrfunc) fsimage_fs_getattr,
++#endif
++	.tp_flags = Py_TPFLAGS_DEFAULT,
++	.tp_doc = fsimage_fs_type__doc__,
++#if PY_MAJOR_VERSION >= 3
++	.tp_methods = fsimage_fs_methods,
++#endif
+ };
+ 
+ static PyObject *
+@@ -309,8 +305,27 @@ static struct PyMethodDef fsimage_module_methods[] = {
+ 	{ NULL, NULL, 0, NULL }
+ };
+ 
++#if PY_MAJOR_VERSION >= 3
++static struct PyModuleDef fsimage_module_def = {
++	PyModuleDef_HEAD_INIT,
++	.m_name = "xenfsimage",
++	.m_size = -1,
++	.m_methods = fsimage_module_methods,
++};
++#endif
++
+ PyMODINIT_FUNC
++#if PY_MAJOR_VERSION >= 3
++PyInit_xenfsimage(void)
++#else
+ initxenfsimage(void)
++#endif
+ {
++#if PY_MAJOR_VERSION < 3
+ 	Py_InitModule("xenfsimage", fsimage_module_methods);
++#else
++	if (PyType_Ready(&fsimage_fs_type) < 0 || PyType_Ready(&fsimage_file_type) < 0)
++		return NULL;
++	return PyModule_Create(&fsimage_module_def);
++#endif
+ }
+-- 
+2.17.1
+
diff --git a/recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch b/recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch
new file mode 100644
index 0000000..b32c5d0
--- /dev/null
+++ b/recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch
@@ -0,0 +1,136 @@
+From 88d703a361d34d75f81fc6d30b31d0abc8aa17eb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
+ <marmarek@invisiblethingslab.com>
+Date: Fri, 9 Aug 2019 03:01:36 +0100
+Subject: [PATCH] python: fix -Wsign-compare warnings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Specifically:
+xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_create’:
+xen/lowlevel/xc/xc.c:147:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
+  147 |         for ( i = 0; i < sizeof(xen_domain_handle_t); i++ )
+      |                        ^
+xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_sethandle’:
+xen/lowlevel/xc/xc.c:312:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
+  312 |     for ( i = 0; i < sizeof(xen_domain_handle_t); i++ )
+      |                    ^
+xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_getinfo’:
+xen/lowlevel/xc/xc.c:391:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
+  391 |         for ( j = 0; j < sizeof(xen_domain_handle_t); j++ )
+      |                        ^
+xen/lowlevel/xc/xc.c: In function ‘pyxc_get_device_group’:
+xen/lowlevel/xc/xc.c:677:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare]
+  677 |     for ( i = 0; i < num_sdevs; i++ )
+      |                    ^
+xen/lowlevel/xc/xc.c: In function ‘pyxc_physinfo’:
+xen/lowlevel/xc/xc.c:988:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
+  988 |     for ( i = 0; i < sizeof(pinfo.hw_cap)/4; i++ )
+      |                    ^
+xen/lowlevel/xc/xc.c:994:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
+  994 |     for ( i = 0; i < ARRAY_SIZE(virtcaps_bits); i++ )
+      |                    ^
+xen/lowlevel/xc/xc.c:998:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
+  998 |         for ( i = 0; i < ARRAY_SIZE(virtcaps_bits); i++ )
+      |                        ^
+xen/lowlevel/xs/xs.c: In function ‘xspy_ls’:
+xen/lowlevel/xs/xs.c:191:23: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare]
+  191 |         for (i = 0; i < xsval_n; i++)
+      |                       ^
+xen/lowlevel/xs/xs.c: In function ‘xspy_get_permissions’:
+xen/lowlevel/xs/xs.c:297:23: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare]
+  297 |         for (i = 0; i < perms_n; i++) {
+      |                       ^
+cc1: all warnings being treated as errors
+
+Use size_t for loop iterators where it's compared with sizeof() or
+similar construct.
+
+Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
+Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
+
+Modified to apply to Xen 4.12.2 by Christopher Clark
+Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
+---
+ tools/python/xen/lowlevel/xc/xc.c | 13 ++++++++-----
+ tools/python/xen/lowlevel/xs/xs.c |  4 ++--
+ 2 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
+index 522cbe3b9c..188bfa34da 100644
+--- a/tools/python/xen/lowlevel/xc/xc.c
++++ b/tools/python/xen/lowlevel/xc/xc.c
+@@ -117,7 +117,8 @@ static PyObject *pyxc_domain_create(XcObject *self,
+                                     PyObject *kwds)
+ {
+     uint32_t dom = 0, target = 0;
+-    int      ret, i;
++    int      ret;
++    size_t   i;
+     PyObject *pyhandle = NULL;
+     struct xen_domctl_createdomain config = {
+         .handle = {
+@@ -295,7 +296,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
+ 
+ static PyObject *pyxc_domain_sethandle(XcObject *self, PyObject *args)
+ {
+-    int i;
++    size_t i;
+     uint32_t dom;
+     PyObject *pyhandle;
+     xen_domain_handle_t handle;
+@@ -336,7 +337,8 @@ static PyObject *pyxc_domain_getinfo(XcObject *self,
+     PyObject *list, *info_dict, *pyhandle;
+ 
+     uint32_t first_dom = 0;
+-    int max_doms = 1024, nr_doms, i, j;
++    int max_doms = 1024, nr_doms, i;
++    size_t j;
+     xc_dominfo_t *info;
+ 
+     static char *kwd_list[] = { "first_dom", "max_doms", NULL };
+@@ -631,7 +633,8 @@ static PyObject *pyxc_get_device_group(XcObject *self,
+ {
+     uint32_t sbdf;
+     uint32_t max_sdevs, num_sdevs;
+-    int domid, seg, bus, dev, func, rc, i;
++    int domid, seg, bus, dev, func, rc;
++    size_t i;
+     PyObject *Pystr;
+     char *group_str;
+     char dev_str[9];
+@@ -971,7 +974,7 @@ static PyObject *pyxc_physinfo(XcObject *self)
+ {
+     xc_physinfo_t pinfo;
+     char cpu_cap[128], virt_caps[128], *p;
+-    int i;
++    size_t i;
+     const char *virtcap_names[] = { "hvm", "hvm_directio" };
+ 
+     if ( xc_physinfo(self->xc_handle, &pinfo) != 0 )
+diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c
+index 9a0acfc25c..ea50f86bc3 100644
+--- a/tools/python/xen/lowlevel/xs/xs.c
++++ b/tools/python/xen/lowlevel/xs/xs.c
+@@ -186,7 +186,7 @@ static PyObject *xspy_ls(XsHandle *self, PyObject *args)
+     Py_END_ALLOW_THREADS
+ 
+     if (xsval) {
+-        int i;
++        size_t i;
+         PyObject *val = PyList_New(xsval_n);
+         for (i = 0; i < xsval_n; i++)
+ #if PY_MAJOR_VERSION >= 3
+@@ -276,7 +276,7 @@ static PyObject *xspy_get_permissions(XsHandle *self, PyObject *args)
+     struct xs_handle *xh = xshandle(self);
+     struct xs_permissions *perms;
+     unsigned int perms_n = 0;
+-    int i;
++    size_t i;
+ 
+     xs_transaction_t th;
+     char *thstr;
+-- 
+2.17.1
+
diff --git a/recipes-extended/xen/files/xen-tools-update-python-scripts-to-py3.patch b/recipes-extended/xen/files/xen-tools-update-python-scripts-to-py3.patch
new file mode 100644
index 0000000..455072b
--- /dev/null
+++ b/recipes-extended/xen/files/xen-tools-update-python-scripts-to-py3.patch
@@ -0,0 +1,140 @@
+From a9047a722ba5de38e7c1d762ffcfb74c36725fe2 Mon Sep 17 00:00:00 2001
+From: Andrew Cooper <andrew.cooper3@citrix.com>
+Date: Mon, 11 Mar 2019 19:18:40 +0000
+Subject: [PATCH] tools/xen-foreign: Update python scripts to be Py3 compatible
+
+The issues are:
+ * dict.has_key() was completely removed in Py3
+ * dict.keys() is an iterable rather than list in Py3, so .sort() doesn't work.
+ * list.sort(cmp=) was deprecated in Py2.4 and removed in Py3.
+
+The has_key() issue is trivially fixed by switching to using the in keyword.
+The sorting issue could be trivially fixed, but take the opportunity to
+improve the code.
+
+The reason for the sorting is to ensure that "unsigned long" gets replaced
+before "long", and the only reason sorting is necessary is because
+inttypes[arch] is needlessly a dictionary.  Update inttypes[arch] to be a list
+of tuples rather than a dictionary, and process them in list order.
+
+Reported-by: George Dunlap <george.dunlap@eu.citrix.com>
+Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
+Acked-by: Wei Liu <wei.liu2@citrix.com>
+---
+ tools/include/xen-foreign/mkchecker.py |  2 +-
+ tools/include/xen-foreign/mkheader.py  | 58 +++++++++++++-------------
+ 2 files changed, 29 insertions(+), 31 deletions(-)
+
+diff --git a/tools/include/xen-foreign/mkchecker.py b/tools/include/xen-foreign/mkchecker.py
+index fdad869a91..199b0eebbc 100644
+--- a/tools/include/xen-foreign/mkchecker.py
++++ b/tools/include/xen-foreign/mkchecker.py
+@@ -37,7 +37,7 @@ for struct in structs:
+     f.write('\tprintf("%%-25s |", "%s");\n' % struct);
+     for a in archs:
+         s = struct + "_" + a;
+-        if compat_arches.has_key(a):
++        if a in compat_arches:
+             compat = compat_arches[a]
+             c = struct + "_" + compat;
+         else:
+diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py
+index 97e0c7a984..fb268f0dce 100644
+--- a/tools/include/xen-foreign/mkheader.py
++++ b/tools/include/xen-foreign/mkheader.py
+@@ -17,13 +17,13 @@ header = {};
+ footer = {};
+ 
+ #arm
+-inttypes["arm32"] = {
+-    "unsigned long" : "__danger_unsigned_long_on_arm32",
+-    "long"          : "__danger_long_on_arm32",
+-    "xen_pfn_t"     : "uint64_t",
+-    "xen_ulong_t"   : "uint64_t",
+-    "uint64_t"      : "__align8__ uint64_t",
+-};
++inttypes["arm32"] = [
++    ("unsigned long", "__danger_unsigned_long_on_arm32"),
++    ("long",          "__danger_long_on_arm32"),
++    ("xen_pfn_t",     "uint64_t"),
++    ("xen_ulong_t",   "uint64_t"),
++    ("uint64_t",      "__align8__ uint64_t"),
++]
+ header["arm32"] = """
+ #define __arm___ARM32 1
+ #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+@@ -38,13 +38,13 @@ footer["arm32"] = """
+ #undef __DECL_REG
+ """
+ 
+-inttypes["arm64"] = {
+-    "unsigned long" : "__danger_unsigned_long_on_arm64",
+-    "long"          : "__danger_long_on_arm64",
+-    "xen_pfn_t"     : "uint64_t",
+-    "xen_ulong_t"   : "uint64_t",
+-    "uint64_t"      : "__align8__ uint64_t",
+-};
++inttypes["arm64"] = [
++    ("unsigned long", "__danger_unsigned_long_on_arm64"),
++    ("long",          "__danger_long_on_arm64"),
++    ("xen_pfn_t",     "uint64_t"),
++    ("xen_ulong_t",   "uint64_t"),
++    ("uint64_t",      "__align8__ uint64_t"),
++]
+ header["arm64"] = """
+ #define __aarch64___ARM64 1
+ #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+@@ -60,12 +60,12 @@ footer["arm64"] = """
+ """
+ 
+ # x86_32
+-inttypes["x86_32"] = {
+-    "unsigned long" : "uint32_t",
+-    "long"          : "uint32_t",
+-    "xen_pfn_t"     : "uint32_t",
+-    "xen_ulong_t"   : "uint32_t",
+-};
++inttypes["x86_32"] = [
++    ("unsigned long", "uint32_t"),
++    ("long",          "uint32_t"),
++    ("xen_pfn_t",     "uint32_t"),
++    ("xen_ulong_t",   "uint32_t"),
++]
+ header["x86_32"] = """
+ #define __DECL_REG_LO8(which) uint32_t e ## which ## x
+ #define __DECL_REG_LO16(name) uint32_t e ## name
+@@ -79,12 +79,12 @@ footer["x86_32"] = """
+ """;
+ 
+ # x86_64
+-inttypes["x86_64"] = {
+-    "unsigned long" : "__align8__ uint64_t",
+-    "long"          : "__align8__ uint64_t",
+-    "xen_pfn_t"     : "__align8__ uint64_t",
+-    "xen_ulong_t"   : "__align8__ uint64_t",
+-};
++inttypes["x86_64"] = [
++    ("unsigned long", "__align8__ uint64_t"),
++    ("long",          "__align8__ uint64_t"),
++    ("xen_pfn_t",     "__align8__ uint64_t"),
++    ("xen_ulong_t",   "__align8__ uint64_t"),
++]
+ header["x86_64"] = """
+ #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+ # define __DECL_REG(name) union { uint64_t r ## name, e ## name; }
+@@ -205,10 +205,8 @@ for struct in structs:
+     output = re.sub("\\b(%s)_t\\b" % struct, "\\1_%s_t" % arch, output);
+ 
+ # replace: integer types
+-integers = inttypes[arch].keys();
+-integers.sort(lambda a, b: cmp(len(b),len(a)));
+-for type in integers:
+-    output = re.sub("\\b%s\\b" % type, inttypes[arch][type], output);
++for old, new in inttypes[arch]:
++    output = re.sub("\\b%s\\b" % old, new, output)
+ 
+ # print results
+ f = open(outfile, "w");
+-- 
+2.17.1
+
diff --git a/recipes-extended/xen/xen-hypervisor.inc b/recipes-extended/xen/xen-hypervisor.inc
index c0df158..79fafd2 100644
--- a/recipes-extended/xen/xen-hypervisor.inc
+++ b/recipes-extended/xen/xen-hypervisor.inc
@@ -6,7 +6,7 @@ DESCRIPTION = "The Xen hypervisor"
 # this allows for varying the target architecture or toolchain used
 # to build the different components. eg. 32-bit tools and a 64-bit hypervisor.
 
-inherit deploy
+inherit deploy python3native
 
 PACKAGES = " \
     ${PN} \
@@ -34,7 +34,7 @@ do_configure() {
 }
 
 do_compile() {
-    oe_runmake xen
+    oe_runmake xen PYTHON="${PYTHON}"
 }
 
 do_install() {
diff --git a/recipes-extended/xen/xen-python2.bb b/recipes-extended/xen/xen-python2.bb
new file mode 100644
index 0000000..08d8e92
--- /dev/null
+++ b/recipes-extended/xen/xen-python2.bb
@@ -0,0 +1,68 @@
+SUMMARY = "Xen hypervisor tools written in python 2"
+DESCRIPTION = "Unported utility scripts for the Xen hypervisor"
+HOMEPAGE = "http://xen.org"
+LICENSE = "GPLv2"
+SECTION = "console/tools"
+
+SRCREV ?= "a5fcafbfbee55261853fba07149c1c795f2baf58"
+
+XEN_REL ?= "4.12"
+XEN_BRANCH ?= "stable-4.12"
+
+SRC_URI = "git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH}"
+
+LIC_FILES_CHKSUM ?= "file://COPYING;md5=bbb4b1bdc2c3b6743da3c39d03249095"
+
+PV = "${XEN_REL}+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# Packages in this recipe do not use ${PN} to allow for simpler
+# movement of the package back into the xen-tools recipe if/when
+# the scripts are ported to python 3.
+
+RDEPENDS_xen-tools-xencov-split ="python"
+RDEPENDS_xen-tools-xencons = "python"
+RDEPENDS_xen-tools-xenpvnetboot = "python"
+RDEPENDS_xen-tools-xentrace-format = "python"
+
+RRECOMMENDS_xen-tools-xencov-trace = "xen-tools-xencov"
+RRECOMMENDS_xen-tools-xentrace-format = "xen-tools-xentrace"
+
+PACKAGES = " \
+    xen-tools-xencons \
+    xen-tools-xencov-split \
+    xen-tools-xenpvnetboot \
+    xen-tools-xentrace-format \
+    "
+
+FILES_xen-tools-xencons = " \
+    ${bindir}/xencons \
+    "
+
+FILES_xen-tools-xencov-split = " \
+    ${bindir}/xencov_split \
+    "
+
+FILES_xen-tools-xenpvnetboot = " \
+    ${libdir}/xen/bin/xenpvnetboot \
+    "
+
+FILES_xen-tools-xentrace-format = " \
+    ${bindir}/xentrace_format \
+    "
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 ${S}/tools/xentrace/xentrace_format \
+                    ${D}${bindir}/xentrace_format
+    install -m 0755 ${S}/tools/misc/xencons ${D}${bindir}/xencons
+    install -m 0755 ${S}/tools/misc/xencov_split ${D}${bindir}/xencov_split
+
+    install -d ${D}${libdir}/xen/bin
+    install -m 0755 ${S}/tools/misc/xenpvnetboot \
+                    ${D}${libdir}/xen/bin/xenpvnetboot
+}
diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
index e166c74..a6f1209 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -1,7 +1,7 @@
 SUMMARY = "Xen hypervisor tools"
 DESCRIPTION = "Tools and utility software for the Xen hypervisor"
 
-inherit setuptools update-rc.d systemd deploy
+inherit setuptools3 update-rc.d systemd deploy
 require xen-blktap.inc
 
 RDEPENDS_${PN} = "\
@@ -47,21 +47,25 @@ RDEPENDS_${PN}-fsimage = " \
 
 RDEPENDS_${PN}-misc = " \
     perl \
-    python \
+    python3 \
+    ${PN}-xencov \
+    "
+
+RSUGGESTS_${PN}-misc = " \
+    ${PN}-xencons \
+    ${PN}-xenpvnetboot \
     "
 
 RDEPENDS_${PN}-python = " \
-    python \
+    python3 \
     "
 
 RDEPENDS_${PN}-pygrub = " \
+    python3 \
     ${PN}-python \
     "
 
-RDEPENDS_${PN}-remus = " \
-    bash \
-    python \
-    "
+RDEPENDS_${PN}-remus = "bash"
 
 RDEPENDS_${PN}-scripts-block = "\
     bash \
@@ -78,6 +82,8 @@ RDEPENDS_${PN}-scripts-network = "\
     ${PN}-volatiles \
     "
 
+RSUGGESTS_${PN}-xencov = "${PN}-xencov-split"
+
 RDEPENDS_${PN}-xencommons = "\
     bash \
     ${PN}-console \
@@ -97,7 +103,11 @@ RDEPENDS_${PN}-xendomains = "\
 
 RDEPENDS_${PN}-xl = "libgcc"
 
-RDEPENDS_${PN}-xentrace = "python"
+RDEPENDS_${PN}-xenmon = " \
+    python3 \
+    "
+
+RSUGGESTS_${PN}-xentrace = "${PN}-xentrace-format"
 
 RDEPENDS_${PN}-xen-watchdog = "bash"
 
@@ -160,6 +170,7 @@ PACKAGES = " \
     ${PN}-volatiles \
     ${PN}-xcutils \
     ${PN}-xencommons \
+    ${PN}-xencov \
     ${PN}-xend \
     ${PN}-xend-examples \
     ${PN}-xendomains \
@@ -188,8 +199,8 @@ RPROVIDES_${PN}-xenstored = "virtual/xenstored"
 
 FILES_${PN}-dbg += "\
     ${libdir}/xen/bin/.debug \
-    ${libdir}/python2.7/site-packages/.debug \
-    ${libdir}/python2.7/site-packages/xen/lowlevel/.debug \
+    ${libdir}/${PYTHON_DIR}/site-packages/.debug \
+    ${libdir}/${PYTHON_DIR}/site-packages/xen/lowlevel/.debug \
     ${libdir}/fs/xfs/.debug \
     ${libdir}/fs/ufs/.debug \
     ${libdir}/fs/ext2fs-lib/.debug \
@@ -202,8 +213,8 @@ FILES_${PN}-dbg += "\
     ${libdir}exec/.debug \
     ${libdir}/xen/libexec/.debug \
     ${bindir}/.debug \
-    ${libdir}/python2.7/dist-packages/.debug \
-    ${libdir}/python2.7/dist-packages/xen/lowlevel/.debug \
+    ${libdir}/${PYTHON_DIR}/dist-packages/.debug \
+    ${libdir}/${PYTHON_DIR}/dist-packages/xen/lowlevel/.debug \
     "
 
 FILES_${PN}-dev = "\
@@ -404,15 +415,11 @@ FILES_${PN}-livepatch += " \
     "
 
 FILES_${PN}-misc = "\
-    ${bindir}/xencons \
-    ${bindir}/xencov_split \
     ${bindir}/xen-detect \
-    ${libdir}/xen/bin/xenpvnetboot \
     ${libdir}/xen/bin/depriv-fd-checker \
     ${sbindir}/gtracestat \
     ${sbindir}/gtraceview \
     ${sbindir}/xen-bugtool \
-    ${sbindir}/xencov \
     ${sbindir}/xenperf \
     ${sbindir}/xenpm \
     ${sbindir}/xsview \
@@ -436,11 +443,10 @@ FILES_${PN}-pygrub = "\
     "
 
 FILES_${PN}-python = "\
-    ${libdir}/python2.7 \
+    ${libdir}/${PYTHON_DIR} \
     "
 
 FILES_${PN}-remus = "\
-    ${bindir}/remus \
     ${sysconfdir}/xen/scripts/remus-netbuf-setup \
     "
 
@@ -500,6 +506,10 @@ FILES_${PN}-xcutils = "\
     ${libdir}/xen/bin/xc_save \
     "
 
+FILES_${PN}-xencov = "\
+    ${sbindir}/xencov \
+    "
+
 FILES_${PN}-xend-examples = "\
     ${sysconfdir}/xen/xend-config.sxp \
     ${sysconfdir}/xen/xend-pci-permissive.sxp \
@@ -539,7 +549,6 @@ FILES_${PN}-xenstored = "\
 
 FILES_${PN}-xentrace = "\
     ${bindir}/xentrace \
-    ${bindir}/xentrace_format \
     ${bindir}/xentrace_setsize \
     ${libdir}/xen/bin/xenctx \
     ${bindir}/xenalyze \
@@ -665,12 +674,20 @@ do_stubs() {
 addtask stubs after do_configure before do_compile
 
 do_compile() {
-    oe_runmake tools
+    cd ${S}
+    oe_runmake tools PYTHON="${PYTHON}"
 }
 
 do_install() {
+    cd ${S}
     oe_runmake DESTDIR="${D}" install-tools
 
+    # Remove unported python 2 scripts -- see the separate xen-python2 recipe
+    rm -f ${D}${bindir}/xentrace_format \
+          ${D}${bindir}/xencons \
+          ${D}${bindir}/xencov_split \
+          ${D}${libdir}/xen/bin/xenpvnetboot
+
     # remove installed volatiles
     rm -rf ${D}${base_prefix}/run \
         ${D}${localstatedir}/run \
diff --git a/recipes-extended/xen/xen-tools_git.bb b/recipes-extended/xen/xen-tools_git.bb
index 7042c53..00060df 100644
--- a/recipes-extended/xen/xen-tools_git.bb
+++ b/recipes-extended/xen/xen-tools_git.bb
@@ -6,6 +6,12 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
     file://0001-python-pygrub-pass-DISTUTILS-xen.4.12.patch \
+    file://xen-tools-update-python-scripts-to-py3.patch \
+    file://xen-tools-libxl-gentypes-py3.patch \
+    file://xen-tools-python-fix-Wsign-compare-warnings.patch \
+    file://xen-tools-pygrub-change-tabs-into-spaces.patch \
+    file://xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch \
+    file://xen-tools-pygrub-py3.patch \
     "
 
 LIC_FILES_CHKSUM ?= "file://COPYING;md5=bbb4b1bdc2c3b6743da3c39d03249095"
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index b2af8aa..0bfe72d 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -43,7 +43,7 @@ DEPENDS = " \
     pciutils \
     pixman \
     procps \
-    python \
+    python3 \
     libaio \
     lzo \
     util-linux \
@@ -77,8 +77,8 @@ libexecdir = "${libdir}"
 export XEN_OS = "Linux"
 
 # this is used for the header (#!${bindir}/python) of the install python scripts
-export PYTHONPATH="${bindir}/python"
-export ac_cv_path_PYTHONPATH="${bindir}/python"
+export PYTHONPATH="${bindir}/env python3"
+export ac_cv_path_PYTHONPATH="${bindir}/env python3"
 export DISTUTILS_BUILD_ARGS
 export DISTUTILS_INSTALL_ARGS
 
@@ -207,6 +207,7 @@ EXTRA_OEMAKE += "XEN_CONFIG_EXPERT=y"
 EXTRA_OEMAKE += "debug=n"
 
 do_configure_common() {
+    cd ${S}
 
     #./configure --enable-xsmpolicy does not set XSM_ENABLE must be done manually
     if [ "${XSM_ENABLED}" = "1" ]; then
@@ -222,7 +223,9 @@ do_configure_common() {
 
     # do configure
     oe_runconf EXTRA_CFLAGS_XEN_CORE="${EXTRA_CFLAGS_XEN_CORE}" \
-               EXTRA_CFLAGS_XEN_TOOLS="${EXTRA_CFLAGS_XEN_TOOLS}"
+               EXTRA_CFLAGS_XEN_TOOLS="${EXTRA_CFLAGS_XEN_TOOLS}" \
+               PYTHON="${PYTHON}"
+
     if [ ! -e ${STAGING_INCDIR}/bits/long-double-32.h ]; then
         cp ${STAGING_INCDIR}/bits/long-double-64.h ${STAGING_INCDIR}/bits/long-double-32.h
     fi
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 16/22] xen, xen-tools: separate COMPATIBLE_HOST for hypervisor and tools
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (14 preceding siblings ...)
  2020-02-26  0:15 ` [meta-virtualization][PATCH v3 15/22] xen, xen-tools: update recipes for python3 Christopher Clark
@ 2020-02-26  0:16 ` Christopher Clark
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 17/22] xen, xen-tools: remove stubs task and use multilib when necessary Christopher Clark
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:16 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

The tools have broader platform compatibility than the hypervisor.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/xen-hypervisor.inc | 3 +++
 recipes-extended/xen/xen-tools.inc      | 2 ++
 recipes-extended/xen/xen.inc            | 2 --
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/recipes-extended/xen/xen-hypervisor.inc b/recipes-extended/xen/xen-hypervisor.inc
index 79fafd2..41de9b6 100644
--- a/recipes-extended/xen/xen-hypervisor.inc
+++ b/recipes-extended/xen/xen-hypervisor.inc
@@ -6,6 +6,9 @@ DESCRIPTION = "The Xen hypervisor"
 # this allows for varying the target architecture or toolchain used
 # to build the different components. eg. 32-bit tools and a 64-bit hypervisor.
 
+# The Xen hypervisor has a narrower compatible platform range than the Xen tools
+COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
+
 inherit deploy python3native
 
 PACKAGES = " \
diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
index a6f1209..00843ca 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -1,6 +1,8 @@
 SUMMARY = "Xen hypervisor tools"
 DESCRIPTION = "Tools and utility software for the Xen hypervisor"
 
+COMPATIBLE_HOST = 'i686-oe-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
+
 inherit setuptools3 update-rc.d systemd deploy
 require xen-blktap.inc
 
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index 0bfe72d..1ac131e 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -2,8 +2,6 @@ HOMEPAGE = "http://xen.org"
 LICENSE = "GPLv2"
 SECTION = "console/tools"
 
-COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
-
 inherit autotools-brokensep
 
 require xen-arch.inc
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 17/22] xen, xen-tools: remove stubs task and use multilib when necessary
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (15 preceding siblings ...)
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 16/22] xen, xen-tools: separate COMPATIBLE_HOST for hypervisor and tools Christopher Clark
@ 2020-02-26  0:16 ` Christopher Clark
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 18/22] xen, xen-tools: bug fix to post_patch task Christopher Clark
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:16 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

The stubs task was MACHINE-specific due to the OE variables it accessed
which had forced unnecessary rebuild work in OpenXT's multi-MACHINE
builds.

The stubs task was generating a 32-bit header file to satisfy the Xen
tools firmware build to generate the hvmloader binary, which is only
needed on x86-64 targets where HVM-mode guests are enabled.

Remove this header file generation logic and similar in the configure
task, and in the cases where hvmloader is to be built use multilib to
provide a 32-bit sysroot and allow the build to obtain the needed 32-bit
materials from their source: glibc.

Building Xen tools for x86-64 with HVM-guest support enabled now
requires the following to be added to a build conf file
(eg. distro.conf, or local.conf) :

    require conf/multilib.conf
    MULTILIBS = "multilib:lib32"
    DEFAULTTUNE_virtclass-multilib-lib32 = "x86"

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/xen-tools.inc | 48 ++++++++++++++++++++++--------
 recipes-extended/xen/xen.inc       |  4 ---
 2 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
index 00843ca..864c40c 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -6,6 +6,29 @@ COMPATIBLE_HOST = 'i686-oe-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux
 inherit setuptools3 update-rc.d systemd deploy
 require xen-blktap.inc
 
+# To build hvmloader, which is needed on x86-64 targets when 'hvm' is enabled
+# in PACKAGECONFIG, to support running HVM-mode guest VMs, some files from
+# 32-bit glibc are needed.
+# Add the multilib 32-bit glibc to DEPENDS only when necessary.
+#
+# To enable multilib, please add the following to your local.conf -:
+#
+#    require conf/multilib.conf
+#    MULTILIBS = "multilib:lib32"
+#    DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
+
+# Use this multilib prefix for x86 32-bit to match local.conf:
+MLPREFIX32 = "lib32-"
+
+# The DEPENDS on a multilib 32-bit glibc is only added when target is x86-64
+# and 'hvm' is enabled in PACKAGECONFIG.
+# This x86-64 override is never intended for native use, so clear that.
+GLIBC32 = ""
+GLIBC32_x86-64 = \
+    "${@bb.utils.contains('PACKAGECONFIG', 'hvm', '${MLPREFIX32}glibc', '', d)}"
+GLIBC32_class-native = ""
+DEPENDS += "${GLIBC32}"
+
 RDEPENDS_${PN} = "\
     bash perl xz \
     ${PN}-console \
@@ -656,25 +679,24 @@ SYSTEMD_SERVICE_${PN}-xencommons = " \
     "
 SYSTEMD_SERVICE_${PN}-xendomains = "xendomains.service"
 
+# To build hvmloader, which is needed on x86-64 targets when 'hvm' is enabled
+# in PACKAGECONFIG, additional CFLAGS are needed to set the 32-bit sysroot.
+RECIPE_SYSROOT32 = "${WORKDIR}/${MLPREFIX32}recipe-sysroot"
+ADD_SYSROOT32_CFLAGS = ""
+ADD_SYSROOT32_CFLAGS_x86-64 = \
+    "${@bb.utils.contains('PACKAGECONFIG', 'hvm', \
+        'CFLAGS += "--sysroot=${RECIPE_SYSROOT32}"', '', d)}"
+# This x86-64 override is never intended for native use, so clear that.
+ADD_SYSROOT32_CFLAGS_class-native = ""
+
 do_configure() {
     do_configure_common
-}
 
-do_stubs() {
-    # no stubs-32.h in our 64-bit sysroot - hack it into tools/include/gnu
-    if ! test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-32.h ; then
-        if test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h ; then
-            test -d ${S}/tools/include/gnu || mkdir ${S}/tools/include/gnu
-            cat ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h | grep -v stub_bdflush | grep -v stub_getmsg | grep -v stub_putmsg > ${S}/tools/include/gnu/stubs-32.h
-            echo \#define __stub___kernel_cosl >> ${S}/tools/include/gnu/stubs-32.h
-            echo \#define __stub___kernel_sinl >> ${S}/tools/include/gnu/stubs-32.h
-            echo \#define __stub___kernel_tanl >> ${S}/tools/include/gnu/stubs-32.h
-        fi
+    if [ -n '${ADD_SYSROOT32_CFLAGS}' ] ; then
+        echo '${ADD_SYSROOT32_CFLAGS}' >>"${S}/tools/firmware/Rules.mk"
     fi
 }
 
-addtask stubs after do_configure before do_compile
-
 do_compile() {
     cd ${S}
     oe_runmake tools PYTHON="${PYTHON}"
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index 1ac131e..32e836a 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -223,10 +223,6 @@ do_configure_common() {
     oe_runconf EXTRA_CFLAGS_XEN_CORE="${EXTRA_CFLAGS_XEN_CORE}" \
                EXTRA_CFLAGS_XEN_TOOLS="${EXTRA_CFLAGS_XEN_TOOLS}" \
                PYTHON="${PYTHON}"
-
-    if [ ! -e ${STAGING_INCDIR}/bits/long-double-32.h ]; then
-        cp ${STAGING_INCDIR}/bits/long-double-64.h ${STAGING_INCDIR}/bits/long-double-32.h
-    fi
 }
 
 do_compile_prepend() {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 18/22] xen, xen-tools: bug fix to post_patch task
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (16 preceding siblings ...)
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 17/22] xen, xen-tools: remove stubs task and use multilib when necessary Christopher Clark
@ 2020-02-26  0:16 ` Christopher Clark
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 19/22] xen: add contact to recipe README file Christopher Clark
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:16 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Patch needs to be applied to tree in ${S}.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/xen.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index 32e836a..d863c8f 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -192,7 +192,7 @@ do_post_patch() {
 
 do_post_patch_append_arm()  {
     # The hypervisor binary must not be built with the hard floating point ABI.
-    echo "CC := \$(filter-out ${TUNE_CCARGS},\$(CC))" >> ${B}/xen/arch/arm/Rules.mk
+    echo "CC := \$(filter-out ${TUNE_CCARGS},\$(CC))" >> ${S}/xen/arch/arm/Rules.mk
 }
 
 addtask post_patch after do_patch before do_configure
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 19/22] xen: add contact to recipe README file
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (17 preceding siblings ...)
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 18/22] xen, xen-tools: bug fix to post_patch task Christopher Clark
@ 2020-02-26  0:16 ` Christopher Clark
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 20/22] xen-image-minimal: add a build dependency on the xen hypervisor Christopher Clark
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:16 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Add myself as a contact for the Xen recipes.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 recipes-extended/xen/README | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/recipes-extended/xen/README b/recipes-extended/xen/README
index 3686530..5592b48 100644
--- a/recipes-extended/xen/README
+++ b/recipes-extended/xen/README
@@ -1,7 +1,9 @@
 Xen
 ---
 
-For any issues with the xen recipes please make sure you CC cardoe@gentoo.org
+For any issues with the Xen recipes please make sure you CC:
+ christopher.w.clark@gmail.com
+ cardoe@gentoo.org
 
 configuring the hypervisor
 --------------------------
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 20/22] xen-image-minimal: add a build dependency on the xen hypervisor
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (18 preceding siblings ...)
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 19/22] xen: add contact to recipe README file Christopher Clark
@ 2020-02-26  0:16 ` Christopher Clark
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 21/22] xen: add menuconfig instructions to the README Christopher Clark
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:16 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

The hypervisor may not be within the dom0 filesystem image itself,
so add a task dependency to ensure that it is deployable:
    do_build[depends] += "xen:do_deploy"

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/images/xen-image-minimal.bb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/recipes-extended/images/xen-image-minimal.bb b/recipes-extended/images/xen-image-minimal.bb
index c98314e..dcdc864 100644
--- a/recipes-extended/images/xen-image-minimal.bb
+++ b/recipes-extended/images/xen-image-minimal.bb
@@ -16,6 +16,10 @@ IMAGE_INSTALL += " \
     qemu \
     "
 
+# The hypervisor may not be within the dom0 filesystem image but at least
+# ensure that it is deployable:
+do_build[depends] += "xen:do_deploy"
+
 # Networking for HVM-mode guests (x86/64 only) requires the tun kernel module
 IMAGE_INSTALL_append_x86    = "kernel-module-tun"
 IMAGE_INSTALL_append_x86-64 = "kernel-module-tun"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 21/22] xen: add menuconfig instructions to the README
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (19 preceding siblings ...)
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 20/22] xen-image-minimal: add a build dependency on the xen hypervisor Christopher Clark
@ 2020-02-26  0:16 ` Christopher Clark
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 22/22] xen, xen-tools: updates to the deploy task Christopher Clark
  2020-02-27 21:59 ` [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Bruce Ashfield
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:16 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

    bitbake xen -c menuconfig

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/README | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/recipes-extended/xen/README b/recipes-extended/xen/README
index 5592b48..34e7977 100644
--- a/recipes-extended/xen/README
+++ b/recipes-extended/xen/README
@@ -16,6 +16,15 @@ copy it to your Yocto layer as 'defconfig' inside of
 'recipes-extended/xen/files/' and then create a bbappend adding
 'file://defconfig' to your SRC_URI.
 
+To generate your own .config file for Xen, you can use the interactive
+menuconfig via bitbake:
+
+    bitbake xen -c menuconfig
+
+Select the config settings that you want and Save the file. If you save it to
+the default ".config" file when prompted by menuconfig, you can find it in the
+'xen' subdirectory of the build tree.
+
 security patches
 ----------------
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [meta-virtualization][PATCH v3 22/22] xen, xen-tools: updates to the deploy task
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (20 preceding siblings ...)
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 21/22] xen: add menuconfig instructions to the README Christopher Clark
@ 2020-02-26  0:16 ` Christopher Clark
  2020-02-27 21:59 ` [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Bruce Ashfield
  22 siblings, 0 replies; 24+ messages in thread
From: Christopher Clark @ 2020-02-26  0:16 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, cardoe

From: Christopher Clark <christopher.w.clark@gmail.com>

Amend addtask for deploy in both recipes: add deploy before do_build to
ensure that it completes before the build step stamp is written.
Suggested-by: Bertrand Marquis <bertrand.marquis@arm.com>

Add comments explaining the scheduling of the deploy task to
both the hypervisor and tools recipes.

In the hypervisor build, change deploy to obtain files from ${B} rather
than ${D}, since it allows a bbappend to modify boot binary file
destinations in do_install without breaking do_deploy.

To ensure that a deployed hypervisor has matching tools in any image
being built, add a dependency to make sure that the tools have built and
been staged first:
    do_deploy[depends] += "xen-tools:do_populate_sysroot"

Also add a dependency to ensure that anything that the tools recipe
deploys, such as a XSM policy file, has been deployed first:
    do_deploy[depends] += "xen-tools:do_deploy"

Schedule deploy tasks after populate_sysroot to ensure that deployed
binaries match those staged for inclusion in the image rootfs.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
---
 recipes-extended/xen/xen-hypervisor.inc | 30 ++++++++++++++++++-------
 recipes-extended/xen/xen-tools.inc      | 11 +++++++--
 2 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/recipes-extended/xen/xen-hypervisor.inc b/recipes-extended/xen/xen-hypervisor.inc
index 41de9b6..21d9c7f 100644
--- a/recipes-extended/xen/xen-hypervisor.inc
+++ b/recipes-extended/xen/xen-hypervisor.inc
@@ -47,20 +47,34 @@ do_install() {
 do_deploy() {
     install -d ${DEPLOYDIR}
 
-    if [ -f ${D}/boot/xen ]; then
-        install -m 0644 ${D}/boot/xen ${DEPLOYDIR}/xen-${MACHINE}
+    if [ -f ${B}/xen/xen.gz ]; then
+        install -m 0644 ${B}/xen/xen ${DEPLOYDIR}/xen-${MACHINE}
     fi
 
-    if [ -f ${D}/boot/xen.gz ]; then
-        install -m 0644 ${D}/boot/xen.gz ${DEPLOYDIR}/xen-${MACHINE}.gz
+    if [ -f ${B}/xen/xen.gz ]; then
+        install -m 0644 ${B}/xen/xen.gz ${DEPLOYDIR}/xen-${MACHINE}.gz
     fi
 
-    if [ -f ${D}/usr/lib64/efi/xen.efi ]; then
-        install -m 0644 ${D}/usr/lib64/efi/xen.efi ${DEPLOYDIR}/xen-${MACHINE}.efi
+    if [ -f ${B}/xen/xen.efi ]; then
+        install -m 0644 ${B}/xen/xen.efi ${DEPLOYDIR}/xen-${MACHINE}.efi
     fi
 }
-
-addtask deploy after do_populate_sysroot
+# Scheduling the do_deploy task:
+# - deploy copies files from ${B} that are written during do_compile so must
+#   at least run afer that task has completed
+# - the hypervisor binaries may be included in the image filesystem, so we
+#   must ensure that the binaries deployed match what is staged in the sysroot:
+#   so do deploy must run after do_populate_sysroot -- which is always after
+#   do_compile, so that handles 'after do_compile' too
+# - add the task before do_build to ensure that deployment has completed when
+#   the recipe build done stamp is written
+addtask deploy after do_populate_sysroot before do_build
+# To ensure that a deployed hypervisor has matching tools, add a dependency to
+# make sure that the tools have built and been staged:
+do_deploy[depends] += "xen-tools:do_populate_sysroot"
+# Also ensure anything that the tools recipe needs to deploy, such as a
+# XSM policy file, has been deployed first:
+do_deploy[depends] += "xen-tools:do_deploy"
 
 # Enable use of menuconfig directly from bitbake and also within the devshell
 OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO"
diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc
index 864c40c..8bdbfec 100644
--- a/recipes-extended/xen/xen-tools.inc
+++ b/recipes-extended/xen/xen-tools.inc
@@ -781,5 +781,12 @@ do_deploy() {
         ln -sf ${FLASK_POLICY_FILE} ${DEPLOYDIR}/xenpolicy-${MACHINE}
     fi
 }
-
-addtask deploy after do_populate_sysroot
+# Scheduling the do_deploy task:
+# - deploy copies files from ${D} that are written during do_install so must run
+#   after that task
+# - the tools binaries are included in the image filesystem, so we must ensure
+#   that the binaries deployed match what is staged in the sysroot:
+#   so do_deploy must run after do_populate_sysroot
+# - add the task before do_build to ensure that deployment has completed when
+#   the recipe build done stamp is written
+addtask deploy after do_install do_populate_sysroot before do_build
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation
  2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
                   ` (21 preceding siblings ...)
  2020-02-26  0:16 ` [meta-virtualization][PATCH v3 22/22] xen, xen-tools: updates to the deploy task Christopher Clark
@ 2020-02-27 21:59 ` Bruce Ashfield
  22 siblings, 0 replies; 24+ messages in thread
From: Bruce Ashfield @ 2020-02-27 21:59 UTC (permalink / raw)
  To: christopher.w.clark; +Cc: meta-virtualization, cardoe

In message: [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation
on 25/02/2020 christopher.w.clark@gmail.com wrote:

> From: Christopher Clark <christopher.w.clark@gmail.com>
> 
> Update the Xen recipes for python3 compatibility and separate recipes
> for the hypervisor, the tools and legacy python2 scripts. Refresh ipxe
> and seabios.
> 
> Changes since v2 of this series:
> - update the deploy tasks to ensure that the hypervisor and tools binaries
>   are staged (addtask after do_populate_sysroot) prior to being deployed
> - set executable permissions on the installed python2 scripts

v3 is merged. Thanks for the updates!

Bruce

> 
> Upgrade Xen to latest point release of the same version and switch to
> git branch tracking for easier incorporation of security fixes. Multiple
> recipe fixes.
> 
> Separate recipes for the hypervisor and tools enables targetting
> different architectures and build configurations (ref: multiconfig) and
> improvements to build efficiency downstream.
> 
> Add wic support for building bootable images with Xen and dom0.
> 
> Remove the stubs task by satisfying the 32-bit dependencies when
> necessary using multilib.
> 
> This change renames many of the packages produced: most packages that had a
> "xen-" prefix now have a "xen-tools-" prefix instead, indicating the recipe
> that now produces them, so dependent recipes will need to update package
> references:
>     eg. xen-tools-hvmloader replaces xen-hvmloader
>     eg. xen-tools replaces xen-base
> and recipe DEPENDS statements:
>     eg. DEPENDS="xen" changes to DEPENDS="xen-tools"
> A temporary append is provided for qemu to handle the renaming while its
> recipe is updated in openembedded-core.
> 
> Christopher Clark (22):
>   seabios: upgrade to version 1.13.0 at official URI and switch to
>     python3
>   ipxe: fix build with uprev to the latest git revision
>   linux-yocto/xen.cfg: update Xen KConfig fragment entries
>   xen: pass compiler flags via Xen-provided variables
>   xen: upgrade to 4.12.2
>   wic: add support for bootable pcbios partition with Xen hypervisor
>   xen: package the EFI hypervisor binary /boot/xen.efi
>   xen: add RDEPENDS for xen-pygrub and xen-python packages
>   xen: retire Qemu packaging from the Xen recipe
>   xen: separate recipes for hypervisor and tools; switch to git as
>     source
>   xen-tools: move xentrace_setmask into the xentrace package
>   xen: add seabios to RRECOMMENDS of xen-tools when HVM-enabled
>   xen-image-minimal: add kernel-module-tun for HVM guest networking
>   xen-tools: change globbing to fix syntax highlighting
>   xen, xen-tools: update recipes for python3
>   xen, xen-tools: separate COMPATIBLE_HOST for hypervisor and tools
>   xen, xen-tools: remove stubs task and use multilib when necessary
>   xen, xen-tools: bug fix to post_patch task
>   xen: add contact to recipe README file
>   xen-image-minimal: add a build dependency on the xen hypervisor
>   xen: add menuconfig instructions to the README
>   xen, xen-tools: updates to the deploy task
> 
>  .gitignore                                    |   1 +
>  recipes-devtools/qemu/qemu_%.bbappend         |   1 +
>  recipes-extended/images/xen-image-minimal.bb  |  10 +-
>  .../files/ipxe-fix-hostcc-nopie-cflags.patch  |  58 +-
>  recipes-extended/ipxe/ipxe_git.bb             |   2 +-
>  .../seabios/seabios/python3.patch             |  13 +
>  .../{seabios_1.11.2.bb => seabios_1.13.0.bb}  |  13 +-
>  recipes-extended/xen/README                   |  13 +-
>  ...ython-pygrub-pass-DISTUTILS-xen.4.12.patch |   7 +-
>  .../files/xen-tools-libxl-gentypes-py3.patch  | 140 +++
>  ...tools-pygrub-change-tabs-into-spaces.patch |  40 +
>  ...-python-scripts-work-with-2.6-and-up.patch | 529 ++++++++++
>  .../xen/files/xen-tools-pygrub-py3.patch      | 233 +++++
>  ...ls-python-fix-Wsign-compare-warnings.patch | 136 +++
>  ...n-tools-update-python-scripts-to-py3.patch | 140 +++
>  recipes-extended/xen/xen-blktap.inc           |  76 ++
>  recipes-extended/xen/xen-hypervisor.inc       | 111 ++
>  recipes-extended/xen/xen-python2.bb           |  68 ++
>  recipes-extended/xen/xen-tools.inc            | 792 ++++++++++++++
>  recipes-extended/xen/xen-tools_git.bb         |  24 +
>  recipes-extended/xen/xen.inc                  | 970 +-----------------
>  recipes-extended/xen/xen_4.12.0.bb            |  12 -
>  recipes-extended/xen/xen_git.bb               |  19 +-
>  recipes-kernel/linux/linux-yocto/xen.cfg      |   3 +-
>  .../lib/wic/plugins/source/bootimg-biosxen.py | 212 ++++
>  wic/directdisk-bootloader-xen.cfg             |  17 +
>  wic/directdisk-bootloader-xen.wks             |  12 +
>  wic/directdisk-xen.wks                        |  10 +
>  28 files changed, 2642 insertions(+), 1020 deletions(-)
>  create mode 100644 recipes-devtools/qemu/qemu_%.bbappend
>  create mode 100644 recipes-extended/seabios/seabios/python3.patch
>  rename recipes-extended/seabios/{seabios_1.11.2.bb => seabios_1.13.0.bb} (67%)
>  create mode 100644 recipes-extended/xen/files/xen-tools-libxl-gentypes-py3.patch
>  create mode 100644 recipes-extended/xen/files/xen-tools-pygrub-change-tabs-into-spaces.patch
>  create mode 100644 recipes-extended/xen/files/xen-tools-pygrub-make-python-scripts-work-with-2.6-and-up.patch
>  create mode 100644 recipes-extended/xen/files/xen-tools-pygrub-py3.patch
>  create mode 100644 recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch
>  create mode 100644 recipes-extended/xen/files/xen-tools-update-python-scripts-to-py3.patch
>  create mode 100644 recipes-extended/xen/xen-blktap.inc
>  create mode 100644 recipes-extended/xen/xen-hypervisor.inc
>  create mode 100644 recipes-extended/xen/xen-python2.bb
>  create mode 100644 recipes-extended/xen/xen-tools.inc
>  create mode 100644 recipes-extended/xen/xen-tools_git.bb
>  delete mode 100644 recipes-extended/xen/xen_4.12.0.bb
>  create mode 100644 scripts/lib/wic/plugins/source/bootimg-biosxen.py
>  create mode 100644 wic/directdisk-bootloader-xen.cfg
>  create mode 100644 wic/directdisk-bootloader-xen.wks
>  create mode 100644 wic/directdisk-xen.wks
> 
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-02-27 21:59 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26  0:15 [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 01/22] seabios: upgrade to version 1.13.0 at official URI and switch to python3 Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 02/22] ipxe: fix build with uprev to the latest git revision Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 03/22] linux-yocto/xen.cfg: update Xen KConfig fragment entries Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 04/22] xen: pass compiler flags via Xen-provided variables Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 05/22] xen: upgrade to 4.12.2 Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 06/22] wic: add support for bootable pcbios partition with Xen hypervisor Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 07/22] xen: package the EFI hypervisor binary /boot/xen.efi Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 08/22] xen: add RDEPENDS for xen-pygrub and xen-python packages Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 09/22] xen: retire Qemu packaging from the Xen recipe Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 10/22] xen: separate recipes for hypervisor and tools; switch to git as source Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 11/22] xen-tools: move xentrace_setmask into the xentrace package Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 12/22] xen: add seabios to RRECOMMENDS of xen-tools when HVM-enabled Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 13/22] xen-image-minimal: add kernel-module-tun for HVM guest networking Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 14/22] xen-tools: change globbing to fix syntax highlighting Christopher Clark
2020-02-26  0:15 ` [meta-virtualization][PATCH v3 15/22] xen, xen-tools: update recipes for python3 Christopher Clark
2020-02-26  0:16 ` [meta-virtualization][PATCH v3 16/22] xen, xen-tools: separate COMPATIBLE_HOST for hypervisor and tools Christopher Clark
2020-02-26  0:16 ` [meta-virtualization][PATCH v3 17/22] xen, xen-tools: remove stubs task and use multilib when necessary Christopher Clark
2020-02-26  0:16 ` [meta-virtualization][PATCH v3 18/22] xen, xen-tools: bug fix to post_patch task Christopher Clark
2020-02-26  0:16 ` [meta-virtualization][PATCH v3 19/22] xen: add contact to recipe README file Christopher Clark
2020-02-26  0:16 ` [meta-virtualization][PATCH v3 20/22] xen-image-minimal: add a build dependency on the xen hypervisor Christopher Clark
2020-02-26  0:16 ` [meta-virtualization][PATCH v3 21/22] xen: add menuconfig instructions to the README Christopher Clark
2020-02-26  0:16 ` [meta-virtualization][PATCH v3 22/22] xen, xen-tools: updates to the deploy task Christopher Clark
2020-02-27 21:59 ` [meta-virtualization][PATCH v3 00/22] Xen: python3, wic, 4.12.2, tools separation Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.