From 545461ba2f97f065791e3d4ed22342eba2836d48 Mon Sep 17 00:00:00 2001 From: Christopher Clark Date: Tue, 25 Feb 2020 16:15:54 -0800 Subject: xen: separate recipes for hypervisor and tools; switch to git as source 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 Signed-off-by: Bruce Ashfield --- recipes-extended/xen/xen-hypervisor.inc | 94 +++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 recipes-extended/xen/xen-hypervisor.inc (limited to 'recipes-extended/xen/xen-hypervisor.inc') diff --git a/recipes-extended/xen/xen-hypervisor.inc b/recipes-extended/xen/xen-hypervisor.inc new file mode 100644 index 00000000..c0df1580 --- /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 -- cgit v1.2.3-54-g00ecf