xen: Move recipes to internal layers [YOCIMX-5563]

Signed-off-by: Cristinel Panfir <cristinel.panfir@nxp.com>
This commit is contained in:
Cristinel Panfir 2021-07-19 11:00:54 +03:00
parent b6a73f9b9b
commit 08726b022b
14 changed files with 1 additions and 1524 deletions

14
README
View File

@ -110,20 +110,6 @@ DEFAULTTUNE_virtclass-multilib-lib32 = "armv7athf-neon"
- 32-bit libraries to be added into the image
IMAGE_INSTALL_append = " lib32-glibc lib32-libgcc lib32-libstdc++"
Building XEN
------------
XEN is supported on IMX8QM/QXP. To enable xen build add the following line to local.conf:
DISTRO_FEATURES_append = " xen"
Key tech implemented:
- GPU partition, 2 GPUs assigned to different OSes
- DPU partition, 2 DPUs assigned to different OSes
- USDHC passthrough
- USB passthrough
- LPUART passthrough
- Software partition based on SCU firmware to restrict resource access from different OSes.
Hardware Floating Point
-----------------------
This release enables hardware floating point by default. This feature is enabled in both the machine

View File

@ -368,18 +368,6 @@ Origin: NXP (GPL-2.0)
--------------------------------------------
Package: imx-xen.git
Version: 4.13.0
Outgoing License: GPL-2.0
License File: COPYING
Package Category: BSP
Type of Content: source
Description and comments: A Virtual Machine Monitor
Release Location: https://source.codeaurora.org/external/imx/imx-xen -b rel_imx_5.10.35_2.1.0
Origin: NXP (GPL-2.0)
--------------------------------------------
Package: imx-smw.git
Version: 0.1
Outgoing License: BSD-3-Clause

View File

@ -162,14 +162,9 @@ OPTEE_BOOT_IMAGE_mx6 ?= "tee.bin uTee-${OPTEE_BIN_EXT}"
OPTEE_BOOT_IMAGE_mx7 ?= "tee.bin uTee-${OPTEE_BIN_EXT}"
OPTEE_BOOT_IMAGE_mx8 ?= "tee.bin"
IMAGE_BOOT_FILES_append = " \
${@bb.utils.contains('COMBINED_FEATURES', 'xen', 'xen', '', d)} \
"
IMAGE_INSTALL_append = " \
${@bb.utils.contains('COMBINED_FEATURES', 'jailhouse', 'jailhouse', '', d)} \
${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'packagegroup-fsl-optee-imx', '', d)} \
${@bb.utils.contains('COMBINED_FEATURES', 'xen', 'imx-xen xen-tools', '', d)} \
"
# To add a new array override for a specific machine, like for UBOOT_CONFIG,
@ -319,7 +314,7 @@ IMAGE_BOOT_FILES_append_imx8mq-evk = " \
"
# Overrides for imx8qm-mek.conf
MACHINE_FEATURES_append_imx8qm-mek = " xen nxp8997"
MACHINE_FEATURES_append_imx8qm-mek = " nxp8997"
RDEPENDS_${KERNEL_PACKAGE_NAME}-image_imx8qm-mek = ""
IMXBOOT_TARGETS_SD_prepend_imx8qm-mek = \
"${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'flash_linux_m4', \

View File

