diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 14:59:38 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 16:43:32 +0000 |
commit | d849ec78de728ef9a2d383b92ccfeabf40f8f1d0 (patch) | |
tree | 3f856aa8d0f07fb207894822f4ba5db495ce0b1b /import-layers/meta-virtualization/recipes-extended | |
parent | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (diff) | |
download | talos-openbmc-d849ec78de728ef9a2d383b92ccfeabf40f8f1d0.tar.gz talos-openbmc-d849ec78de728ef9a2d383b92ccfeabf40f8f1d0.zip |
Squashed 'import-layers/meta-virtualization/' content from commit c4a1711
Change-Id: I42132e4f0aef12ec265e74d95f489a6409e22f46
git-subtree-dir: import-layers/meta-virtualization
git-subtree-split: c4a1711dd31659b027c70c07e4ef6da98591ac95
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/meta-virtualization/recipes-extended')
39 files changed, 3044 insertions, 0 deletions
diff --git a/import-layers/meta-virtualization/recipes-extended/dev86/dev86_0.16.20.bb b/import-layers/meta-virtualization/recipes-extended/dev86/dev86_0.16.20.bb new file mode 100644 index 000000000..38dbf8d4b --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/dev86/dev86_0.16.20.bb @@ -0,0 +1,38 @@ +DESCRIPTION = "This is a cross development C compiler, assembler and linker environment for the production of 8086 executables (Optionally MSDOS COM)" +HOMEPAGE = "http://www.debath.co.uk/dev86/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" +SECTION = "console/tools" +PR="r0" + +SRC_URI="http://v3.sk/~lkundrak/dev86/archive/Dev86src-${PV}.tar.gz" + +SRC_URI[md5sum] = "567cf460d132f9d8775dd95f9208e49a" +SRC_URI[sha256sum] = "61817a378c8c8ba65f36c6792d457a305dc4eedae8cdc8b6233bf2bb28e5fe8d" + +S = "${WORKDIR}/dev86-${PV}" + +BBCLASSEXTEND = "native" +EXTRA_OEMAKE = "VERSION=${PV} PREFIX=${prefix} DIST=${D}" + +do_compile() { + + oe_runmake make.fil + oe_runmake -f make.fil bcc86 as86 ld86 + +} + +do_install() { + + if [ "${prefix}"=="" ] ; then + export prefix=/usr + fi + + oe_runmake install-bcc + ln -s ../lib/bcc/bcc-cpp ${D}${prefix}/bin/bcc-cpp + ln -s ../lib/bcc/bcc-cc1 ${D}${prefix}/bin/bcc-cc1 + +} +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" +FILES_${PN} += "${libdir}/bcc" +INSANE_SKIP_${PN} = "already-stripped" diff --git a/import-layers/meta-virtualization/recipes-extended/iasl/iasl_20120215.bb b/import-layers/meta-virtualization/recipes-extended/iasl/iasl_20120215.bb new file mode 100644 index 000000000..5ce093007 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/iasl/iasl_20120215.bb @@ -0,0 +1,29 @@ +DESCRIPTION = "This is a cross development C compiler, assembler and linker environment for the production of 8086 executables (Optionally MSDOS COM)" +HOMEPAGE = "http://www.acpica.org/" +LICENSE = "Intel-ACPI" +LIC_FILES_CHKSUM = "file://asldefine.h;endline=115;md5=d4d7cf809b8b5e03131327b3f718e8f0" +SECTION = "console/tools" +PR="r1" + +DEPENDS="flex bison" + +SRC_URI="https://acpica.org/sites/acpica/files/acpica-unix-${PV}.tar.gz" + +SRC_URI[md5sum] = "324c89e5bb9002e2711e0494290ceacc" +SRC_URI[sha256sum] = "b2b497415f29ddbefe7be8b9429b62c1f1f6e1ec11456928e4e7da86578e5b8d" + +S="${WORKDIR}/acpica-unix-${PV}/source/compiler" + +NATIVE_INSTALL_WORKS = "1" +BBCLASSEXTEND = "native" + +do_compile() { + CFLAGS="-Wno-error=redundant-decls" $MAKE +} + +do_install() { + mkdir -p ${D}${prefix}/bin + cp ${S}/iasl ${D}${prefix}/bin +} + + diff --git a/import-layers/meta-virtualization/recipes-extended/images/cloud-image-compute.bb b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-compute.bb new file mode 100644 index 000000000..197624f92 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-compute.bb @@ -0,0 +1,14 @@ +IMAGE_FEATURES += "ssh-server-openssh" +EXTRA_IMAGE_FEATURES = "tools-debug debug-tweaks" + +IMAGE_INSTALL = "\ + ${CORE_IMAGE_BASE_INSTALL} \ + packagegroup-core-basic \ + openvswitch \ + libvirt \ + openflow \ + " + +inherit core-image + +IMAGE_FSTYPES = "tar.gz" diff --git a/import-layers/meta-virtualization/recipes-extended/images/cloud-image-controller.bb b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-controller.bb new file mode 100644 index 000000000..0b2a67b58 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-controller.bb @@ -0,0 +1,34 @@ +IMAGE_FEATURES += "ssh-server-openssh package-management" +EXTRA_IMAGE_FEATURES = "tools-debug debug-tweaks" + +IMAGE_INSTALL = "\ + ${CORE_IMAGE_BASE_INSTALL} \ + ${ROOTFS_PKGMANAGE_BOOTSTRAP} \ + packagegroup-core-basic \ + openvswitch \ + openvswitch-controller \ + openvswitch-switch \ + openvswitch-brcompat \ + criu \ + libvirt \ + libvirt-libvirtd \ + libvirt-python \ + libvirt-virsh \ + openflow \ + qemu \ + kernel-modules \ + dhcp-client \ + perl-modules \ + grub \ + mysql5 \ + python-twisted \ + python-lxml \ + " + +inherit core-image +inherit image-vm + +IMAGE_FSTYPES = "vmdk tar.gz" + +# Ensure extra space for guest images +#IMAGE_ROOTFS_EXTRA_SPACE = "41943040" diff --git a/import-layers/meta-virtualization/recipes-extended/images/cloud-image-guest.bb b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-guest.bb new file mode 100644 index 000000000..e24bf0d49 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-guest.bb @@ -0,0 +1,18 @@ +IMAGE_FEATURES += "ssh-server-openssh package-management" +EXTRA_IMAGE_FEATURES = "tools-debug debug-tweaks" + +IMAGE_INSTALL = "\ + ${CORE_IMAGE_BASE_INSTALL} \ + ${ROOTFS_PKGMANAGE_BOOTSTRAP} \ + packagegroup-core-basic \ + openflow \ + qemu \ + kernel-modules \ + tcpdump \ + dhcp-client \ + " + +inherit core-image +inherit image-vm + +IMAGE_FSTYPES += "vmdk" diff --git a/import-layers/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb b/import-layers/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb new file mode 100644 index 000000000..c96edca7d --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb @@ -0,0 +1,23 @@ +DESCRIPTION = "A minimal kvm image" + +IMAGE_INSTALL = " \ + packagegroup-core-boot \ + ${ROOTFS_PKGMANAGE_BOOTSTRAP} \ + qemu \ + libvirt \ + libvirt-libvirtd \ + libvirt-virsh \ + kernel-module-kvm \ + kernel-module-kvm-intel \ + kernel-module-kvm-amd \ + " + +IMAGE_FEATURES += "ssh-server-openssh" + +IMAGE_LINGUAS = " " + +LICENSE = "MIT" + +inherit core-image + +IMAGE_ROOTFS_SIZE = "8192" diff --git a/import-layers/meta-virtualization/recipes-extended/images/xen-bootimg.inc b/import-layers/meta-virtualization/recipes-extended/images/xen-bootimg.inc new file mode 100644 index 000000000..093aa683d --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/images/xen-bootimg.inc @@ -0,0 +1,35 @@ +SYSLINUX_TIMEOUT = "10" +SYSLINUX_LABEL = "boot" +SYSLINUX_XEN_APPEND = "dom0_mem=1048576" +SYSLINUX_KERNEL_APPEND = "ramdisk_size=32768 root=/dev/ram0 rw console=tty0 console=ttyS0,115200n8" +#LABELS_append = " ${SYSLINUX_LABEL} " + +INITRD = "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.cpio.lzma" + +do_bootimg[depends] += "${IMAGE_BASENAME}:do_rootfs" + +inherit bootimg + +syslinux_populate_append() { + install -m 0444 ${STAGING_LIBDIR}/syslinux/mboot.c32 ${HDDDIR}${SYSLINUXDIR}/mboot.c32 +} + +grubefi_populate_append() { + install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}${EFIDIR}/xen.gz +} + +populate_append() { + install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}/xen.gz +} + +build_syslinux_cfg() { + echo ALLOWOPTIONS 1 > ${SYSLINUXCFG} + echo SERIAL 0 115200 > ${SYSLINUXCFG} + echo DEFAULT ${SYSLINUX_LABEL} >> ${SYSLINUXCFG} + echo TIMEOUT ${SYSLINUX_TIMEOUT} >> ${SYSLINUXCFG} + echo PROMPT 1 >> ${SYSLINUXCFG} + echo LABEL ${SYSLINUX_LABEL} >> ${SYSLINUXCFG} + echo KERNEL mboot.c32 >> ${SYSLINUXCFG} + echo APPEND xen.gz ${SYSLINUX_XEN_APPEND} --- vmlinuz ${SYSLINUX_KERNEL_APPEND} --- initrd >> ${SYSLINUXCFG} +} + diff --git a/import-layers/meta-virtualization/recipes-extended/images/xen-guest-image-minimal.bb b/import-layers/meta-virtualization/recipes-extended/images/xen-guest-image-minimal.bb new file mode 100644 index 000000000..f13940ce4 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/images/xen-guest-image-minimal.bb @@ -0,0 +1,16 @@ +DESCRIPTION = "A Xen guest image." + +inherit core-image + +IMAGE_INSTALL += " \ + packagegroup-core-boot \ + ${@bb.utils.contains('MACHINE_FEATURES', 'acpi', 'kernel-module-xen-acpi-processor', '', d)} \ + " + +IMAGE_INSTALL += "${@base_contains('DISTRO_FEATURES', 'x11', ' xf86-video-fbdev', '', d)}" +IMAGE_INSTALL += "${@base_contains('DISTRO_FEATURES', 'x11', ' xf86-video-vesa', '', d)}" + +LICENSE = "MIT" + +# Send console messages to xen console +APPEND += "console=hvc0" diff --git a/import-layers/meta-virtualization/recipes-extended/images/xen-image-minimal.bb b/import-layers/meta-virtualization/recipes-extended/images/xen-image-minimal.bb new file mode 100644 index 000000000..26b6d0654 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/images/xen-image-minimal.bb @@ -0,0 +1,53 @@ +DESCRIPTION = "A minimal xen image" + +INITRD_IMAGE = "core-image-minimal-initramfs" + +IMAGE_INSTALL += " \ + packagegroup-core-boot \ + packagegroup-core-ssh-openssh \ + ${@bb.utils.contains('MACHINE_FEATURES', 'acpi', 'kernel-module-xen-acpi-processor', '', d)} \ + kernel-module-xen-blkback \ + kernel-module-xen-gntalloc \ + kernel-module-xen-gntdev \ + kernel-module-xen-netback \ + ${@bb.utils.contains('MACHINE_FEATURES', 'pci', 'kernel-module-xen-pciback', '', d)} \ + kernel-module-xen-wdt \ + xen-base \ + qemu \ + " + +LICENSE = "MIT" + +inherit core-image + +syslinux_iso_populate_append() { + install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${ISODIR}${ISOLINUXDIR} + install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${ISODIR}${ISOLINUXDIR} +} + +syslinux_hddimg_populate_append() { + install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${HDDDIR}${SYSLINUXDIR} + install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${HDDDIR}${SYSLINUXDIR} +} + +grubefi_populate_append() { + install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}${EFIDIR}/xen.gz +} + +populate_append() { + install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}/xen.gz +} + +SYSLINUX_XEN_ARGS ?= "loglvl=all guest_loglvl=all console=com1,vga com1=115200,8n1" +SYSLINUX_KERNEL_ARGS ?= "ramdisk_size=32768 root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 LABEL=boot debugshell=5" + +build_syslinux_cfg () { + echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG} + echo "DEFAULT boot" >> ${SYSLINUXCFG} + echo "TIMEOUT 10" >> ${SYSLINUXCFG} + echo "PROMPT 1" >> ${SYSLINUXCFG} + echo "LABEL boot" >> ${SYSLINUXCFG} + echo " KERNEL mboot.c32" >> ${SYSLINUXCFG} + echo " APPEND /xen.gz ${SYSLINUX_XEN_ARGS} --- /vmlinuz ${SYSLINUX_KERNEL_ARGS} --- /initrd" >> ${SYSLINUXCFG} +} + diff --git a/import-layers/meta-virtualization/recipes-extended/iptables/iptables_1.%.bbappend b/import-layers/meta-virtualization/recipes-extended/iptables/iptables_1.%.bbappend new file mode 100644 index 000000000..52a4c4fe7 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/iptables/iptables_1.%.bbappend @@ -0,0 +1,8 @@ +RRECOMMENDS_${PN} += "kernel-module-ip6-tables \ + kernel-module-ip6table-filter \ + kernel-module-xt-tcpudp \ + kernel-module-ipt-reject \ + kernel-module-iptable-mangle \ + kernel-module-xt-checksum \ + kernel-module-xt-state \ + " diff --git a/import-layers/meta-virtualization/recipes-extended/ipxe/ipxe_git.bb b/import-layers/meta-virtualization/recipes-extended/ipxe/ipxe_git.bb new file mode 100644 index 000000000..d52c5675f --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/ipxe/ipxe_git.bb @@ -0,0 +1,31 @@ +DESCRIPTION = "Open source network boot firmware" +HOMEPAGE = "http://ipxe.org" +LICENSE = "GPLv2" +DEPENDS = "binutils-native perl-native syslinux mtools-native cdrtools-native" +LIC_FILES_CHKSUM = "file://../COPYING;md5=8ca43cbc842c2336e835926c2166c28b" + +SRCREV = "8c43891db4eb131d019360ccfb619f235b17eb58" +PV = "gitr${SRCPV}" +PR = "r0" + +SRC_URI = "git://git.ipxe.org/ipxe.git;protocol=git" + +FILES_${PN} = "/usr/share/firmware/*.rom" + +EXTRA_OEMAKE = "NO_WERROR=1" +#PARALLEL_MAKE="" + +S = "${WORKDIR}/git/src" + +do_configure() { + sed -i s#^ISOLINUX_BIN[\ \\t]*=.*#ISOLINUX_BIN\ =\ ${STAGING_DIR_TARGET}/usr/lib/syslinux/isolinux.bin# arch/i386/Makefile +} + +do_compile() { + oe_runmake +} + +do_install() { + install -d ${D}/usr/share/firmware + install ${S}/bin/*.rom ${D}/usr/share/firmware/ +} diff --git a/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance.inc b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance.inc new file mode 100644 index 000000000..53275d121 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance.inc @@ -0,0 +1,47 @@ +# +# Copyright (C) 2013 Wind River Systems, Inc. +# +SUMMARY = "IRQ allocation daemon" +DESCRIPTION = "A daemon to balance interrupts across multiple CPUs, \ +which can lead to better performance and IO balance on SMP systems." + +HOMEPAGE = "http://code.google.com/p/irqbalance/" +BUGTRACKER = "http://code.google.com/p/irqbalance/issues/list" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://irqbalance.c;beginline=6;endline=8;md5=b94e153694672307b503b1bc87dc9e24 \ + " + +DEPENDS = "glib-2.0" + +INITSCRIPT_NAME = "irqbalanced" +INITSCRIPT_PARAMS = "defaults" + +inherit autotools update-rc.d pkgconfig systemd + +SYSTEMD_PACKAGES = "irqbalance" +SYSTEMD_SERVICE_irqbalance = "irqbalanced.service" + +EXTRA_OECONF = "--program-transform-name= \ + " + +# let the recipes or appends define options +# +PACKAGECONFIG ?= "" + +# enable,disable,depends,rdepends +# +PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl," +PACKAGECONFIG[libcap-ng] = "--with-libcap-ng,--without-libcap-ng,libcap-ng," + +do_install () { + oe_runmake 'DESTDIR=${D}' install + install -d ${D}${sysconfdir}/init.d + cat ${S}/irqbalance.init | sed -e's,/usr/sbin,${sbindir},g' > ${D}${sysconfdir}/init.d/irqbalanced + chmod 755 ${D}${sysconfdir}/init.d/irqbalanced + + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/irqbalanced.service ${D}${systemd_unitdir}/system + sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/irqbalanced.service +} diff --git a/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/add-initscript.patch b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/add-initscript.patch new file mode 100644 index 000000000..46a75a86f --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/add-initscript.patch @@ -0,0 +1,47 @@ +irqbalance: add basic init script + +The upstream irqbalance release package does not contain an +init script so we create a basic one here. + +Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> +--- +Index: irqbalance-0.56/irqbalance.init +=================================================================== +--- /dev/null ++++ irqbalance-0.56/irqbalance.init +@@ -0,0 +1,35 @@ ++#!/bin/sh ++# ++# Copyright (c) 2012 Wind River Systems, Inc. ++# ++### BEGIN INIT INFO ++# Provides: irqbalance ++# Required-Start: ++# Required-Stop: ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 ++# Short-Description: IRQ allocation daemon ++### END INIT INFO ++ ++case "$1" in ++ start) ++ echo -n "Starting irqbalance: " ++ start-stop-daemon -S -b -n irqbalance -a /usr/sbin/irqbalance ++ echo "done" ++ ;; ++ stop) ++ echo -n "Shutting down irqbalance: " ++ start-stop-daemon -K -n irqbalance ++ echo "done" ++ ;; ++ restart) ++ $0 stop ++ $0 start ++ ;; ++ *) ++ echo "Usage: $0 {start | stop | restart}" >&2 ++ exit 1 ++ ;; ++esac ++ ++exit 0 diff --git a/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/fix-configure-libcap-ng.patch b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/fix-configure-libcap-ng.patch new file mode 100644 index 000000000..5be52434b --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/fix-configure-libcap-ng.patch @@ -0,0 +1,24 @@ +Subject: [PATCH] grasp withval for libcap-ng + +Upstream-Status: Pending + +Signed-off-by: Ming Liu <ming.liu@windriver.com> +--- + configure.ac | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff -urpN a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -61,7 +61,10 @@ AS_IF( + AM_CONDITIONAL([LOCAL_GLIB], [test "x$local_glib2" = "xyes"]) + + AC_ARG_WITH([libcap-ng], +- AS_HELP_STRING([libcap-ng], [Add libcap-ng-support @<:@default=auto@:>@])) ++ [AS_HELP_STRING([libcap-ng], [Add libcap-ng-support @<:@default=auto@:>@])], ++ [libcap_ng=$withval], ++ [libcap_ng=$withval] ++) + + AS_IF( + [test "x$libcap_ng" != "xno"], diff --git a/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalance-Add-status-and-reload-commands.patch b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalance-Add-status-and-reload-commands.patch new file mode 100644 index 000000000..d853d0b4a --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalance-Add-status-and-reload-commands.patch @@ -0,0 +1,55 @@ +From dc7366896dd5a5bae82be4b11530bc9fdb7cbcdd Mon Sep 17 00:00:00 2001 +From: Yang Shi <yang.shi@windriver.com> +Date: Mon, 26 Aug 2013 10:58:02 -0700 +Subject: [PATCH] irqbalance: Add status and reload commands + +Add status and reload commands for irqbalanced init script + +Signed-off-by: Yang Shi <yang.shi@windriver.com> +--- + irqbalance.init | 12 +++++++++--- + 1 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/irqbalance.init b/irqbalance.init +index d12d62c..f58bf55 100644 +--- a/irqbalance.init ++++ b/irqbalance.init +@@ -1,6 +1,6 @@ + #!/bin/sh + # +-# Copyright (c) 2012 Wind River Systems, Inc. ++# Copyright (c) 2013 Wind River Systems, Inc. + # + ### BEGIN INIT INFO + # Provides: irqbalance +@@ -11,6 +11,8 @@ + # Short-Description: IRQ allocation daemon + ### END INIT INFO + ++. /etc/init.d/functions ++ + case "$1" in + start) + echo -n "Starting irqbalance: " +@@ -22,12 +24,16 @@ case "$1" in + start-stop-daemon -K -n irqbalance + echo "done" + ;; +- restart) ++ restart|reload) + $0 stop + $0 start + ;; ++ status) ++ status irqbalance ++ echo "done" ++ ;; + *) +- echo "Usage: $0 {start | stop | restart}" >&2 ++ echo "Usage: $0 {start | stop | restart | reload | status}" >&2 + exit 1 + ;; + esac +-- +1.7.5.4 + diff --git a/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalanced.service b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalanced.service new file mode 100644 index 000000000..5b284faa6 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalanced.service @@ -0,0 +1,9 @@ +[Unit] +Description=irqbalance daemon +After=syslog.target + +[Service] +ExecStart=@SBINDIR@/irqbalance --foreground + +[Install] +WantedBy=multi-user.target diff --git a/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance_1.1.0.bb b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance_1.1.0.bb new file mode 100644 index 000000000..16efa9506 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance_1.1.0.bb @@ -0,0 +1,15 @@ +# +# Copyright (C) 2015 Wind River Systems, Inc. +# + +require irqbalance.inc + +SRC_URI[md5sum] = "b15d975336080bcac4be0c1752d43cf3" +SRC_URI[sha256sum] = "91506e638b03bf27cf5da7dc250d58a753ce8a0288a20265fc7ff0266040706b" + +SRC_URI = "https://github.com/Irqbalance/irqbalance/archive/v${PV}.tar.gz;downloadfilename=irqbalance-${PV}.tar.gz \ + file://add-initscript.patch \ + file://irqbalance-Add-status-and-reload-commands.patch \ + file://fix-configure-libcap-ng.patch \ + file://irqbalanced.service \ + " diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-1.3.2/0001-to-fix-build-error.patch b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-1.3.2/0001-to-fix-build-error.patch new file mode 100644 index 000000000..089ee330e --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-1.3.2/0001-to-fix-build-error.patch @@ -0,0 +1,46 @@ +From 8353dc1e642011199c3b3ba057d51d8768e4cd54 Mon Sep 17 00:00:00 2001 +From: Lei Maohui <leimaohui@cn.fujitsu.com> +Date: Fri, 31 Jul 2015 03:17:07 +0900 +Subject: [PATCH] to fix build error + +The error likes as following + +| Generating internals/command.html.tmp +| /bin/sh: line 3: internals/command.html.tmp: No such file or directory +| rm: Generating internals/locking.html.tmp +| cannot remove `internals/command.html.tmp': No such file or directory +| make[3]: *** [internals/command.html.tmp] Error 1 +| make[3]: *** Waiting for unfinished jobs.... + +Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com> +[ywei: rebased to libvirt-1.3.2] +Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com> +--- + docs/Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/docs/Makefile.am b/docs/Makefile.am +index 1b4353b..c199551 100644 +--- a/docs/Makefile.am ++++ b/docs/Makefile.am +@@ -164,7 +164,7 @@ EXTRA_DIST= \ + todo.pl hvsupport.pl todo.cfg-example \ + $(schema_DATA) + +-acl_generated = aclperms.htmlinc ++acl.html:: $(srcdir)/aclperms.htmlinc + + $(srcdir)/aclperms.htmlinc: $(top_srcdir)/src/access/viraccessperm.h \ + $(srcdir)/genaclperms.pl Makefile.am +@@ -221,7 +221,7 @@ $(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl $(api_DATA) \ + convert -rotate 90 $< $@ + + %.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \ +- sitemap.html.in $(acl_generated) ++ sitemap.html.in + @if [ -x $(XSLTPROC) ] ; then \ + echo "Generating $@"; \ + name=`echo $@ | sed -e 's/.tmp//'`; \ +-- +1.9.1 + diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-python.inc b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-python.inc new file mode 100644 index 000000000..c1dafe9dc --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt-python.inc @@ -0,0 +1,55 @@ +inherit pythonnative python-dir + +export STAGING_INCDIR +export STAGING_LIBDIR +export BUILD_SYS +export HOST_SYS + +RDEPENDS_${PN}-python += "python" +PACKAGECONFIG_${PN}-python[xen] = ",,,xen-python" + +PACKAGES += "${PN}-python-staticdev ${PN}-python-dev ${PN}-python-dbg ${PN}-python" + +FILES_${PN}-python-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" +FILES_${PN}-python-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" +FILES_${PN}-python-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/" +FILES_${PN}-python = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" + +SRC_URI += "http://libvirt.org/sources/python/libvirt-python-${PV}.tar.gz;name=libvirt_python" +SRC_URI += "file://libvirt_api_xml_path.patch;patchdir=../libvirt-python-${PV}" + +SRC_URI[libvirt_python.md5sum] = "ed018c714d7ddbe93221c796dff283ed" +SRC_URI[libvirt_python.sha256sum] = "6d35ae9e7801573393b9c92471f39e6700d479f10b641df81d041b469f160bf8" + +export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml" +export LIBVIRT_CFLAGS = "-I${S}/include" +export LIBVIRT_LIBS = "-L${B}/src/.libs -lvirt -ldl" +export LDFLAGS="-L${B}/src/.libs" + +LIBVIRT_INSTALL_ARGS = "--root=${D} \ + --prefix=${prefix} \ + --install-lib=${PYTHON_SITEPACKAGES_DIR} \ + --install-data=${datadir}" + +python __anonymous () { + pkgconfig = d.getVar('PACKAGECONFIG', True) + if ('python') in pkgconfig.split(): + d.setVar('LIBVIRT_PYTHON_ENABLE', '1') + else: + d.setVar('LIBVIRT_PYTHON_ENABLE', '0') +} + +do_compile_append() { + if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then + cd ${WORKDIR}/libvirt-python-${PV} && \ + ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build + fi +} + +do_install_append() { + if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then + cd ${WORKDIR}/${PN}-python-${PV} && \ + ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install \ + --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS} + fi +} diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch new file mode 100644 index 000000000..16c3a16bc --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch @@ -0,0 +1,64 @@ +From dd915e7f70e676aea93f750c75d16ce646e71e4b Mon Sep 17 00:00:00 2001 +From: Mark Asselstine <mark.asselstine@windriver.com> +Date: Wed, 9 Sep 2015 11:52:44 -0400 +Subject: [PATCH] Revert "build: add $(prefix) to SYSTEMD_UNIT_DIR" + +This reverts upstream commit 00e9d6071b2450659ce01bc984f64ecb5d7ba62d +with minor context changes to allow it to apply. + +Yocto based builds use /lib/systemd/system for systemd unit files and +since upstream has chosen to use a mechanism for setting +SYSTEMD_UNIT_DIR which is not flexible we have to resort to reverting +this upstream commit to avoid having ${prefix} added to the path. + +Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> +[ywei: rebased to libvirt-1.3.2] +Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com> +--- + daemon/Makefile.am | 2 +- + src/Makefile.am | 2 +- + tools/Makefile.am | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/daemon/Makefile.am b/daemon/Makefile.am +index 2dbe81b..41ea2db 100644 +--- a/daemon/Makefile.am ++++ b/daemon/Makefile.am +@@ -445,7 +445,7 @@ endif ! LIBVIRT_INIT_SCRIPT_UPSTART + + if LIBVIRT_INIT_SCRIPT_SYSTEMD + +-SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system ++SYSTEMD_UNIT_DIR = /lib/systemd/system + BUILT_SOURCES += libvirtd.service libvirtd.socket + + install-init-systemd: install-sysconfig libvirtd.service libvirtd.socket +diff --git a/src/Makefile.am b/src/Makefile.am +index a316b4d..d271291 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -2594,7 +2594,7 @@ EXTRA_DIST += \ + if WITH_LIBVIRTD + if LIBVIRT_INIT_SCRIPT_SYSTEMD + +-SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system ++SYSTEMD_UNIT_DIR = /lib/systemd/system + + BUILT_SOURCES += virtlockd.service virtlockd.socket \ + virtlogd.service virtlogd.socket +diff --git a/tools/Makefile.am b/tools/Makefile.am +index b3227a7..0e58f73 100644 +--- a/tools/Makefile.am ++++ b/tools/Makefile.am +@@ -356,7 +356,7 @@ libvirt-guests.init: libvirt-guests.init.in libvirt-guests.sh + + + EXTRA_DIST += libvirt-guests.service.in +-SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system ++SYSTEMD_UNIT_DIR = /lib/systemd/system + + if LIBVIRT_INIT_SCRIPT_SYSTEMD + install-systemd: libvirt-guests.service install-sysconfig libvirt-guests.sh +-- +1.9.1 + diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch new file mode 100644 index 000000000..558d5ef65 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch @@ -0,0 +1,63 @@ +From ad5d9cee87357f9f38f62583119606ef95ba10df Mon Sep 17 00:00:00 2001 +From: Bogdan Purcareata <bogdan.purcareata@freescale.com> +Date: Fri, 24 May 2013 16:46:00 +0300 +Subject: [PATCH] Fix thread safety in LXC callback handling + +Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> +--- + src/lxc/lxc_process.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c +index aaa81a7..0eadc67 100644 +--- a/src/lxc/lxc_process.c ++++ b/src/lxc/lxc_process.c +@@ -609,8 +609,13 @@ static void virLXCProcessMonitorExitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED + virLXCProtocolExitStatus status, + virDomainObjPtr vm) + { ++ virLXCDriverPtr driver = lxc_driver; + virLXCDomainObjPrivatePtr priv = vm->privateData; + ++ lxcDriverLock(driver); ++ virObjectLock(vm); ++ lxcDriverUnlock(driver); ++ + switch (status) { + case VIR_LXC_PROTOCOL_EXIT_STATUS_SHUTDOWN: + priv->stopReason = VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN; +@@ -628,6 +633,8 @@ static void virLXCProcessMonitorExitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED + } + VIR_DEBUG("Domain shutoff reason %d (from status %d)", + priv->stopReason, status); ++ ++ virObjectUnlock(vm); + } + + /* XXX a little evil */ +@@ -636,12 +643,21 @@ static void virLXCProcessMonitorInitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED + pid_t initpid, + virDomainObjPtr vm) + { +- virLXCDomainObjPrivatePtr priv = vm->privateData; ++ virLXCDriverPtr driver = lxc_driver; ++ virLXCDomainObjPrivatePtr priv; ++ ++ lxcDriverLock(driver); ++ virObjectLock(vm); ++ lxcDriverUnlock(driver); ++ ++ priv = vm->privateData; + priv->initpid = initpid; + virDomainAuditInit(vm, initpid); + + if (virDomainSaveStatus(lxc_driver->caps, lxc_driver->stateDir, vm) < 0) + VIR_WARN("Cannot update XML with PID for LXC %s", vm->def->name); ++ ++ virObjectUnlock(vm); + } + + static virLXCMonitorCallbacks monitorCallbacks = { +-- +1.7.11.7 + diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirt-use-pkg-config-to-locate-libcap.patch b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirt-use-pkg-config-to-locate-libcap.patch new file mode 100644 index 000000000..65b046eea --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirt-use-pkg-config-to-locate-libcap.patch @@ -0,0 +1,45 @@ +From 3e271f6db12ffe34843428ec2f0bca7a8fe3aa65 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@windriver.com> +Date: Wed, 8 Apr 2015 13:03:03 -0400 +Subject: [PATCH] libvirt: use pkg-config to locate libcap + +libvirt wants to use pcap-config to locate the exisence and location +of libpcap. oe-core stubs this script and replaces it with pkg-config, +which can lead to the host pcap-config triggering and either breaking +the build or introducing host contamination. + +To fix this issue, we patch configure to use 'pkg-config libcap' to +locate the correct libraries. + +Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> +--- + configure.ac | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index f37047599b76..5f9b84363b96 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1553,7 +1553,7 @@ fi + AM_CONDITIONAL([HAVE_NUMAD], [test "$with_numad" != "no"]) + + dnl pcap lib +-LIBPCAP_CONFIG="pcap-config" ++LIBPCAP_CONFIG="pkg-config libpcap" + LIBPCAP_CFLAGS="" + LIBPCAP_LIBS="" + LIBPCAP_FOUND="no" +@@ -1563,8 +1563,8 @@ AC_ARG_WITH([libpcap], [AS_HELP_STRING([--with-libpcap=@<:@PFX@:>@], + if test "$with_qemu" = "yes"; then + case $with_libpcap in + no) LIBPCAP_CONFIG= ;; +- ''|yes) LIBPCAP_CONFIG="pcap-config" ;; +- *) LIBPCAP_CONFIG="$with_libpcap/bin/pcap-config" ;; ++ ''|yes) LIBPCAP_CONFIG="pkg-config libpcap" ;; ++ *) LIBPCAP_CONFIG="$with_libpcap/bin/pkg-config libpcap" ;; + esac + AS_IF([test "x$LIBPCAP_CONFIG" != "x"], [ + AC_MSG_CHECKING(libpcap $LIBPCAP_CONFIG >= $LIBPCAP_REQUIRED ) +-- +2.1.0 + diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch new file mode 100644 index 000000000..3c2622c72 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch @@ -0,0 +1,85 @@ +Adding support for LIBVIRT_CFLAGS and LIBVIRT_LIBS + +Signed-off-by: Amy Fong <amy.fong@windriver.com> + + +Adding a support for LIBVIRT_API_PATH evironment variable, which can +control where the script should look for the 'libvirt-api.xml' file. +This allows building libvirt-python against different libvirt than the +one installed in the system. This may be used for example in autotest +or by packagers without the need to install libvirt into the system. + +Signed-off-by: Martin Kletzander <mkletzan redhat com> +[ywei: rebased to 1.3.2] +Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com> +--- + setup.py | 25 ++++++++++++++++++++++--- + 1 file changed, 22 insertions(+), 3 deletions(-) + +Index: libvirt-python-1.2.4/setup.py +=================================================================== +--- libvirt-python-1.2.4.orig/setup.py ++++ libvirt-python-1.2.4/setup.py +@@ -40,13 +40,7 @@ + "libvirt"]) + + def have_libvirt_lxc(): +- try: +- spawn([get_pkgcfg(), +- "--atleast-version=%s" % MIN_LIBVIRT_LXC, +- "libvirt"]) +- return True +- except DistutilsExecError: +- return False ++ return True + + def get_pkgconfig_data(args, mod, required=True): + """Run pkg-config to and return content associated with it""" +@@ -68,7 +62,17 @@ + """Check with pkg-config that libvirt is present and extract + the API XML file paths we need from it""" + +- libvirt_api = get_pkgconfig_data(["--variable", "libvirt_api"], "libvirt") ++ libvirt_api = os.getenv("LIBVIRT_API_PATH") ++ ++ if libvirt_api: ++ if not libvirt_api.endswith("-api.xml"): ++ raise ValueError("Invalid path '%s' for API XML" % libvirt_api) ++ if not os.path.exists(libvirt_api): ++ raise ValueError("API XML '%s' does not exist, " ++ "have you built libvirt?" % libvirt_api) ++ else: ++ libvirt_api = get_pkgconfig_data(["--variable", "libvirt_api"], ++ "libvirt") + + offset = libvirt_api.index("-api.xml") + libvirt_qemu_api = libvirt_api[0:offset] + "-qemu-api.xml" +@@ -88,8 +92,17 @@ + + c_modules = [] + py_modules = [] +- ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False).split() +- cflags = get_pkgconfig_data(["--cflags"], "libvirt", False).split() ++ libvirt_cflags = os.getenv("LIBVIRT_CFLAGS") ++ if libvirt_cflags: ++ cflags = libvirt_cflags.split() ++ else: ++ cflags = get_pkgconfig_data(["--cflags"], "libvirt", False).split() ++ ++ libvirt_libs = os.getenv("LIBVIRT_LIBS") ++ if libvirt_libs: ++ ldflags = libvirt_libs.split() ++ else: ++ ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False).split() + + module = Extension('libvirtmod', + sources = ['libvirt-override.c', 'build/libvirt.c', 'typewrappers.c', 'libvirt-utils.c'], +@@ -138,7 +151,7 @@ + class my_build(build): + + def run(self): +- check_minimum_libvirt_version() ++# check_minimum_libvirt_version() + apis = get_api_xml_files() + + self.spawn([sys.executable, "generator.py", "libvirt", apis[0]]) diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirtd.conf b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirtd.conf new file mode 100644 index 000000000..c0462b47b --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirtd.conf @@ -0,0 +1,393 @@ +# Master libvirt daemon configuration file +# +# For further information consult http://libvirt.org/format.html +# +# NOTE: the tests/daemon-conf regression test script requires +# that each "PARAMETER = VALUE" line in this file have the parameter +# name just after a leading "#". + +################################################################# +# +# Network connectivity controls +# + +# Flag listening for secure TLS connections on the public TCP/IP port. +# NB, must pass the --listen flag to the libvirtd process for this to +# have any effect. +# +# It is necessary to setup a CA and issue server certificates before +# using this capability. +# +# This is enabled by default, uncomment this to disable it +listen_tls = 0 + +# Listen for unencrypted TCP connections on the public TCP/IP port. +# NB, must pass the --listen flag to the libvirtd process for this to +# have any effect. +# +# Using the TCP socket requires SASL authentication by default. Only +# SASL mechanisms which support data encryption are allowed. This is +# DIGEST_MD5 and GSSAPI (Kerberos5) +# +# This is disabled by default, uncomment this to enable it. +listen_tcp = 1 + + + +# Override the port for accepting secure TLS connections +# This can be a port number, or service name +# +#tls_port = "16514" + +# Override the port for accepting insecure TCP connections +# This can be a port number, or service name +# +#tcp_port = "16509" + + +# Override the default configuration which binds to all network +# interfaces. This can be a numeric IPv4/6 address, or hostname +# +#listen_addr = "192.168.0.1" + + +# Flag toggling mDNS advertizement of the libvirt service. +# +# Alternatively can disable for all services on a host by +# stopping the Avahi daemon +# +# This is enabled by default, uncomment this to disable it +#mdns_adv = 0 + +# Override the default mDNS advertizement name. This must be +# unique on the immediate broadcast network. +# +# The default is "Virtualization Host HOSTNAME", where HOSTNAME +# is subsituted for the short hostname of the machine (without domain) +# +#mdns_name = "Virtualization Host Joe Demo" + + +################################################################# +# +# UNIX socket access controls +# + +# Set the UNIX domain socket group ownership. This can be used to +# allow a 'trusted' set of users access to management capabilities +# without becoming root. +# +# This is restricted to 'root' by default. +#unix_sock_group = "libvirt" + +# Set the UNIX socket permissions for the R/O socket. This is used +# for monitoring VM status only +# +# Default allows any user. If setting group ownership may want to +# restrict this to: +#unix_sock_ro_perms = "0777" + +# Set the UNIX socket permissions for the R/W socket. This is used +# for full management of VMs +# +# Default allows only root. If PolicyKit is enabled on the socket, +# the default will change to allow everyone (eg, 0777) +# +# If not using PolicyKit and setting group ownership for access +# control then you may want to relax this to: +#unix_sock_rw_perms = "0770" + +# Set the name of the directory in which sockets will be found/created. +#unix_sock_dir = "/var/run/libvirt" + +################################################################# +# +# Authentication. +# +# - none: do not perform auth checks. If you can connect to the +# socket you are allowed. This is suitable if there are +# restrictions on connecting to the socket (eg, UNIX +# socket permissions), or if there is a lower layer in +# the network providing auth (eg, TLS/x509 certificates) +# +# - sasl: use SASL infrastructure. The actual auth scheme is then +# controlled from /etc/sasl2/libvirt.conf. For the TCP +# socket only GSSAPI & DIGEST-MD5 mechanisms will be used. +# For non-TCP or TLS sockets, any scheme is allowed. +# +# - polkit: use PolicyKit to authenticate. This is only suitable +# for use on the UNIX sockets. The default policy will +# require a user to supply their own password to gain +# full read/write access (aka sudo like), while anyone +# is allowed read/only access. +# +# Set an authentication scheme for UNIX read-only sockets +# By default socket permissions allow anyone to connect +# +# To restrict monitoring of domains you may wish to enable +# an authentication mechanism here +#auth_unix_ro = "none" + +# Set an authentication scheme for UNIX read-write sockets +# By default socket permissions only allow root. If PolicyKit +# support was compiled into libvirt, the default will be to +# use 'polkit' auth. +# +# If the unix_sock_rw_perms are changed you may wish to enable +# an authentication mechanism here +#auth_unix_rw = "none" + +# Change the authentication scheme for TCP sockets. +# +# If you don't enable SASL, then all TCP traffic is cleartext. +# Don't do this outside of a dev/test scenario. For real world +# use, always enable SASL and use the GSSAPI or DIGEST-MD5 +# mechanism in /etc/sasl2/libvirt.conf +#auth_tcp = "sasl" + +# Change the authentication scheme for TLS sockets. +# +# TLS sockets already have encryption provided by the TLS +# layer, and limited authentication is done by certificates +# +# It is possible to make use of any SASL authentication +# mechanism as well, by using 'sasl' for this option +#auth_tls = "none" + + + +################################################################# +# +# TLS x509 certificate configuration +# + + +# Override the default server key file path +# +#key_file = "/etc/pki/libvirt/private/serverkey.pem" + +# Override the default server certificate file path +# +#cert_file = "/etc/pki/libvirt/servercert.pem" + +# Override the default CA certificate path +# +#ca_file = "/etc/pki/CA/cacert.pem" + +# Specify a certificate revocation list. +# +# Defaults to not using a CRL, uncomment to enable it +#crl_file = "/etc/pki/CA/crl.pem" + + + +################################################################# +# +# Authorization controls +# + + +# Flag to disable verification of our own server certificates +# +# When libvirtd starts it performs some sanity checks against +# its own certificates. +# +# Default is to always run sanity checks. Uncommenting this +# will disable sanity checks which is not a good idea +#tls_no_sanity_certificate = 1 + +# Flag to disable verification of client certificates +# +# Client certificate verification is the primary authentication mechanism. +# Any client which does not present a certificate signed by the CA +# will be rejected. +# +# Default is to always verify. Uncommenting this will disable +# verification - make sure an IP whitelist is set +#tls_no_verify_certificate = 1 + + +# A whitelist of allowed x509 Distinguished Names +# This list may contain wildcards such as +# +# "C=GB,ST=London,L=London,O=Red Hat,CN=*" +# +# See the POSIX fnmatch function for the format of the wildcards. +# +# NB If this is an empty list, no client can connect, so comment out +# entirely rather than using empty list to disable these checks +# +# By default, no DN's are checked +#tls_allowed_dn_list = ["DN1", "DN2"] + + +# A whitelist of allowed SASL usernames. The format for usernames +# depends on the SASL authentication mechanism. Kerberos usernames +# look like username@REALM +# +# This list may contain wildcards such as +# +# "*@EXAMPLE.COM" +# +# See the POSIX fnmatch function for the format of the wildcards. +# +# NB If this is an empty list, no client can connect, so comment out +# entirely rather than using empty list to disable these checks +# +# By default, no Username's are checked +#sasl_allowed_username_list = ["joe@EXAMPLE.COM", "fred@EXAMPLE.COM" ] + + + +################################################################# +# +# Processing controls +# + +# The maximum number of concurrent client connections to allow +# over all sockets combined. +#max_clients = 20 + + +# The minimum limit sets the number of workers to start up +# initially. If the number of active clients exceeds this, +# then more threads are spawned, upto max_workers limit. +# Typically you'd want max_workers to equal maximum number +# of clients allowed +#min_workers = 5 +#max_workers = 20 + + +# The number of priority workers. If all workers from above +# pool will stuck, some calls marked as high priority +# (notably domainDestroy) can be executed in this pool. +#prio_workers = 5 + +# Total global limit on concurrent RPC calls. Should be +# at least as large as max_workers. Beyond this, RPC requests +# will be read into memory and queued. This directly impact +# memory usage, currently each request requires 256 KB of +# memory. So by default upto 5 MB of memory is used +# +# XXX this isn't actually enforced yet, only the per-client +# limit is used so far +#max_requests = 20 + +# Limit on concurrent requests from a single client +# connection. To avoid one client monopolizing the server +# this should be a small fraction of the global max_requests +# and max_workers parameter +#max_client_requests = 5 + +################################################################# +# +# Logging controls +# + +# Logging level: 4 errors, 3 warnings, 2 information, 1 debug +# basically 1 will log everything possible +#log_level = 3 + +# Logging filters: +# A filter allows to select a different logging level for a given category +# of logs +# The format for a filter is: +# x:name +# where name is a match string e.g. remote or qemu +# the x prefix is the minimal level where matching messages should be logged +# 1: DEBUG +# 2: INFO +# 3: WARNING +# 4: ERROR +# +# Multiple filter can be defined in a single @filters, they just need to be +# separated by spaces. +# +# e.g: +# log_filters="3:remote 4:event" +# to only get warning or errors from the remote layer and only errors from +# the event layer. + +# Logging outputs: +# An output is one of the places to save logging information +# The format for an output can be: +# x:stderr +# output goes to stderr +# x:syslog:name +# use syslog for the output and use the given name as the ident +# x:file:file_path +# output to a file, with the given filepath +# In all case the x prefix is the minimal level, acting as a filter +# 1: DEBUG +# 2: INFO +# 3: WARNING +# 4: ERROR +# +# Multiple output can be defined, they just need to be separated by spaces. +# e.g.: +# log_outputs="3:syslog:libvirtd" +# to log all warnings and errors to syslog under the libvirtd ident + +# Log debug buffer size: default 64 +# The daemon keeps an internal debug log buffer which will be dumped in case +# of crash or upon receiving a SIGUSR2 signal. This setting allows to override +# the default buffer size in kilobytes. +# If value is 0 or less the debug log buffer is deactivated +#log_buffer_size = 64 + + +################################################################## +# +# Auditing +# +# This setting allows usage of the auditing subsystem to be altered: +# +# audit_level == 0 -> disable all auditing +# audit_level == 1 -> enable auditing, only if enabled on host (default) +# audit_level == 2 -> enable auditing, and exit if disabled on host +# +#audit_level = 2 +# +# If set to 1, then audit messages will also be sent +# via libvirt logging infrastructure. Defaults to 0 +# +#audit_logging = 1 + +################################################################### +# UUID of the host: +# Provide the UUID of the host here in case the command +# 'dmidecode -s system-uuid' does not provide a valid uuid. In case +# 'dmidecode' does not provide a valid UUID and none is provided here, a +# temporary UUID will be generated. +# Keep the format of the example UUID below. UUID must not have all digits +# be the same. + +# NB This default all-zeros UUID will not work. Replace +# it with the output of the 'uuidgen' command and then +# uncomment this entry +#host_uuid = "00000000-0000-0000-0000-000000000000" + +################################################################### +# Keepalive protocol: +# This allows libvirtd to detect broken client connections or even +# dead client. A keepalive message is sent to a client after +# keepalive_interval seconds of inactivity to check if the client is +# still responding; keepalive_count is a maximum number of keepalive +# messages that are allowed to be sent to the client without getting +# any response before the connection is considered broken. In other +# words, the connection is automatically closed approximately after +# keepalive_interval * (keepalive_count + 1) seconds since the last +# message received from the client. If keepalive_interval is set to +# -1, libvirtd will never send keepalive requests; however clients +# can still send them and the deamon will send responses. When +# keepalive_count is set to 0, connections will be automatically +# closed after keepalive_interval seconds of inactivity without +# sending any keepalive messages. +# +#keepalive_interval = 5 +#keepalive_count = 5 +# +# If set to 1, libvirtd will refuse to talk to clients that do not +# support keepalive protocol. Defaults to 0. +# +#keepalive_required = 1 diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirtd.sh b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirtd.sh new file mode 100755 index 000000000..29dbf3917 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/libvirtd.sh @@ -0,0 +1,103 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: libvirtd +# Required-Start: $local_fs $network dbus +# Required-Stop: $local_fs $network dbus +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +### END INIT INFO + +if [ -f /lib/lsb/init-functions ] +then + . /lib/lsb/init-functions +else + # int log_begin_message (char *message) + log_begin_msg () { + if [ -z "$1" ]; then + return 1 + fi + echo " * $@" + } + + # int log_end_message (int exitstatus) + log_end_msg () { + + # If no arguments were passed, return + [ -z "$1" ] && return 1 + + # Only do the fancy stuff if we have an appropriate terminal + # and if /usr is already mounted + TPUT=/usr/bin/tput + EXPR=/usr/bin/expr + if [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1; then + COLS=`$TPUT cols` + if [ -n "$COLS" ]; then + COL=`$EXPR $COLS - 7` + else + COL=73 + fi + UP=`$TPUT cuu1` + END=`$TPUT hpa $COL` + START=`$TPUT hpa 0` + RED=`$TPUT setaf 1` + NORMAL=`$TPUT op` + if [ $1 -eq 0 ]; then + echo "$UP$END[ ok ]" + else + echo -e "$UP$START $RED*$NORMAL$END[${RED}fail${NORMAL}]" + fi + else + if [ $1 -eq 0 ]; then + echo " ...done." + else + echo " ...fail!" + fi + fi + return $1 + } + + log_warning_msg () { + if log_use_fancy_output; then + YELLOW=`$TPUT setaf 3` + NORMAL=`$TPUT op` + echo "$YELLOW*$NORMAL $@" + else + echo "$@" + fi + } + +fi + +case "$1" in + start) + if [ -e /var/run/libvirtd.pid ]; then + if [ -d /proc/$(cat /var/run/libvirtd.pid) ]; then + echo "virtualization library already started; not starting." + else + echo "Removing stale PID file /var/run/libvirtd.pid." + rm -f /var/run/libvirtd.pid + fi + fi + log_begin_msg "Starting virtualization library daemon: libvirtd" + if [ ! -e /var/run/libvirtd.pid ]; then + start-stop-daemon -K -x /usr/bin/dnsmasq --pidfile /var/run/libvirt/network/default.pid + fi + start-stop-daemon --start --quiet --pidfile /var/run/libvirtd.pid --exec /usr/sbin/libvirtd -- --daemon --listen + log_end_msg $? + ;; + stop) + log_begin_msg "Stopping virtualization library daemon: libvirtd" + start-stop-daemon --stop --quiet --retry 3 --exec /usr/sbin/libvirtd --pidfile /var/run/libvirtd.pid + log_end_msg $? + rm -f /var/run/libvirtd.pid + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch new file mode 100644 index 000000000..3cf9e8392 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch @@ -0,0 +1,39 @@ +From 74bff2509080912ea8abf1de8fd95fa2412b659a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com> +Date: Thu, 11 Apr 2013 11:37:25 +0200 +Subject: [PATCH] qemu: fix crash in qemuOpen + +commit 74bff2509080912ea8abf1de8fd95fa2412b659a from upsteam +git://libvirt.org/libvirt.git + +If the path part of connection URI is not present, cfg is used +unitialized. + +https://bugzilla.redhat.com/show_bug.cgi?id=950855 +--- + src/qemu/qemu_driver.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 2c0d7d1..0d41e39 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -1026,6 +1026,7 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, + goto cleanup; + } + ++ cfg = virQEMUDriverGetConfig(qemu_driver); + if (conn->uri->path == NULL) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("no QEMU URI path given, try %s"), +@@ -1033,7 +1034,6 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, + goto cleanup; + } + +- cfg = virQEMUDriverGetConfig(qemu_driver); + if (cfg->privileged) { + if (STRNEQ(conn->uri->path, "/system") && + STRNEQ(conn->uri->path, "/session")) { +-- +1.7.1 + diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/run-ptest b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/run-ptest new file mode 100644 index 000000000..a434b186f --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +make -C tests -k check-TESTS diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/runptest.patch b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/runptest.patch new file mode 100644 index 000000000..a33f56950 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/runptest.patch @@ -0,0 +1,113 @@ +Add 'install-ptest' rule. +Change TESTS_ENVIRONMENT to allow running outside build dir. + +Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com> +Upstream-status: Pending + +Index: libvirt-1.2.4/tests/Makefile.am +=================================================================== +--- libvirt-1.2.4.orig/tests/Makefile.am ++++ libvirt-1.2.4/tests/Makefile.am +@@ -31,9 +31,11 @@ + -I$(top_srcdir)/src/conf \ + $(GETTEXT_CPPFLAGS) + ++PTEST_DIR ?= $(libdir)/libvirt/ptest ++ + AM_CFLAGS = \ +- -Dabs_builddir="\"$(abs_builddir)\"" \ +- -Dabs_srcdir="\"$(abs_srcdir)\"" \ ++ -Dabs_builddir="\"$(PTEST_DIR)/tests\"" \ ++ -Dabs_srcdir="\"$(PTEST_DIR)/tests\"" \ + $(LIBXML_CFLAGS) \ + $(LIBNL_CFLAGS) \ + $(GNUTLS_CFLAGS) \ +@@ -48,7 +50,7 @@ + + if WITH_DRIVER_MODULES + INCLUDES += \ +- -DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\" ++ -DTEST_DRIVER_DIR=\"$(PTEST_DIR)/src/.libs\" + endif WITH_DRIVER_MODULES + + PROBES_O = +@@ -409,20 +411,19 @@ + # Also, BSD sh doesn't like 'a=b b=$$a', so we can't use an + # intermediate shell variable, but must do all the expansion in make + +-lv_abs_top_builddir=$(shell cd '$(top_builddir)' && pwd) + path_add = $(subst :,$(PATH_SEPARATOR),\ +- $(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests)) ++ $(subst !,$(PTEST_DIR)/,!daemon:!tools:!tests)) + + VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT) + TESTS_ENVIRONMENT = \ +- abs_top_builddir=$(lv_abs_top_builddir) \ +- abs_top_srcdir=`cd '$(top_srcdir)'; pwd` \ +- abs_builddir=$(abs_builddir) \ +- abs_srcdir=$(abs_srcdir) \ +- CONFIG_HEADER="$(lv_abs_top_builddir)/config.h" \ ++ abs_top_builddir="$(PTEST_DIR)" \ ++ abs_top_srcdir="$(PTEST_DIR)" \ ++ abs_builddir="$(PTEST_DIR)/tests" \ ++ abs_srcdir="$(PTEST_DIR)/tests" \ ++ CONFIG_HEADER="$(PTEST_DIR)/config.h" \ + PATH="$(path_add)$(PATH_SEPARATOR)$$PATH" \ + SHELL="$(SHELL)" \ +- LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \ ++ LIBVIRT_DRIVER_DIR="$(PTEST_DIR)/src/.libs" \ + LIBVIRT_AUTOSTART=0 \ + LC_ALL=C \ + VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \ +@@ -1137,5 +1138,51 @@ + EXTRA_DIST += objectlocking.ml + endif ! WITH_CIL + ++buildtest-TESTS: $(TESTS) $(test_libraries) $(test_helpers) ++ ++PTESTS = $(TESTS) $(test_helpers) test-lib.sh schematestutils.sh ++ ++install-ptest: ++ list='$(TESTS) $(test_helpers) test-lib.sh schematestutils.sh' ++ install -d $(DEST_DIR)/tools ++ @(if [ -d ../tools/.libs ] ; then cd ../tools/.libs; fi; \ ++ install * $(DEST_DIR)/tools) ++ install -d $(DEST_DIR)/src/network ++ cp ../src/network/*.xml $(DEST_DIR)/src/network ++ install -d $(DEST_DIR)/src/cpu ++ cp ../src/cpu/*.xml $(DEST_DIR)/src/cpu ++ install ../src/libvirt_iohelper $(DEST_DIR)/src ++ install -D ../daemon/libvirtd $(DEST_DIR)/daemon/libvirtd ++ install -D ../daemon/libvirtd.conf $(DEST_DIR)/daemon/libvirtd.conf ++ @(if [ -d ../daemon/.libs ] ; then cd ../daemon/.libs; fi; \ ++ install * $(DEST_DIR)/daemon) ++ install -d $(DEST_DIR)/src/.libs ++ @(if [ -d ../src/.libs ] ; then cd ../src/.libs; fi; \ ++ install * $(DEST_DIR)/src/.libs) ++ install -d $(DEST_DIR)/docs/schemas ++ cp ../docs/schemas/*.rng $(DEST_DIR)/docs/schemas ++ cp -r ../build-aux $(DEST_DIR) ++ install -d $(DEST_DIR)/examples/xml ++ cp -r ../examples/xml/test $(DEST_DIR)/examples/xml ++ install -d $(DEST_DIR)/tests/.libs ++ find . -type d -name "*xml2xml*" -exec cp -r {} $(DEST_DIR)/tests \; ++ find . -type d -name "*data" -exec cp -r {} $(DEST_DIR)/tests \; ++ @(for file in $(PTESTS); do \ ++ if [ -f .libs/$$file ]; then \ ++ install .libs/$$file $(DEST_DIR)/tests; \ ++ else \ ++ install $$file $(DEST_DIR)/tests; \ ++ fi; \ ++ done;) ++ @(if [ -d .libs ]; then install .libs/*.so $(DEST_DIR)/tests/.libs; fi;) ++ cp ../config.h $(DEST_DIR) ++ cp Makefile $(DEST_DIR)/tests ++ sed -i -e 's/^Makefile:/_Makefile:/' $(DEST_DIR)/tests/Makefile ++ cp ../Makefile $(DEST_DIR) ++ sed -i -e 's|^Makefile:|_Makefile:|' $(DEST_DIR)/Makefile ++ sed -i -e 's|$(BUILD_DIR)|$(PTEST_DIR)|g' $(DEST_DIR)/tests/Makefile ++ sed -i -e 's|$(BUILD_DIR)|$(PTEST_DIR)|g' $(DEST_DIR)/Makefile ++ sed -i -e 's|^\(.*\.log:\) \(.*EXEEXT.*\)|\1|g' $(DEST_DIR)/tests/Makefile ++ + CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \ + objectlocking-files.txt diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/tests-allow-separated-src-and-build-dirs.patch b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/tests-allow-separated-src-and-build-dirs.patch new file mode 100644 index 000000000..3964865bf --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/tests-allow-separated-src-and-build-dirs.patch @@ -0,0 +1,57 @@ +From 884b6e3724b75cd92766d5386455983e3557a286 Mon Sep 17 00:00:00 2001 +From: Mark Asselstine <mark.asselstine@windriver.com> +Date: Fri, 2 May 2014 13:45:05 -0400 +Subject: [PATCH] tests: allow separated src and build dirs + +Fixup Makefile.am to search for static files back in srcdir. + +Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> +--- + tests/Makefile.am | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 0da514b..b8d7c19 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -1006,22 +1006,22 @@ install-ptest: + @(if [ -d ../tools/.libs ] ; then cd ../tools/.libs; fi; \ + install * $(DEST_DIR)/tools) + install -d $(DEST_DIR)/src/network +- cp ../src/network/*.xml $(DEST_DIR)/src/network ++ cp $(top_srcdir)/src/network/*.xml $(DEST_DIR)/src/network + install -d $(DEST_DIR)/src/cpu +- cp ../src/cpu/*.xml $(DEST_DIR)/src/cpu ++ cp $(top_srcdir)/src/cpu/*.xml $(DEST_DIR)/src/cpu + install ../src/libvirt_iohelper $(DEST_DIR)/src + install -D ../daemon/libvirtd $(DEST_DIR)/daemon/libvirtd +- install -D ../daemon/libvirtd.conf $(DEST_DIR)/daemon/libvirtd.conf ++ install -D $(top_srcdir)/daemon/libvirtd.conf $(DEST_DIR)/daemon/libvirtd.conf + @(if [ -d ../daemon/.libs ] ; then cd ../daemon/.libs; fi; \ + install * $(DEST_DIR)/daemon) + install -d $(DEST_DIR)/src/.libs + @(if [ -d ../src/.libs ] ; then cd ../src/.libs; fi; \ + install * $(DEST_DIR)/src/.libs) + install -d $(DEST_DIR)/docs/schemas +- cp ../docs/schemas/*.rng $(DEST_DIR)/docs/schemas +- cp -r ../build-aux $(DEST_DIR) ++ cp $(top_srcdir)/docs/schemas/*.rng $(DEST_DIR)/docs/schemas ++ cp -r $(top_srcdir)/build-aux $(DEST_DIR) + install -d $(DEST_DIR)/examples/xml +- cp -r ../examples/xml/test $(DEST_DIR)/examples/xml ++ cp -r $(top_srcdir)/examples/xml/test $(DEST_DIR)/examples/xml + install -d $(DEST_DIR)/tests/.libs + find . -type d -name "*xml2xml*" -exec cp -r {} $(DEST_DIR)/tests \; + find . -type d -name "*data" -exec cp -r {} $(DEST_DIR)/tests \; +@@ -1029,7 +1029,7 @@ install-ptest: + if [ -f .libs/$$file ]; then \ + install .libs/$$file $(DEST_DIR)/tests; \ + else \ +- install $$file $(DEST_DIR)/tests; \ ++ install $(srcdir)/$$file $(DEST_DIR)/tests; \ + fi; \ + done;) + @(if [ -d .libs ]; then install .libs/*.so $(DEST_DIR)/tests/.libs; fi;) +-- +1.8.3.2 + diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch new file mode 100644 index 000000000..a7fc727b7 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch @@ -0,0 +1,89 @@ +From a790bfe8fa7b24b68cb6f9a1b7205fda2c6d558e Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@windriver.com> +Date: Fri, 2 Aug 2013 11:38:43 -0400 +Subject: [PATCH] tools: add libvirt-net-rpc to virt-host-validate when TLS is + enabled + +When gnu-tls is enabled for libvirt references to virNetTLSInit are +generated in libvirt. Any binaries linking against libvirt, must also +link against libvirt-net-rpc which provides the implementation. + +Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> +[ywei: rebased to libvirt-1.3.2] +Signed-off-by: Yunguo Wei <yunguo.wei@windriver.com> +--- + examples/Makefile.am | 19 +++++++++++++++++++ + tools/Makefile.am | 13 +++++++++++++ + 2 files changed, 32 insertions(+) + +diff --git a/examples/Makefile.am b/examples/Makefile.am +index 2adcefb..fff49d4 100644 +--- a/examples/Makefile.am ++++ b/examples/Makefile.am +@@ -39,6 +39,10 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir) \ + LDADD = $(STATIC_BINARIES) $(WARN_CFLAGS) $(COVERAGE_LDFLAGS) \ + $(top_builddir)/src/libvirt.la $(top_builddir)/gnulib/lib/libgnu.la + ++if WITH_GNUTLS ++LDADD += $(top_builddir)/src/libvirt-net-rpc.la ++endif ++ + noinst_PROGRAMS=dominfo/info1 dommigrate/dommigrate domsuspend/suspend \ + domtop/domtop hellolibvirt/hellolibvirt object-events/event-test \ + openauth/openauth rename/rename +@@ -52,6 +56,21 @@ object_events_event_test_SOURCES = object-events/event-test.c + openauth_openauth_SOURCES = openauth/openauth.c + rename_rename_SOURCES = rename/rename.c + ++if WITH_GNUTLS ++dominfo_info1_LDADD = $(top_builddir)/src/libvirt-net-rpc.la \ ++ $(LDADD) \ ++ $(NULL) ++domsuspend_suspend_LDADD = $(top_builddir)/src/libvirt-net-rpc.la \ ++ $(LDADD) \ ++ $(NULL) ++hellolibvirt_hellolibvirt_LDADD = $(top_builddir)/src/libvirt-net-rpc.la \ ++ $(LDADD) \ ++ $(NULL) ++openauth_openauth_LDADD = $(top_builddir)/src/libvirt-net-rpc.la \ ++ $(LDADD) \ ++ $(NULL) ++endif ++ + if WITH_APPARMOR_PROFILES + apparmordir = $(sysconfdir)/apparmor.d/ + apparmor_DATA = \ +diff --git a/tools/Makefile.am b/tools/Makefile.am +index 0be3567..b3227a7 100644 +--- a/tools/Makefile.am ++++ b/tools/Makefile.am +@@ -169,6 +169,13 @@ virt_host_validate_LDADD = \ + ../gnulib/lib/libgnu.la \ + $(NULL) + ++if WITH_GNUTLS ++virt_host_validate_LDADD += ../src/libvirt-net-rpc.la \ ++ ../gnulib/lib/libgnu.la \ ++ $(NULL) ++endif ++ ++ + virt_host_validate_CFLAGS = \ + $(LIBXML_CFLAGS) \ + $(WARN_CFLAGS) \ +@@ -256,6 +263,12 @@ virt_admin_CFLAGS = \ + $(READLINE_CFLAGS) + BUILT_SOURCES = + ++if WITH_GNUTLS ++virsh_LDADD += ../src/libvirt-net-rpc.la \ ++ ../gnulib/lib/libgnu.la \ ++ $(NULL) ++endif ++ + if WITH_WIN_ICON + virsh_LDADD += virsh_win_icon.$(OBJEXT) + +-- +1.9.1 + diff --git a/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt_1.3.2.bb b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt_1.3.2.bb new file mode 100644 index 000000000..42066c1fe --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt_1.3.2.bb @@ -0,0 +1,287 @@ +DESCRIPTION = "A toolkit to interact with the virtualization capabilities of recent versions of Linux." +HOMEPAGE = "http://libvirt.org" +LICENSE = "LGPLv2.1+" +LICENSE_${PN}-ptest = "GPLv2+ & LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.LESSER;md5=4b54a1fd55a448865a0b32d41598759d" +SECTION = "console/tools" +PR = "r1" + +DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \ + iptables dnsmasq readline libtasn1 libxslt-native" + +# libvirt-guests.sh needs gettext.sh +# +RDEPENDS_${PN} = "gettext-runtime" + +RDEPENDS_${PN}-ptest += "make gawk" + +RDEPENDS_libvirt-libvirtd += "bridge-utils iptables pm-utils dnsmasq netcat-openbsd" +RDEPENDS_libvirt-libvirtd_append_x86-64 = " dmidecode" +RDEPENDS_libvirt-libvirtd_append_x86 = " dmidecode" + +#connman blocks the 53 port and libvirtd can't start its DNS service +RCONFLICTS_${PN}_libvirtd = "connman" + +SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz;name=libvirt \ + file://tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch \ + file://libvirtd.sh \ + file://libvirtd.conf \ + file://runptest.patch \ + file://run-ptest \ + file://tests-allow-separated-src-and-build-dirs.patch \ + file://libvirt-use-pkg-config-to-locate-libcap.patch \ + file://0001-to-fix-build-error.patch \ + file://Revert-build-add-prefix-to-SYSTEMD_UNIT_DIR.patch \ + " + +SRC_URI[libvirt.md5sum] = "b48b06bbc7efbe9973ed0f3f223d6da2" +SRC_URI[libvirt.sha256sum] = "e3c6fc2683178660b371efb3ac7a1103a3f4b78efac7ffe560bc5917974ccf05" + +inherit autotools gettext update-rc.d pkgconfig ptest systemd + +CACHED_CONFIGUREVARS += "\ +ac_cv_path_XMLLINT=/usr/bin/xmllint \ +ac_cv_path_XMLCATLOG=/usr/bin/xmlcatalog \ +ac_cv_path_AUGPARSE=/usr/bin/augparse \ +ac_cv_path_DNSMASQ=/usr/bin/dnsmasq \ +ac_cv_path_BRCTL=/usr/sbin/brctl \ +ac_cv_path_TC=/sbin/tc \ +ac_cv_path_UDEVADM=/sbin/udevadm \ +ac_cv_path_MODPROBE=/sbin/modprobe \ +ac_cv_path_IP_PATH=/bin/ip \ +ac_cv_path_IPTABLES_PATH=/usr/sbin/iptables \ +ac_cv_path_IP6TABLES_PATH=/usr/sbin/ip6tables \ +ac_cv_path_MOUNT=/bin/mount \ +ac_cv_path_UMOUNT=/bin/umount \ +ac_cv_path_MKFS=/usr/sbin/mkfs \ +ac_cv_path_SHOWMOUNT=/usr/sbin/showmount \ +ac_cv_path_PVCREATE=/usr/sbin/pvcreate \ +ac_cv_path_VGCREATE=/usr/sbin/vgcreate \ +ac_cv_path_LVCREATE=/usr/sbin/lvcreate \ +ac_cv_path_PVREMOVE=/usr/sbin/pvremove \ +ac_cv_path_VGREMOVE=/usr/sbin/vgremove \ +ac_cv_path_LVREMOVE=/usr/sbin/lvremove \ +ac_cv_path_LVCHANGE=/usr/sbin/lvchange \ +ac_cv_path_VGCHANGE=/usr/sbin/vgchange \ +ac_cv_path_VGSCAN=/usr/sbin/vgscan \ +ac_cv_path_PVS=/usr/sbin/pvs \ +ac_cv_path_VGS=/usr/sbin/vgs \ +ac_cv_path_LVS=/usr/sbin/lvs \ +ac_cv_path_PARTED=/usr/sbin/parted \ +ac_cv_path_DMSETUP=/usr/sbin/dmsetup" + +# Ensure that libvirt uses polkit rather than policykit, whether the host has +# pkcheck installed or not, and ensure the path is correct per our config. +CACHED_CONFIGUREVARS += "ac_cv_path_PKCHECK_PATH=${bindir}/pkcheck" + +# Some other possible paths we are not yet setting +#ac_cv_path_RPCGEN= +#ac_cv_path_XSLTPROC= +#ac_cv_path_RADVD= +#ac_cv_path_UDEVSETTLE= +#ac_cv_path_EBTABLES_PATH= +#ac_cv_path_PKG_CONFIG= +#ac_cv_path_ac_pt_PKG_CONFIG +#ac_cv_path_POLKIT_AUTH= +#ac_cv_path_DTRACE= +#ac_cv_path_ISCSIADM= +#ac_cv_path_MSGFMT= +#ac_cv_path_GMSGFMT= +#ac_cv_path_XGETTEXT= +#ac_cv_path_MSGMERGE= +#ac_cv_path_SCRUB= +#ac_cv_path_PYTHON= + +ALLOW_EMPTY_${PN} = "1" + +PACKAGES =+ "${PN}-libvirtd ${PN}-virsh" + +ALLOW_EMPTY_${PN}-libvirtd = "1" + +FILES_${PN}-libvirtd = " \ + ${sysconfdir}/init.d \ + ${sysconfdir}/sysctl.d \ + ${sysconfdir}/logrotate.d \ + ${sysconfdir}/libvirt/libvirtd.conf \ + /usr/lib/sysctl.d/60-libvirtd.conf \ + ${sbindir}/libvirtd \ + ${systemd_unitdir}/system/* \ + ${@base_contains('DISTRO_FEATURES', 'sysvinit', '', '${libexecdir}/libvirt-guests.sh', d)} \ + " + +FILES_${PN}-virsh = "${bindir}/virsh" +FILES_${PN} += "${libdir}/libvirt/connection-driver \ + ${datadir}/augeas \ + ${datadir}/polkit-1" + +FILES_${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug" +FILES_${PN}-staticdev += "${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a" + +CONFFILES_${PN} += "${sysconfdir}/libvirt/libvirt.conf \ + ${sysconfdir}/libvirt/lxc.conf \ + ${sysconfdir}/libvirt/qemu-lockd.conf \ + ${sysconfdir}/libvirt/qemu.conf \ + ${sysconfdir}/libvirt/virt-login-shell.conf \ + ${sysconfdir}/libvirt/virtlockd.conf" + +CONFFILES_${PN}-libvirtd = "${sysconfdir}/logrotate.d/libvirt ${sysconfdir}/logrotate.d/libvirt.lxc \ + ${sysconfdir}/logrotate.d/libvirt.qemu ${sysconfdir}/logrotate.d/libvirt.uml \ + ${sysconfdir}/libvirt/libvirtd.conf \ + /usr/lib/sysctl.d/libvirtd.conf" + +INITSCRIPT_PACKAGES = "${PN}-libvirtd" +INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd" +INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72" + +SYSTEMD_PACKAGES = "${PN}-libvirtd" +SYSTEMD_SERVICE_${PN}-libvirtd = " \ + libvirtd.socket \ + libvirtd.service \ + virtlockd.service \ + libvirt-guests.service \ + virtlockd.socket \ + " + + +PRIVATE_LIBS_${PN}-ptest = " \ + libvirt-lxc.so.0 \ + libvirt.so.0 \ + libvirt-qemu.so.0 \ + lockd.so \ + libvirt_driver_secret.so \ + libvirt_driver_nodedev.so \ + libvirt_driver_vbox.so \ + libvirt_driver_interface.so \ + libvirt_driver_uml.so \ + libvirt_driver_network.so \ + libvirt_driver_nwfilter.so \ + libvirt_driver_qemu.so \ + libvirt_driver_storage.so \ + libvirt_driver_lxc.so \ + " + +# xen-minimal config +#PACKAGECONFIG ??= "xen libxl xen-inotify test remote libvirtd" + +# full config +PACKAGECONFIG ??= "qemu yajl uml openvz vmware vbox esx iproute2 lxc test \ + remote macvtap libvirtd netcf udev python ebtables \ + ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux audit libcap-ng', '', d)} \ + ${@base_contains('DISTRO_FEATURES', 'xen', 'xen libxl xen-inotify', '', d)} \ + ${@base_contains('DISTRO_FEATURES', 'x11', 'polkit', '', d)} \ + " + +# enable,disable,depends,rdepends +# +PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu," +PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl" +PACKAGECONFIG[xen] = "--with-xen,--without-xen,xen," +PACKAGECONFIG[xenapi] = "--with-xenapi,--without-xenapi,," +PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,libxl," +PACKAGECONFIG[xen-inotify] = "--with-xen-inotify,--without-xen-inotify,xen," +PACKAGECONFIG[uml] = "--with-uml, --without-uml,," +PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz,," +PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware,," +PACKAGECONFIG[phyp] = "--with-phyp,--without-phyp,," +PACKAGECONFIG[vbox] = "--with-vbox,--without-vbox,," +PACKAGECONFIG[esx] = "--with-esx,--without-esx,," +PACKAGECONFIG[hyperv] = "--with-hyperv,--without-hyperv,," +PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit,polkit" +PACKAGECONFIG[lxc] = "--with-lxc,--without-lxc, lxc," +PACKAGECONFIG[test] = "--with-test=yes,--with-test=no,," +PACKAGECONFIG[remote] = "--with-remote,--without-remote,," +PACKAGECONFIG[macvtap] = "--with-macvtap=yes,--with-macvtap=no,libnl,libnl" +PACKAGECONFIG[libvirtd] = "--with-libvirtd,--without-libvirtd,," +PACKAGECONFIG[netcf] = "--with-netcf,--without-netcf,netcf,netcf" +PACKAGECONFIG[dtrace] = "--with-dtrace,--without-dtrace,," +PACKAGECONFIG[udev] = "--with-udev --with-pciaccess,--without-udev,udev libpciaccess," +PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux," +PACKAGECONFIG[ebtables] = "ac_cv_path_EBTABLES_PATH=/sbin/ebtables,ac_cv_path_EBTABLES_PATH=,ebtables,ebtables" +PACKAGECONFIG[python] = ",,python," +PACKAGECONFIG[sasl] = "--with-sasl,--without-sasl,cyrus-sasl,cyrus-sasl" +PACKAGECONFIG[iproute2] = "ac_cv_path_IP_PATH=/sbin/ip,ac_cv_path_IP_PATH=,iproute2,iproute2" +PACKAGECONFIG[numactl] = "--with-numactl,--without-numactl,numactl," +PACKAGECONFIG[fuse] = "--with-fuse,--without-fuse,fuse," +PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit," +PACKAGECONFIG[libcap-ng] = "--with-capng,--without-capng,libcap-ng," + +# Enable the Python tool support +require libvirt-python.inc + +do_install_append() { + install -d ${D}/etc/init.d + install -d ${D}/etc/libvirt + + install -m 0755 ${WORKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd + install -m 0644 ${WORKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf + + if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then + # This will wind up in the libvirtd package, but will NOT be invoked by default. + # + mv ${D}/${libexecdir}/libvirt-guests.sh ${D}/${sysconfdir}/init.d + fi + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + # This variable is used by libvirtd.service to start libvirtd in the right mode + sed -i '/#LIBVIRTD_ARGS="--listen"/a LIBVIRTD_ARGS="--listen --daemon"' ${D}/${sysconfdir}/sysconfig/libvirtd + + # We can't use 'notify' when we don't support 'sd_notify' dbus capabilities. + sed -i -e 's/Type=notify/Type=forking/' \ + -e '/Type=forking/a PIDFile=${localstatedir}/run/libvirtd.pid' \ + ${D}/${systemd_unitdir}/system/libvirtd.service + fi + + # The /var/run/libvirt directories created by the Makefile + # are wiped out in volatile, we need to create these at boot. + rm -rf ${D}${localstatedir}/run + install -d ${D}${sysconfdir}/default/volatiles + echo "d root root 0755 ${localstatedir}/run/libvirt none" \ + > ${D}${sysconfdir}/default/volatiles/99_libvirt + echo "d root root 0755 ${localstatedir}/run/libvirt/lockd none" \ + >> ${D}${sysconfdir}/default/volatiles/99_libvirt + echo "d root root 0755 ${localstatedir}/run/libvirt/lxc none" \ + >> ${D}${sysconfdir}/default/volatiles/99_libvirt + echo "d root root 0755 ${localstatedir}/run/libvirt/network none" \ + >> ${D}${sysconfdir}/default/volatiles/99_libvirt + echo "d root root 0755 ${localstatedir}/run/libvirt/qemu none" \ + >> ${D}${sysconfdir}/default/volatiles/99_libvirt + + # Add hook support for libvirt + mkdir -p ${D}/etc/libvirt/hooks + + # remove .la references to our working diretory + for i in `find ${D}${libdir} -type f -name *.la`; do + sed -i -e 's#-L${B}/src/.libs##g' $i + done +} + +EXTRA_OECONF += " \ + --with-init-script=systemd \ + " + +EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH}" + +do_compile_ptest() { + oe_runmake -C tests buildtest-TESTS +} + +do_install_ptest() { + oe_runmake -C tests install-ptest + + # remove .la files for ptest, they aren't required and can trigger QA errors + for i in `find ${D}${PTEST_PATH} -type f -name *.la`; do + rm -f $i + done +} + +pkg_postinst_libvirt() { + if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then + /etc/init.d/populate-volatile.sh update + fi +} + +python () { + if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): + d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") +} diff --git a/import-layers/meta-virtualization/recipes-extended/multipath-tools/multipath-tools_git.bb b/import-layers/meta-virtualization/recipes-extended/multipath-tools/multipath-tools_git.bb new file mode 100644 index 000000000..9ba5cd65b --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/multipath-tools/multipath-tools_git.bb @@ -0,0 +1,46 @@ +SUMMARY = "Tools to Manage Multipathed Devices with the device-mapper" +DESCRIPTION = "This package provides the tools to manage multipathed devices by \ +instructing the device-mapper multipath module what to do" + +HOMEPAGE = "http://christophe.varoqui.free.fr/" +DEPENDS = "readline libaio lvm2 udev" +LICENSE = "GPLv2" + +LIC_FILES_CHKSUM = "file://COPYING;md5=7be2873b6270e45abacc503abbe2aa3d" +S="${WORKDIR}/git" + + +SRC_URI = "git://git.opensvc.com/multipath-tools/.git;protocol=http" + +SRCREV = "d3683ab18b386e9b3b54b59a122c689e9ebdf5cf" +PV = "0.4.9+gitr${SRCPV}" + +inherit autotools-brokensep + +EXTRA_OEMAKE="LIB=${libdir} exec_prefix=${exec_prefix} libdir=${libdir}" + +PACKAGES =+ "libmpathpersist mpathpersist kpartx libmultipath multipath multipathd libmultipath-dev libmpathpersist-dev" + + +RDEPENDS_${PN} += "libmpathpersist mpathpersist kpartx libmultipath multipath multipathd udev" + +do_install_append () { + ln -sf libmpathpersist.so.0 ${D}${libdir}/libmpathpersist.so + ln -sf libmultipath.so.0 ${D}${libdir}/libmultipath.so +} + +ALLOW_EMPTY_${PN} = "1" +FILES_${PN} = "" + +FILES_libmpathpersist = "${libdir}/libmpathpersist*.so.0" +FILES_mpathpersist = "${sbindir}/mpathpersist" +FILES_kpartx = "${sbindir}/kpartx ${base_libdir}/udev/" +FILES_libmultipath = "${libdir}/libcheck*.so ${libdir}/libpri*.so ${libdir}/libmultipath*.so.0" +FILES_multipath = "${sbindir}/multipath ${sysconfdir}" +FILES_multipathd = "${sbindir}/multipathd ${base_libdir}" + +#put the symbol link lib in -dev +FILES_libmultipath-dev = "${libdir}/libmultipath*.so" +FILES_libmpathpersist-dev = "${libdir}/libmpathpersist*.so" + + diff --git a/import-layers/meta-virtualization/recipes-extended/seabios/seabios/hostcc.patch b/import-layers/meta-virtualization/recipes-extended/seabios/seabios/hostcc.patch new file mode 100644 index 000000000..f665e1a38 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/seabios/seabios/hostcc.patch @@ -0,0 +1,21 @@ +diff -ur a/Makefile b/Makefile +--- a/Makefile 2015-02-02 22:02:58.651041951 -0500 ++++ b/Makefile 2015-02-02 23:08:13.884514003 -0500 +@@ -8,7 +8,7 @@ + OUT=out/ + + # Common command definitions +-export HOSTCC := $(CC) ++export HOSTCC ?= $(CC) + export CONFIG_SHELL := sh + export KCONFIG_AUTOHEADER := autoconf.h + export KCONFIG_CONFIG := $(CURDIR)/.config +@@ -22,7 +22,7 @@ + OBJDUMP=$(CROSS_PREFIX)objdump + STRIP=$(CROSS_PREFIX)strip + PYTHON=python +-CPP=cpp ++CPP=$(CROSS_PREFIX)cpp + IASL:=iasl + LD32BIT_FLAG:=-melf_i386 + diff --git a/import-layers/meta-virtualization/recipes-extended/seabios/seabios_1.9.1.bb b/import-layers/meta-virtualization/recipes-extended/seabios/seabios_1.9.1.bb new file mode 100644 index 000000000..88f29639f --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/seabios/seabios_1.9.1.bb @@ -0,0 +1,41 @@ +DESCRIPTION = "SeaBIOS" +HOMEPAGE = "http://www.coreboot.org/SeaBIOS" +LICENSE = "LGPLv3" +SECTION = "firmware" + +SRC_URI = " \ + http://code.coreboot.org/p/seabios/downloads/get/${PN}-${PV}.tar.gz \ + file://hostcc.patch \ + " + +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6 \ + " + +SRC_URI[md5sum] = "e21b6f3e54d492be837ef20d66617f81" +SRC_URI[sha256sum] = "8a2a562fe5cfd37fe8327cdc4a60accdfe441e235b29e6999fdeb442ba98d608" + +FILES_${PN} = "/usr/share/firmware" + +DEPENDS = "util-linux-native file-native bison-native flex-native gettext-native iasl-native python-native" + +TUNE_CCARGS = "" +EXTRA_OEMAKE += "HOSTCC='${BUILD_CC}'" +EXTRA_OEMAKE += "CROSS_PREFIX=${TARGET_PREFIX}" + +do_configure() { + oe_runmake defconfig +} + +do_compile() { + unset CPP + unset CPPFLAGS + oe_runmake +} + +do_install() { + oe_runmake + install -d ${D}/usr/share/firmware + install -m 0644 out/bios.bin ${D}/usr/share/firmware/ +} + diff --git a/import-layers/meta-virtualization/recipes-extended/vgabios/vgabios_0.7a.bb b/import-layers/meta-virtualization/recipes-extended/vgabios/vgabios_0.7a.bb new file mode 100644 index 000000000..0ed8bb4bd --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/vgabios/vgabios_0.7a.bb @@ -0,0 +1,31 @@ +DESCRIPTION = "Plex86/Bochs LGPL VGABios" +HOMEPAGE = "http://www.nongnu.org/vgabios/" +LICENSE = "LGPLv2.1" +SECTION = "firmware" + +DEPENDS = "dev86-native" + +LIC_FILES_CHKSUM = "file://COPYING;md5=dcf3c825659e82539645da41a7908589" + +SRC_URI = "http://savannah.gnu.org/download/vgabios/${PN}-${PV}.tgz" + +SRC_URI[md5sum] = "2c0fe5c0ca08082a9293e3a7b23dc900" +SRC_URI[sha256sum] = "9d24c33d4bfb7831e2069cf3644936a53ef3de21d467872b54ce2ea30881b865" + +PR = "r0" + +FILES_${PN} = "/usr/share/firmware/${PN}-${PV}*.bin" +FILES_${PN}-dbg = "/usr/share/firmware/${PN}-${PV}*.debug.bin" + +S = "${WORKDIR}/${PN}-${PV}" + +do_configure() { + echo "Skip do_configure" +} + +do_install() { + install -d ${D}/usr/share/firmware + install -m 0644 VGABIOS-lgpl-latest.bin ${D}/usr/share/firmware/${PN}-${PV}.bin + install -m 0644 VGABIOS-lgpl-latest.cirrus.bin ${D}/usr/share/firmware/${PN}-${PV}.cirrus.bin +} + diff --git a/import-layers/meta-virtualization/recipes-extended/xen/xen-arch.inc b/import-layers/meta-virtualization/recipes-extended/xen/xen-arch.inc new file mode 100644 index 000000000..844d47dd5 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/xen/xen-arch.inc @@ -0,0 +1,18 @@ + +valid_xen_archs = " \ + x86_64 x86_32 \ + arm32 arm64 \ + " + +def map_xen_arch(a, d): + import re + valid_archs = d.getVar('valid_xen_archs', True).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" + diff --git a/import-layers/meta-virtualization/recipes-extended/xen/xen.inc b/import-layers/meta-virtualization/recipes-extended/xen/xen.inc new file mode 100644 index 000000000..de8c16868 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/xen/xen.inc @@ -0,0 +1,924 @@ +DESCRIPTION = "Xen hypervisor" +HOMEPAGE = "http://xen.org" +LICENSE = "GPLv2" +SECTION = "console/tools" + +LIC_FILES_CHKSUM = "file://COPYING;md5=a6260c12cd5de27e80d89ae18e48d20a" + +COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux' + +inherit autotools-brokensep gettext setuptools update-rc.d systemd deploy + +require xen-arch.inc + +PACKAGECONFIG ??= " \ + sdl \ + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ + ${@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="${STAGING_DIR_HOST}/usr/share/firmware/bios.bin",--disable-seabios,seabios ipxe vgabios," + +DEPENDS = " \ + bison-native \ + dev86-native \ + flex-native \ + file-native \ + iasl-native \ + util-linux-native \ + xz-native \ + bridge-utils \ + curl \ + dtc \ + gettext \ + glib-2.0 \ + gnutls \ + iproute2 \ + libnl \ + ncurses \ + openssl \ + pciutils \ + pixman \ + procps \ + python \ + libaio \ + lzo \ + util-linux \ + xz \ + yajl \ + zlib \ + " + +# inherit setuptools adds python to RDEPENDS, override it +RDEPENDS_${PN} = "" + +RDEPENDS_${PN}-base = "\ + bash perl xz \ + ${PN}-blktap \ + ${PN}-console \ + ${PN}-libblktapctl \ + ${PN}-libxenguest \ + ${PN}-libxenlight \ + ${PN}-libxenvchan \ + ${PN}-libxenctrl \ + ${PN}-libxlutil \ + ${PN}-libvhd \ + ${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}-libblktap \ + ${PN}-flask \ + ${PN}-hvmloader \ + ${PN}-xenpaging \ + " + +RDEPENDS_${PN}-devd = " \ + ${PN}-xl \ + " + +RDEPENDS_${PN}-fsimage = " \ + libext2fs \ + " + +RDEPENDS_${PN}-misc = " \ + perl \ + 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}-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}-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}-libxentoollog \ + ${PN}-libxentoollog-dev \ + ${PN}-libxenvchan \ + ${PN}-libxenvchan-dev \ + ${PN}-libxlutil \ + ${PN}-libxlutil-dev \ + ${PN}-misc \ + ${PN}-pygrub \ + ${PN}-python \ + ${PN}-qemu \ + ${PN}-remus \ + ${PN}-scripts-block \ + ${PN}-scripts-common \ + ${PN}-scripts-network \ + ${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" + +FILES_${PN}-libxencall = "${libdir}/libxencall.so.*" +FILES_${PN}-libxencall-dev = "${libdir}/libxencall.so" + +FILES_${PN}-libxenctrl = "${libdir}/libxenctrl.so.*" +FILES_${PN}-libxenctrl-dev = "${libdir}/libxenctrl.so" + +FILES_${PN}-libxenevtchn = "${libdir}/libxenevtchn.so.*" +FILES_${PN}-libxenevtchn-dev = "${libdir}/libxenevtchn.so" + +FILES_${PN}-libxenforeignmemory = "${libdir}/libxenforeignmemory.so.*" +FILES_${PN}-libxenforeignmemory-dev = "${libdir}/libxenforeignmemory.so" + +FILES_${PN}-libxengnttab = "${libdir}/libxengnttab.so.*" +FILES_${PN}-libxengnttab-dev = "${libdir}/libxengnttab.so" + +FILES_${PN}-libxenguest = "${libdir}/libxenguest.so.*" +FILES_${PN}-libxenguest-dev = "${libdir}/libxenguest.so" + +FILES_${PN}-libxenlight = "${libdir}/libxenlight.so.*" +FILES_${PN}-libxenlight-dev = " \ + ${libdir}/libxenlight.so \ + ${datadir}/pkgconfig/xenlight.pc \ + " + +FILES_${PN}-libxenstat = "${libdir}/libxenstat.so.*" +FILES_${PN}-libxenstat-dev = "${libdir}/libxenstat.so" + +FILES_${PN}-libxenstore = "${libdir}/libxenstore.so.*" +FILES_${PN}-libxenstore-dev = "${libdir}/libxenstore.so" + +FILES_${PN}-libxentoollog = "${libdir}/libxentoollog.so.*" +FILES_${PN}-libxentoollog-dev = "${libdir}/libxentoollog.so" + +FILES_${PN}-libxenvchan = "${libdir}/libxenvchan.so.*" +FILES_${PN}-libxenvchan-dev = "${libdir}/libxenvchan.so" + +FILES_${PN}-libxlutil = "${libdir}/libxlutil.so.*" +FILES_${PN}-libxlutil-dev = " \ + ${libdir}/libxlutil.so \ + ${datadir}/pkgconfig/xlutil.pc \ + " +FILES_${PN}-libvhd = "${libdir}/libvhd.so.*" +FILES_${PN}-libvhd-dev = "${libdir}/libvhd.so" + +FILES_${PN}-libblktap = "${libdir}/libblktap.so.*" +FILES_${PN}-libblktap-dev = "${libdir}/libblktap.so" + +FILES_${PN}-libfsimage = "${libdir}/libfsimage.so.*" +FILES_${PN}-libfsimage-dev = "${libdir}/libfsimage.so" + +FILES_${PN}-fsimage = "${libdir}/fs/*/*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 = "\ + ${exec_prefix}/lib64 \ + ${exec_prefix}/lib64/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}-devd = "\ + ${sysconfdir}/init.d/xendriverdomain \ + " + +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 \ + " + +FILES_${PN}-misc = "\ + ${bindir}/xencons \ + ${bindir}/xencov_split \ + ${bindir}/xen-detect \ + ${libdir}/xen/bin/xenpvnetboot \ + ${sbindir}/gtracestat \ + ${sbindir}/gtraceview \ + ${sbindir}/xen-bugtool \ + ${sbindir}/xencov \ + ${sbindir}/xenperf \ + ${sbindir}/xenpm \ + ${sbindir}/xsview \ + ${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" +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 \ + ${sysconfdir}/xen/scripts/remus-netbuf-setup \ + " + +FILES_${PN}-scripts-network = " \ + ${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-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 \ + " + +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 \ + " + +FILES_${PN}-xm = "\ + ${sysconfdir}/xen/xm-config.xml \ + ${datadir}/xen/create.dtd \ + ${sbindir}/xm \ + " + +FILES_${PN}-xencommons += "\ + ${sysconfdir}/default/xencommons \ + ${sysconfdir}/init.d/xencommons \ + ${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/xenstored.socket \ + ${systemd_unitdir}/system/xenstored_ro.socket \ + ${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" +SYSTEMD_SERVICE_${PN}-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 \ + xenstored.socket \ + xenstored_ro.socket \ + " +SYSTEMD_SERVICE_${PN}-xendomains = "xendomains.service" + +#### 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', True), d)}" +export XEN_COMPILE_ARCH = "${@map_xen_arch(d.getVar('BUILD_ARCH', True), d)}" + +python () { + if d.getVar('XEN_TARGET_ARCH', True) == 'INVALID': + raise bb.parse.SkipPackage('Cannot map `%s` to a xen architecture' % d.getVar('TARGET_ARCH', True)) +} + +# 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}/python" + +# seabios forcefully sets HOSTCC to CC - fixup to allow it to build native conf executable +export HOSTCC="${BUILD_CC}" + +# 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="" + +# 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_filter_out('-mfpmath=sse', '${TUNE_CCARGS}', d)}" + +EXTRA_OECONF += " \ + --exec-prefix=/usr \ + --prefix=/usr \ + --host=${HOST_SYS} \ + --with-systemd=${systemd_unitdir}/system \ + --with-systemd-modules-load=${systemd_unitdir}/modules-load.d \ + --disable-stubdom \ + --disable-ioemu-stubdom \ + --disable-pv-grub \ + --disable-xenstore-stubdom \ + --disable-rombios \ + --disable-ocamltools \ + --with-initddir=${INIT_D_DIR} \ + --with-sysconfig-leaf-dir=default \ + --with-system-qemu=/usr/bin/qemu-system-i386 \ + --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" + +# check for XSM in package config to allow XSM_ENABLE to be set +python () { + pkgconfig = d.getVar('PACKAGECONFIG', True) + 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 +} + +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 + +do_configure() { + + #./configure --enable-xsmpolicy does not set XSM_ENABLE must be done manually + if [ "${XSM_ENABLED}" = "1" ]; then + echo "XSM_ENABLE := y" > ${S}/.config + fi + + # do configure + oe_runconf +} + +do_compile() { + oe_runmake +} + +do_install() { + oe_runmake DESTDIR="${D}" install + + # remove installed volatiles + rm -rf ${D}${localstatedir}/run \ + ${D}${localstatedir}/lock \ + ${D}${localstatedir}/log \ + ${D}${localstatedir}/volatile \ + ${D}${localstatedir}/lib/xen + + VOLATILE_DIRS=" \ + ${localstatedir}/run/xenstored \ + ${localstatedir}/run/xend \ + ${localstatedir}/run/xend/boot \ + ${localstatedir}/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 diff --git a/import-layers/meta-virtualization/recipes-extended/xen/xen_4.6.1.bb b/import-layers/meta-virtualization/recipes-extended/xen/xen_4.6.1.bb new file mode 100644 index 000000000..0adf8adbb --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/xen/xen_4.6.1.bb @@ -0,0 +1,10 @@ +require xen.inc + +SRC_URI = " \ + http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz \ + " + +SRC_URI[md5sum] = "df2d854c3c90ffeefaf71e7f868fb326" +SRC_URI[sha256sum] = "44cc2fccba1e147ef4c8da0584ce0f24189c8743de0e3e9a9226da88ddb5f589" + +S = "${WORKDIR}/xen-${PV}" diff --git a/import-layers/meta-virtualization/recipes-extended/xen/xen_git.bb b/import-layers/meta-virtualization/recipes-extended/xen/xen_git.bb new file mode 100644 index 000000000..a86a50176 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-extended/xen/xen_git.bb @@ -0,0 +1,15 @@ +require xen.inc + +SRCREV = "1fd615aa0108490ffc558d27627f509183cbfdaf" + +XEN_REL="4.6" + +PV = "${XEN_REL}.0+git${SRCPV}" + +S = "${WORKDIR}/git" + +SRC_URI = " \ + git://xenbits.xen.org/xen.git;branch=staging-${XEN_REL} \ + " + +DEFAULT_PREFERENCE = "-1" |