@ -1,38 +0,0 @@
Xen
---
For any issues with the Xen recipes please make sure you CC:
christopher.w.clark@gmail.com
cardoe@gentoo.org
configuring the hypervisor
--------------------------
Since 4.7.0 Xen supports using Kconfig to configure the hypervisor. Similarly
to how the recipe for busybox works, you can provide a .config as a defconfig
to override the default configuration of the hypervisor. The easiest way
for you to take advantage of this is to create a .config for Xen and then
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.
Configuration fragments are also supported. To use them you need to list the
.cfg files in the SRC_URI.
security patches
----------------
The base recipe does not include security fixes that the Xen community releases
as XSAs (http://xenbits.xen.org/xsa/). The easiest way to include those is to
drop patches in 'recipes-extened/xen/files' and create a bbappend adding those
patches to SRC_URI and they will be applied. Alternatively, you can override
the SRC_URI to a git repo you provide that contains the patches.

View File

@ -1,66 +0,0 @@
From d79dcc2002008c58683de82f06c168d6eea57991 Mon Sep 17 00:00:00 2001
From: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
Date: Fri, 19 Oct 2018 11:01:37 +0200
Subject: [PATCH] python,pygrub: pass DISTUTILS env vars as setup.py args
Allow to respect the target install dir (PYTHON_SITEPACKAGES_DIR)
as well as other parameters set by the OpenEmbedded build system.
This is especially useful when the target libdir is not the default one
(/usr/lib), but for example /usr/lib64.
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>
Forward-ported to Xen 4.14.0
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,17 @@ INSTALL_LOG = build/installed_files.txt
all: build
.PHONY: build
build:
- CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build
+ CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build $(DISTUTILS_BUILD_ARGS)
.PHONY: install
install: all
$(INSTALL_DIR) $(DESTDIR)/$(bindir)
CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) \
setup.py install --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
- --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/tools/python/Makefile b/tools/python/Makefile
index 541858e..4d4a344 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -10,7 +10,7 @@ INSTALL_LOG = build/installed_files.txt
.PHONY: build
build:
- CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build
+ CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build $(DISTUTILS_BUILD_ARGS)
.PHONY: install
install:
@@ -18,7 +18,7 @@ install:
CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) \
setup.py install --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
- --root="$(DESTDIR)" --force
+ --root="$(DESTDIR)" --force $(DISTUTILS_INSTALL_ARGS)
$(INSTALL_PYTHON_PROG) scripts/convert-legacy-stream $(DESTDIR)$(LIBEXEC_BIN)
$(INSTALL_PYTHON_PROG) scripts/verify-stream-v2 $(DESTDIR)$(LIBEXEC_BIN)

View File

@ -1,26 +0,0 @@
From 9cff3bf8425ccc593825fcde8ca5eaa32a43d04d Mon Sep 17 00:00:00 2001
From: Bruce Ashfield <bruce.ashfield@gmail.com>
Date: Thu, 18 Jun 2020 09:05:22 -0400
Subject: [PATCH] xen/build: temporarily inhibit Werror
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Rebased on Xen 4.14:
Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
tools/libxl/Makefile | 2 +-
xen/Rules.mk | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 6da342ed61..c67560e269 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -11,7 +11,7 @@ MINOR = 0
XLUMAJOR = 4.14
XLUMINOR = 0
-CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-Wno-declaration-after-statement -Wformat-nonliteral
CFLAGS += -I. -fPIC

View File

@ -1,50 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Christopher Clark <christopher.w.clark@gmail.com>
Date: Fri, 26 June 2020 16:34:00 -0800
Subject: [PATCH] xen: implement atomic op to fix arm64 compilation
Xen's ARM implementation of arch_fetch_and_add since f9cc3cd9
uses a builtin, despite the build being performed with -fno-builtin.
With gcc 10.1.0, this now breaks prelinking spinlock.c, so
implement the one atomic operation that is required with logic
derived from Linux's atomic_ll_sc.h: ATOMIC_FETCH_OP and comparison with
the binary produced with and without the patch with gcc 9.2.0.
Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
index e5d062667d..c46dd3ac71 100644
--- a/xen/include/asm-arm/system.h
+++ b/xen/include/asm-arm/system.h
@@ -55,7 +55,32 @@ static inline int local_abort_is_enabled(void)
return !(flags & PSR_ABT_MASK);
}
+#ifdef CONFIG_ARM_64
+
+/* see atomic_ll_sc.h: ATOMIC_FETCH_OP(name, mb, acq, rel, cl, op, asm_op, constraint) */
+static inline int arch_fetch_and_add(unsigned int *ptr, unsigned long i)
+{
+ int register lptr asm("x0");
+ int register result asm("w1");
+ int register newval asm("w2");
+ int register status asm("w3");
+
+ asm volatile(
+ " mov %[lptr], %[ptr]\n"
+ "1: ldxr %w[result], [%[lptr]]\n"
+ " add %w[newval], %w[result], %w[i]\n"
+ " stlxr %w[status], %w[newval], [%[lptr]]\n"
+ " cbnz %w[status], 1b\n"
+ " dmb ish\n"
+ : [result] "=&r" (result), [lptr] "=&r" (lptr), [newval] "=&r" (newval), [status] "=&r" (status), [i] "+r" (i), "+Q" (*ptr)
+ : [ptr] "r" (ptr), "r" (i)
+ : "memory");
+
+ return result;
+}
+#else
#define arch_fetch_and_add(x, v) __sync_fetch_and_add(x, v)
+#endif
extern struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next);

View File

@ -1,22 +0,0 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
require xen.inc
require xen-hypervisor.inc
SRCBRANCH = "lf-5.10.y_4.13"
XEN_SRC ?= "git://source.codeaurora.org/external/imx/imx-xen.git;protocol=https"
LIC_FILES_CHKSUM ?= "file://COPYING;md5=4295d895d4b5ce9d070263d52f030e49"
SRC_URI = " \
${XEN_SRC};branch=${SRCBRANCH} \
file://xen-arm64-implement-atomic-fetch-add.patch \
"
SRCREV = "f538d6cef34515fedb923a10774766f15487d2ab"
S = "${WORKDIR}/git"
FILES_${PN}-scripts-common += " ${sysconfdir}/xen/*.cfg"
COMPATIBLE_MACHINE = "(mx8qm)"

View File

@ -1,18 +0,0 @@
valid_xen_archs = " \
x86_64 x86_32 \
arm32 arm64 \
"
def map_xen_arch(a, d):
import re
valid_archs = d.getVar('valid_xen_archs').split()
if re.match("i.86", a): return "x86_32"
elif re.match("x86.64", a): return "x86_64"
elif re.match("arm.*", a): return "arm32"
elif re.match("aarch64.*", a): return "arm64"
elif a in valid_archs: return a
else:
return "INVALID"

View File

@ -1,76 +0,0 @@
# 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 \
"

View File

@ -1,100 +0,0 @@
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.
# 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 cml1
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
# Handle the config fragments
cfgs="${@' '.join(find_cfgs(d))}"
if [ -n "${cfgs}" ]; then
# If .config is not present generate one in order
# to use the merge_config.sh
if [ ! -f "${S}/xen/.config" ] ; then
oe_runmake -C ${S}/xen defconfig
fi
${S}/xen/tools/kconfig/merge_config.sh -m -O \
${S}/xen ${S}/xen/.config "${cfgs}"
fi
}
do_compile() {
oe_runmake xen PYTHON="${PYTHON}"
}
do_install() {
oe_runmake DESTDIR="${D}" install-xen
}
do_deploy() {
install -d ${DEPLOYDIR}
if [ -f ${B}/xen/xen ]; then
install -m 0644 ${B}/xen/xen ${DEPLOYDIR}/xen
fi
if [ -f ${B}/xen/xen.gz ]; then
install -m 0644 ${B}/xen/xen.gz ${DEPLOYDIR}/xen.gz
fi
if [ -f ${B}/xen/xen.efi ]; then
install -m 0644 ${B}/xen/xen.efi ${DEPLOYDIR}/xen.efi
fi
}
# 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
do_devshell[depends] += "ncurses-native:do_populate_sysroot"
# Pass the native library path for kconfig build when running the do_menuconfig
# task
CROSS_CURSES_LIB += "-L${STAGING_LIBDIR_NATIVE}"
# Specify the root dir of the .config file for do_menuconfig and do_diffconfig
# tasks
KCONFIG_CONFIG_ROOTDIR = "${S}/xen"

View File

@ -1,841 +0,0 @@
SUMMARY = "Xen hypervisor tools"
DESCRIPTION = "Tools and utility software for the Xen hypervisor"
COMPATIBLE_HOST = 'i686-.*-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
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 \
${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 = ""
# Qemu is necessary on ARM platforms, and to support HVM guests on x86
QEMU = "${@bb.utils.contains('PACKAGECONFIG', 'hvm', 'qemu', '', d)}"
QEMU_arm = "qemu"
QEMU_aarch64 = "qemu"
RRECOMMENDS_${PN} = " \
${QEMU} \
${@bb.utils.contains('PACKAGECONFIG', 'hvm', 'seabios', '', d)} \
${@bb.utils.contains('PACKAGECONFIG', 'externalblktap', '', '${BLKTAP_RRECOMMENDS}', d)} \
${PN}-flask \
${PN}-hvmloader \
${PN}-libxenhypfs \
${PN}-shim \
${PN}-ucode \
${PN}-vchan \
${PN}-xenpaging \
${PN}-xenhypfs \
"
RDEPENDS_${PN}-devd = " \
${PN}-xl \
"
RDEPENDS_${PN}-fsimage = " \
libext2fs \
"
RDEPENDS_${PN}-misc = " \
perl \
python3 \
${PN}-xencov \
"
RSUGGESTS_${PN}-misc = " \
${PN}-xencons \
${PN}-xenpvnetboot \
"
RDEPENDS_${PN}-python = " \
python3 \
"
RDEPENDS_${PN}-pygrub = " \
python3 \
${PN}-python \
"
RDEPENDS_${PN}-remus = "bash"
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 \
"
RSUGGESTS_${PN}-scripts-network = "\
ifupdown \
"
RSUGGESTS_${PN}-xencov = "${PN}-xencov-split"
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}-xenhypfs = " \
${PN}-libxenhypfs \
"
RDEPENDS_${PN}-xl = "libgcc"
RDEPENDS_${PN}-xenmon = " \
python3 \
"
RSUGGESTS_${PN}-xentrace = "${PN}-xentrace-format"
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}-libxenhypfs \
${PN}-libxenhypfs-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}-ucode \
${PN}-vchan \
${PN}-volatiles \
${PN}-xcutils \
${PN}-xencommons \
${PN}-xencov \
${PN}-xend \
${PN}-xend-examples \
${PN}-xendomains \
${PN}-xenhypfs \
${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}/${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 \
${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}/${PYTHON_DIR}/dist-packages/.debug \
${libdir}/${PYTHON_DIR}/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}-libxenhypfs = "${libdir}/libxenhypfs.so.*"
FILES_${PN}-libxenhypfs-dev = " \
${libdir}/libxenhypfs.so \
${libdir}/pkgconfig/xenhypfs.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/**/[a-z]*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}/xen-detect \
${libdir}/xen/bin/depriv-fd-checker \
${sbindir}/gtracestat \
${sbindir}/gtraceview \
${sbindir}/xen-bugtool \
${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}/${PYTHON_DIR} \
"
FILES_${PN}-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}-ucode = "\
${sbindir}/xen-ucode \
"
FILES_${PN}-vchan = "\
${bindir}/vchan-socket-proxy \
"
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}-xencov = "\
${sbindir}/xencov \
"
FILES_${PN}-xend-examples = "\
${sysconfdir}/xen/xend-config.sxp \
${sysconfdir}/xen/xend-pci-permissive.sxp \
${sysconfdir}/xen/xend-pci-quirks.sxp \
"
FILES_${PN}-xenhypfs = "\
${sbindir}/xenhypfs \
"
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_setsize \
${libdir}/xen/bin/xenctx \
${bindir}/xenalyze \
${sbindir}/xentrace \
${sbindir}/xentrace_setsize \
${sbindir}/xentrace_setmask \
"
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}/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"
# 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 = ""
EXTRA_OECONF += " \
--with-systemd=${systemd_unitdir}/system \
--with-systemd-modules-load=${systemd_unitdir}/modules-load.d \
--with-initddir=${INIT_D_DIR} \
--with-sysconfig-leaf-dir=default \
--with-system-qemu=${bindir}/qemu-system-i386 \
"
do_configure() {
do_configure_common
if [ -n '${ADD_SYSROOT32_CFLAGS}' ] ; then
echo '${ADD_SYSROOT32_CFLAGS}' >>"${S}/tools/firmware/Rules.mk"
fi
}
do_compile() {
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 \
${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
fi
}
# 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

View File

@ -1,21 +0,0 @@
SRCREV ?= "8c4532f19d6925538fb0c938f7de9a97da8c5c3b"
XEN_REL ?= "4.15"
XEN_BRANCH ?= "master"
SRC_URI = " \
git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
file://0001-python-pygrub-pass-DISTUTILS-xen-4.14.patch \
file://0001-xen-build-temporarily-inhibit-Werror-4.14.patch \
"
LIC_FILES_CHKSUM ?= "file://COPYING;md5=419739e325a50f3d7b4501338e44a4e5"
PV = "${XEN_REL}+git${SRCPV}"
S = "${WORKDIR}/git"
DEFAULT_PREFERENCE ??= "-1"
require xen.inc
require xen-tools.inc

View File

@ -1,234 +0,0 @@
HOMEPAGE = "http://xen.org"
LICENSE = "GPLv2"
SECTION = "console/tools"
inherit autotools-brokensep
require xen-arch.inc
PACKAGECONFIG ??= " \
sdl \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
${@bb.utils.contains('XEN_TARGET_ARCH', 'x86_64', 'hvm', '', d)} \
"
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)} \
bison-native \
flex-native \
file-native \
gettext-native \
acpica-native \
ncurses-native \
util-linux-native \
xz-native \
bridge-utils \
curl \
dtc \
gettext \
glib-2.0 \
gnutls \
iproute2 \
libnl \
ncurses \
openssl \
pciutils \
pixman \
procps \
python3 \
libaio \
lzo \
util-linux \
xz \
yajl \
zlib \
gnu-efi \
"
#### REQUIRED ENVIRONMENT VARIABLES ####
export BUILD_SYS
export HOST_SYS
export STAGING_INCDIR
export STAGING_LIBDIR
# specify xen hypervisor to build/target
export XEN_TARGET_ARCH = "${@map_xen_arch(d.getVar('TARGET_ARCH'), d)}"
export XEN_COMPILE_ARCH = "${@map_xen_arch(d.getVar('BUILD_ARCH'), d)}"
python () {
if d.getVar('XEN_TARGET_ARCH') == 'INVALID':
raise bb.parse.SkipPackage('Cannot map `%s` to a xen architecture' % d.getVar('TARGET_ARCH'))
}
# Yocto appends ${PN} to libexecdir by default and Xen appends 'xen' as well
# the result is a nested xen/xen/ so let's avoid that by shunning Yocto's
# extra ${PN} appended.
libexecdir = "${libdir}"
# hardcoded as Linux, as the only compatible hosts are Linux.
export XEN_OS = "Linux"
# this is used for the header (#!${bindir}/python) of the install python scripts
export PYTHONPATH="${bindir}/env python3"
export ac_cv_path_PYTHONPATH="${bindir}/env python3"
export DISTUTILS_BUILD_ARGS
export DISTUTILS_INSTALL_ARGS
# xen and seabios require HOSTCC and HOSTCXX set to cross-compile
export HOSTCC="${BUILD_CC}"
export HOSTCXX="${BUILD_CXX}"
# make xen requires CROSS_COMPILE set by hand as it does not abide by ./configure
export CROSS_COMPILE="${TARGET_PREFIX}"
# overide LDFLAGS to allow xen to build without: "x86_64-oe-linux-ld: unrecognized option '-Wl,-O1'"
export LDFLAGS=""
# 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} ${CC_REPRODUCIBLE_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} ${CC_REPRODUCIBLE_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}"
EXTRA_OECONF += " \
--exec-prefix=${prefix} \
--prefix=${prefix} \
--host=${HOST_SYS} \
--disable-stubdom \
--disable-ioemu-stubdom \
--disable-pv-grub \
--disable-xenstore-stubdom \
--disable-rombios \
--disable-ocamltools \
--disable-qemu-traditional \
"
EXTRA_OEMAKE += "STDVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.7a.bin"
EXTRA_OEMAKE += "CIRRUSVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.7a.cirrus.bin"
EXTRA_OEMAKE += "SEABIOS_ROM=${STAGING_DIR_HOST}/usr/share/firmware/bios.bin"
EXTRA_OEMAKE += "ETHERBOOT_ROMS=${STAGING_DIR_HOST}/usr/share/firmware/rtl8139.rom"
# prevent the Xen build scripts from fetching things during the build
# all dependencies should be reflected in the Yocto recipe
EXTRA_OEMAKE += "WGET=/bin/false"
EXTRA_OEMAKE += "GIT=/bin/false"
# Improve build reproducibility: provide values for build variables.
def get_build_time_vars(d):
source_date_epoch = d.getVar('SOURCE_DATE_EPOCH')
if source_date_epoch is not None:
import datetime
utc_datetime = datetime.datetime.utcfromtimestamp(float(source_date_epoch))
return " XEN_BUILD_DATE=" + utc_datetime.strftime("%Y-%m-%d") + \
" XEN_BUILD_TIME=" + utc_datetime.strftime("%H:%M:%S")
return ""
EXTRA_OEMAKE += "${@['', 'XEN_WHOAMI=${PF} XEN_DOMAIN=${DISTRO} XEN_BUILD_HOST=${PN}-buildhost'] \
[d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}${@get_build_time_vars(d)}"
# Improve build reproducibility: compiler flags to remove filesystem differences.
CC_REPRODUCIBLE_OPTIONS = "${@['', '-gno-record-gcc-switches ' + \
'-ffile-prefix-map=${S}=${PN}-source ' + \
'-fdebug-prefix-map=${WORKDIR}=${PN}'] \
[d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}"
# check for XSM in package config to allow XSM_ENABLE to be set
python () {
pkgconfig = d.getVar('PACKAGECONFIG')
if ('xsm') in pkgconfig.split():
d.setVar('XSM_ENABLED', '1')
else:
d.setVar('XSM_ENABLED', '0')
}
do_post_patch() {
# fixup AS/CC/CCP/etc variable within StdGNU.mk
for i in LD CC CPP CXX; do
sed -i "s/^\($i\s\s*\).*=/\1?=/" ${S}/config/StdGNU.mk
done
# fixup environment passing in some makefiles
sed -i 's#\(\w*\)=\(\$.\w*.\)#\1="\2"#' ${S}/tools/firmware/Makefile
# libsystemd-daemon -> libsystemd for newer systemd versions
sed -i 's#libsystemd-daemon#libsystemd#' ${S}/tools/configure
# Improve build reproducibility: disable insertion of the build timestamp
# into the x86 EFI hypervisor binary.
# binutils should allow a user-supplied timestamp or use SOURCE_DATE_EPOCH
# for PE but currently does not.
if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ] ; then
sed '/^EFI_LDFLAGS = /{a EFI_LDFLAGS += --no-insert-timestamp
}' -i "${S}/xen/arch/x86/Makefile"
fi
}
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))" >> ${S}/xen/arch/arm/Rules.mk
echo "CPP := \$(filter-out ${TUNE_CCARGS},\$(CPP))" >> ${S}/xen/arch/arm/Rules.mk
}
addtask post_patch after do_patch before do_configure
# Allow all hypervisor settings in a defconfig
EXTRA_OEMAKE += "XEN_CONFIG_EXPERT=y"
# Build release versions always. Technically since we track release
# tarballs this always happens but occasionally people pull in patches
# from staging that reverts this
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
echo "XSM_ENABLE := y" > ${S}/.config
fi
if [ -f "${WORKDIR}/defconfig" ]; then
cp "${WORKDIR}/defconfig" "${S}/xen/.config" || \
bbfatal "Unable to copy defconfig to .config"
fi
unset CFLAGS
# do configure
oe_runconf EXTRA_CFLAGS_XEN_CORE="${EXTRA_CFLAGS_XEN_CORE}" \
EXTRA_CFLAGS_XEN_TOOLS="${EXTRA_CFLAGS_XEN_TOOLS}" \
PYTHON="${PYTHON}"
}
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
}
do_install_prepend() {
# CFLAGS is used to set PY_CFLAGS which affects the pygrub install
# so also need to unset CFLAGS here:
unset CFLAGS
}