From 31ce2d1a14de6d8439829dc8a046aeaeef734461 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Thu, 8 Oct 2015 22:22:28 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- README | 49 ++++ conf/layer.conf | 13 + images/enea-image-demo.bbappend | 4 + images/enea-image-featured.bbappend | 4 + recipes-append/busybox/busybox_1.22.1.bbappend | 3 + .../libvirt/files/Fix-pci-bus-naming-for-PPC.patch | 18 ++ recipes-append/libvirt/libvirt_1.2.8.bbappend | 5 + .../configure-Add-with-python-install-dir.patch | 60 +++++ recipes-append/libxml/libxml2_2.9.1.bbappend | 26 ++ recipes-append/netperf/netperf_2.6.0.bbappend | 4 + recipes-append/qemu/qemu_1.7.0.bbappend | 6 + recipes-append/qemu/qemu_git.bbappend | 1 + .../systest-runner/files/tests/virt-test | 247 ++++++++++++++++++ .../systest-runner/systest-runner.bbappend | 12 + recipes-containers/lxc/files/init-lxc-mount | 12 + .../lxc-busybox-support-enea-linux-init.patch | 51 ++++ .../lxc-test-attach-replace-cmp-with-grep.patch | 24 ++ recipes-containers/lxc/lxc_1.0.6.bbappend | 15 ++ recipes-core/base-files/base-files_3.0.14.bbappend | 13 + .../packagegroups/packagegroup-enea-virt.bb | 39 +++ .../fix-libcap-header-issue-on-some-distro.patch | 84 ++++++ recipes-devtools/qemu/qemu_2.3.0.bb | 38 +++ recipes-example/virt-example/files/LICENSE | 24 ++ .../virt-example/files/example-container.conf | 50 ++++ .../virt-example/files/example-guest-aarch64.xml | 63 +++++ .../virt-example/files/example-guest-ppc.xml | 55 ++++ .../virt-example/files/example-guest-x86.xml | 71 +++++ recipes-example/virt-example/files/example-net.xml | 39 +++ .../virt-example/files/pxe/pxelinux.cfg/default | 10 + recipes-example/virt-example/virt-example_1.0.0.bb | 42 +++ .../python-urlgrabber/pycurl-curl.patch | 288 +++++++++++++++++++++ .../python-urlgrabber/python-urlgrabber_3.10.1.bb | 37 +++ recipes-extra/virt-manager/virt-manager_1.0.0.bb | 72 ++++++ .../perf-x86-fix-RAPL-rdmsrl_safe-usage.patch | 29 +++ ...tel-Use-rdmsrl_safe-when-initializing-RAP.patch | 80 ++++++ .../linux/linux-boundary_3.10.17.bbappend | 13 + recipes-kernel/linux/linux-keystone_3.10.bbappend | 13 + recipes-kernel/linux/linux-proliant-m400.bbappend | 13 + recipes-kernel/linux/linux-qoriq_3.12.bbappend | 24 ++ recipes-kernel/linux/linux-xlnx_3.8.bbappend | 7 + recipes-kernel/linux/linux-yocto_3.10.bbappend | 6 + recipes-kernel/linux/linux-yocto_3.14.bbappend | 8 + .../lksctp-tools/lksctp-tools_1.0.16.bb | 57 ++++ 43 files changed, 1729 insertions(+) create mode 100644 README create mode 100644 conf/layer.conf create mode 100644 images/enea-image-demo.bbappend create mode 100644 images/enea-image-featured.bbappend create mode 100644 recipes-append/busybox/busybox_1.22.1.bbappend create mode 100644 recipes-append/libvirt/files/Fix-pci-bus-naming-for-PPC.patch create mode 100644 recipes-append/libvirt/libvirt_1.2.8.bbappend create mode 100644 recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch create mode 100644 recipes-append/libxml/libxml2_2.9.1.bbappend create mode 100644 recipes-append/netperf/netperf_2.6.0.bbappend create mode 100644 recipes-append/qemu/qemu_1.7.0.bbappend create mode 100644 recipes-append/qemu/qemu_git.bbappend create mode 100755 recipes-append/systest-runner/files/tests/virt-test create mode 100644 recipes-append/systest-runner/systest-runner.bbappend create mode 100755 recipes-containers/lxc/files/init-lxc-mount create mode 100644 recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch create mode 100644 recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch create mode 100644 recipes-containers/lxc/lxc_1.0.6.bbappend create mode 100644 recipes-core/base-files/base-files_3.0.14.bbappend create mode 100644 recipes-core/packagegroups/packagegroup-enea-virt.bb create mode 100644 recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch create mode 100644 recipes-devtools/qemu/qemu_2.3.0.bb create mode 100644 recipes-example/virt-example/files/LICENSE create mode 100644 recipes-example/virt-example/files/example-container.conf create mode 100644 recipes-example/virt-example/files/example-guest-aarch64.xml create mode 100644 recipes-example/virt-example/files/example-guest-ppc.xml create mode 100644 recipes-example/virt-example/files/example-guest-x86.xml create mode 100644 recipes-example/virt-example/files/example-net.xml create mode 100755 recipes-example/virt-example/files/pxe/pxelinux.cfg/default create mode 100644 recipes-example/virt-example/virt-example_1.0.0.bb create mode 100644 recipes-extra/python-urlgrabber/python-urlgrabber/pycurl-curl.patch create mode 100644 recipes-extra/python-urlgrabber/python-urlgrabber_3.10.1.bb create mode 100644 recipes-extra/virt-manager/virt-manager_1.0.0.bb create mode 100644 recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch create mode 100644 recipes-kernel/linux/files/perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch create mode 100644 recipes-kernel/linux/linux-boundary_3.10.17.bbappend create mode 100644 recipes-kernel/linux/linux-keystone_3.10.bbappend create mode 100644 recipes-kernel/linux/linux-proliant-m400.bbappend create mode 100644 recipes-kernel/linux/linux-qoriq_3.12.bbappend create mode 100644 recipes-kernel/linux/linux-xlnx_3.8.bbappend create mode 100644 recipes-kernel/linux/linux-yocto_3.10.bbappend create mode 100644 recipes-kernel/linux/linux-yocto_3.14.bbappend create mode 100644 recipes-missing/lksctp-tools/lksctp-tools_1.0.16.bb diff --git a/README b/README new file mode 100644 index 0000000..db0826c --- /dev/null +++ b/README @@ -0,0 +1,49 @@ +Enea Linux virtualization support +================================= + +This layer provides virtualization support and related tools to Enea Linux. + +Supported Platforms +------------------- + + KVM - Kernel Virtual Machine for x86-64 and PowerPC (e500mc). + LXC - Linux Containers for x86-64, 32-bit ARM, PowerPC. + +Dependencies +------------ +meta-enea: + URI: git://git.enea.com/linux/meta-enea + branch: daisy + +meta-virtualization: + URI: git://git.enea.com/linux/meta-virtualization + branch: daisy + +meta-openembedded: + URI: git://git.enea.com/linux/meta-openembedded + branch: daisy + layers: meta-oe + meta-networking + +Source Code +----------- + +git://git.enea.com/linux/meta-enea/meta-vt + +Maintenance +----------- + +Maintainers: Enea Linux Team + +Contributing +------------ + +Contributions and patches can be sent to the Enea Linux mailing +list: enealinux@lists.enea.com (open) + +License +------- + +All metadata is MIT licensed unless otherwise stated. Source code included +in tree for individual recipes is under the LICENSE stated in each recipe +(.bb file) unless otherwise stated. diff --git a/conf/layer.conf b/conf/layer.conf new file mode 100644 index 0000000..03dcaab --- /dev/null +++ b/conf/layer.conf @@ -0,0 +1,13 @@ +# We have a packages directory, add to BBFILES +BBPATH .= ":${LAYERDIR}" + +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb*" +BBFILES += "${LAYERDIR}/images/*.bb*" +BBFILES += "${LAYERDIR}/images-append/*.bb*" + +BBFILE_COLLECTIONS += "enea-vt" +BBFILE_PATTERN_enea-vt := "^${LAYERDIR}/" +BBFILE_PRIORITY_enea-vt = "7" +LAYERDEPENDS_enea-vt = "enea" + +BB_DANGLINGAPPENDS_WARNONLY = "yes" diff --git a/images/enea-image-demo.bbappend b/images/enea-image-demo.bbappend new file mode 100644 index 0000000..9019a7b --- /dev/null +++ b/images/enea-image-demo.bbappend @@ -0,0 +1,4 @@ +IMAGE_INSTALL += " \ + packagegroup-enea-virt \ + virt-example \ + " diff --git a/images/enea-image-featured.bbappend b/images/enea-image-featured.bbappend new file mode 100644 index 0000000..9019a7b --- /dev/null +++ b/images/enea-image-featured.bbappend @@ -0,0 +1,4 @@ +IMAGE_INSTALL += " \ + packagegroup-enea-virt \ + virt-example \ + " diff --git a/recipes-append/busybox/busybox_1.22.1.bbappend b/recipes-append/busybox/busybox_1.22.1.bbappend new file mode 100644 index 0000000..edabf7e --- /dev/null +++ b/recipes-append/busybox/busybox_1.22.1.bbappend @@ -0,0 +1,3 @@ +do_prepare_config_append () { + sed -i -e 's/# CONFIG_CHPASSWD is not set/CONFIG_CHPASSWD=y/' .config +} diff --git a/recipes-append/libvirt/files/Fix-pci-bus-naming-for-PPC.patch b/recipes-append/libvirt/files/Fix-pci-bus-naming-for-PPC.patch new file mode 100644 index 0000000..39075e8 --- /dev/null +++ b/recipes-append/libvirt/files/Fix-pci-bus-naming-for-PPC.patch @@ -0,0 +1,18 @@ + + Upstream-status: Inappropriate (needed only for meta-fsl-ppc) + + Signed-off-by: Josep Puigdemont + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index a5c6879..b491f58 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -1956,7 +1956,7 @@ + if (qemuCaps->version >= 2000000) + return true; + +- if (qemuCaps->version >= 1006000 && ++ if (qemuCaps->version >= 1004000 && + STREQ(def->os.machine, "ppce500")) + return true; + diff --git a/recipes-append/libvirt/libvirt_1.2.8.bbappend b/recipes-append/libvirt/libvirt_1.2.8.bbappend new file mode 100644 index 0000000..3e4f15c --- /dev/null +++ b/recipes-append/libvirt/libvirt_1.2.8.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI_append_e500mc = " \ + file://Fix-pci-bus-naming-for-PPC.patch \ +" diff --git a/recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch b/recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch new file mode 100644 index 0000000..174be5f --- /dev/null +++ b/recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch @@ -0,0 +1,60 @@ +From df85edda5f6632f12f5802173a5012a35b19ccdd Mon Sep 17 00:00:00 2001 +From: Jonas Eriksson +Date: Thu, 6 Mar 2014 08:22:23 +0100 +Subject: [PATCH] configure: Add --with-python-install-dir + +Cross-compiling the python bindings is a bit difficult today, as the +configure script will figure out the site packages dir +(PYTHON_SITE_PACKAGES) by either: + +- Generating the path to the site-package target directories using + libdir, and see if it exists. As it is not possible to point to the + full path of the sysroot, since that will yield the wrong install + path, and that the directory does not neccessarily exist on the host, + this approach will not work. + +- Fetch the site packages dir from the python interpreter as pointed to + by --with-python. Since this python interpreter will point to the + sysroot, the install dir generated will be inside the sysroot and thus + not work. + +This patch approaches the problem by adding the possibility of +explicitly stating the install dir of the python packages, leaving it up +to the cross-compilation environment to specify it. The patch does not +affect the default case (non-cross compilation). + +Signed-off-by: Jonas Eriksson + +Upstream-Status: Submitted [xml@gnome.org] +--- + configure.in | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/configure.in b/configure.in +index ecaa403..21ad1e7 100644 +--- a/configure.in ++++ b/configure.in +@@ -148,6 +148,9 @@ AC_ARG_WITH(push, + [ --with-push add the PUSH parser interfaces (on)]) + AC_ARG_WITH(python, + [ --with-python[[=DIR]] build Python bindings if found]) ++AC_ARG_WITH(python_install_dir, ++[ --with-python-install-dir=DIR ++ install Python bindings in DIR]) + AC_ARG_WITH(reader, + [ --with-reader add the xmlReader parsing interface (on)]) + AC_ARG_WITH(readline, +@@ -866,6 +869,10 @@ if test "$with_python" != "no" ; then + fi + fi + fi ++ if test "$with_python_install_dir" != "" ++ then ++ PYTHON_SITE_PACKAGES="$with_python_install_dir" ++ fi + if test "$PYTHON_VERSION" != "" -a "$PYTHON_SITE_PACKAGES" = "" + then + if test -d $libdir/python$PYTHON_VERSION/site-packages +-- +1.9.0 + diff --git a/recipes-append/libxml/libxml2_2.9.1.bbappend b/recipes-append/libxml/libxml2_2.9.1.bbappend new file mode 100644 index 0000000..b0e7f64 --- /dev/null +++ b/recipes-append/libxml/libxml2_2.9.1.bbappend @@ -0,0 +1,26 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://configure-Add-with-python-install-dir.patch" + +PACKAGES += "${PN}-python-staticdev ${PN}-python-dbg" + +DEPENDS += "python-dev" + +FILES_${PN}-python = " \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.so \ + ${PYTHON_SITEPACKAGES_DIR}/drv_libxml2.py \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2.py \ + " +FILES_${PN}-python-staticdev += " \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.a \ + ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.la \ + " +FILES_${PN}-python-dbg += " \ + ${PYTHON_SITEPACKAGES_DIR}/.debug/libxml2mod.so \ + " + +# +: --with-catalog, --with-python-install-dir +EXTRA_OECONF = "--with-python=${STAGING_BINDIR}/python --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} --without-debug --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions" + +# +: --with-python-install-dir +EXTRA_OECONF_linuxstdbase = "--with-python=${STAGING_BINDIR}/python --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} --with-debug --with-legacy --with-catalog --with-docbook --with-c14n --without-lzma" diff --git a/recipes-append/netperf/netperf_2.6.0.bbappend b/recipes-append/netperf/netperf_2.6.0.bbappend new file mode 100644 index 0000000..0115d4f --- /dev/null +++ b/recipes-append/netperf/netperf_2.6.0.bbappend @@ -0,0 +1,4 @@ +PACKAGECONFIG ??= "sctp" +PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools," + +RRECOMMENDS_${PN} += "${@base_contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}" diff --git a/recipes-append/qemu/qemu_1.7.0.bbappend b/recipes-append/qemu/qemu_1.7.0.bbappend new file mode 100644 index 0000000..d633a19 --- /dev/null +++ b/recipes-append/qemu/qemu_1.7.0.bbappend @@ -0,0 +1,6 @@ +# Fixes the DEPENDS variable to not require x11 +DEPENDS = "glib-2.0 zlib alsa-lib pixman dtc libsdl \ + ${@base_contains('DISTRO_FEATURES', 'x11', 'virtual/libx11', '', d)}" + +PACKAGECONFIG += "virtfs" +PACKAGECONFIG_class-nativesdk ??= "" diff --git a/recipes-append/qemu/qemu_git.bbappend b/recipes-append/qemu/qemu_git.bbappend new file mode 100644 index 0000000..f44f002 --- /dev/null +++ b/recipes-append/qemu/qemu_git.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG += "virtfs fdt" diff --git a/recipes-append/systest-runner/files/tests/virt-test b/recipes-append/systest-runner/files/tests/virt-test new file mode 100755 index 0000000..44bd79f --- /dev/null +++ b/recipes-append/systest-runner/files/tests/virt-test @@ -0,0 +1,247 @@ +#!/bin/sh + +filter_output() { + test_name="$1" + debug_dir="" + while read row; do + echo "# $row" + # Output is colorized; remove escape characters + row_cleaned=`echo "$row" | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"` + # Transform "SETUP: PASS|FAIL" to "SETUP ($test_name): PASS|FAIL" + row_cleaned=`echo "$row_cleaned" | sed "s/^SETUP:/SETUP ($test_name):/"` + if echo "$row_cleaned" | grep -q '^[^:]*: \(PASS\|FAIL\|ERROR\)\( \[result=[^]]*\]\)\? ([0-9\.]\{1,\} s)$'; then + # The row is a test result + test_case=`echo "$row_cleaned" | grep -o '^\(SETUP\|([0-9]\{1,\}/[0-9]\{1,\})\)[^:]*' | sed 's|^([0-9]\{1,\}/[0-9]\{1,\}) ||'` + status=`echo "$row_cleaned" | grep -o ': \(PASS\|FAIL\|ERROR\)' | sed -e 's/^: //' -e 's/ERROR/FAIL/'` + echo -n "$status: $test_case" + # Are there any textual results to be appended? + keyval_file="$debug_dir/$test_case/keyval" + if [ -n "$debug_dir" -a -e "$keyval_file" ]; then + result=`grep '^result=' $keyval_file | sed 's/^result=//'` + if [ -n "$result" ]; then + echo -n " [result=$result]" + fi + fi + echo "" + elif echo "$row_cleaned" | grep -q '^DEBUG LOG: '; then + # The row specifies the path to the debug log: Extract the debug directory and save it + debug_dir=`echo "$row_cleaned" | sed -e 's,^DEBUG LOG: ,,' -e 's,/debug\.log$,,'` + fi + done +} + +create_empty_image() { + IMAGE_NAME="$1" + COMPRESSION_TYPE="$2" + + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}.${COMPRESSION_TYPE}" + if [ -z "$COMPRESSION_TYPE" ]; then + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}" + fi + SHA1_NAME="${COMPRESSED_IMAGE_NAME}.sha1" + + pushd /opt/virt-test/shared/data/images/ &> /dev/null + + rm -f "$IMAGE_NAME" "$SHA1_NAME" "$COMPRESSED_IMAGE_NAME" + rm -f "${IMAGE_NAME}.backup" + + echo "# Creating empty image ${IMAGE_NAME}" + qemu-img create -f qcow2 ${IMAGE_NAME} 10M + case "$COMPRESSION_TYPE" in + bz2) + bzip2 -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" + ;; + gz) + gzip -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" + ;; + xz) + xz -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" + ;; + *) + echo "ERROR: Invalid compression type: $COMPRESSION_TYPE" + popd + exit 1 + ;; + esac + sha1sum "$COMPRESSED_IMAGE_NAME" > "$SHA1_NAME" + + cp "$IMAGE_NAME" "${IMAGE_NAME}.backup" + + echo "# Empty image $IMAGE_NAME created" + echo + + popd &> /dev/null +} + +get_image() { + URL_BASE="$1" + IMAGE_NAME="$2" + COMPRESSION_TYPE="$3" + + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}.${COMPRESSION_TYPE}" + if [ -z "$COMPRESSION_TYPE" ]; then + COMPRESSED_IMAGE_NAME="${IMAGE_NAME}" + fi + SHA1_NAME="${COMPRESSED_IMAGE_NAME}.sha1" + COMPRESSED_IMAGE_URL="${URL_BASE}/${COMPRESSED_IMAGE_NAME}" + SHA1_URL="${URL_BASE}/${SHA1_NAME}" + + pushd /opt/virt-test/shared/data/images/ &> /dev/null + + rm -f "$IMAGE_NAME" "$SHA1_NAME" "$COMPRESSED_IMAGE_NAME" + rm -f "${IMAGE_NAME}.backup" + + echo "# Downloading $COMPRESSED_IMAGE_URL" + wget $COMPRESSED_IMAGE_URL + wget $SHA1_URL + + if ! sha1sum -c "$SHA1_NAME" > /dev/null; then + echo "ERROR: Invalid sha1 sum!" + exit 1 + fi + + echo "# Uncompressing $COMPRESSED_IMAGE_NAME -> $IMAGE_NAME" + case "$COMPRESSION_TYPE" in + bz2) + bunzip2 -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" + ;; + gz) + gunzip -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" + ;; + xz) + unxz -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" + ;; + "") + ;; + *) + echo "ERROR: Invalid compression type: $COMPRESSION_TYPE" + popd + exit 1 + ;; + esac + + cp "$IMAGE_NAME" "${IMAGE_NAME}.backup" + + echo "# Download of $IMAGE_NAME completed" + echo + + popd &> /dev/null +} + +# Verbose? +VERBOSE= +if [ "$1" = '-v' ]; then + VERBOSE=1 + set -x +fi + +# Servers +NTP_SERVER=ntp.enea.se + +# Architecture +ARCH=`uname -m` + +# Needed by virt-test +export AUTOTEST_PATH="/opt/autotest/" + +# Init LVM +DEST_DIR=/opt/virt-test/shared/data +if ! [ -e /dev/rootvg ]; then + vgchange -ay + udevadm settle # Wait for device nodes +fi +if [ -e /dev/rootvg ]; then + if ! [ -e /dev/rootvg/virttestdatalv ]; then + if ! lvcreate -L30G -n virttestdatalv /dev/rootvg; then + echo "ERROR: Unable to create virttestdatalv!" >&2 + exit 1 + fi + udevadm settle + if ! mkfs.ext4 /dev/rootvg/virttestdatalv; then + echo "ERROR: Unable to format virttestdatalv!" >&2 + exit 1 + fi + fi + + # Mount the virttestdatalv + mkdir -p $DEST_DIR + if ! mountpoint -q $DEST_DIR; then + if ! mount /dev/rootvg/virttestdatalv $DEST_DIR; then + echo "ERROR: Unable to mount virttestdatalv!" >&2 + exit 1 + fi + fi +else + echo "WARNING: No rootvg volume group! Continuing anyway" >&2 +fi +( + cd $DEST_DIR + mkdir -p gpg images isos steps_data +) + +# Sync the clock before starting tests, as some tests will do this, and thereby +# cause tests that run for a negative amount of time unless the time is synced +# from the very beginning +ntpdate $NTP_SERVER + +# Download/create images, kernel, initrd +JEOS_VERSION="19-64" +ENEA_VERSION="4.0" +# virt-test will try to unpack the images for all architectures, even though +# they are not used, so always create the (empty) images. +create_empty_image "enea-${ENEA_VERSION}-x86_64.qcow2" "gz" +create_empty_image "enea-${ENEA_VERSION}-ppc.qcow2" "gz" +create_empty_image "enea-${ENEA_VERSION}-ppc64.qcow2" "gz" +if [ "$ARCH" = "x86_64" ]; then + #get_image "http://172.21.3.124/~jori/jeos/" "jeos-${JEOS_VERSION}.qcow2" "bz2" + get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.qcow2" "gz" +elif [ "$ARCH" = "ppc" -o "$ARCH" = "ppc64" ]; then + get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.uImage" "" + get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.cpio.gz" "" +else + echo "ERROR: Architecture '$ARCH' not supported" + exit 1 +fi + +# Create virbr0 +if ! [ -e /sys/class/net/virbr0 ]; then + ip link add virbr0 type bridge + ip addr add dev virbr0 10.99.99.1/24 + ip link set virbr0 up + /etc/init.d/dnsmasq stop + sleep 5 + /etc/init.d/dnsmasq start +fi + +# Run tests +cd /opt/virt-test/ +QEMU_BIN=`which qemu-system-$ARCH` +OPTS="--qemu-bin=$QEMU_BIN --qemu_sandbox=off --no-downloads" +if ! [ "$VERBOSE" = "" ]; then + OPTS="$OPTS -v" +fi + +declare -a TEST_SUITE TEST_SUITE_EXTRAOPTS TEST_CASES + +TEST_SUITE[0]="qemu" +TEST_SUITE_EXTRAOPTS[0]="" +TEST_CASES[0]="check_clock_offset.with_syscall,migrate.default.fd,pong" + +TEST_SUITE[1]="libvirt" +TEST_SUITE_EXTRAOPTS[1]="" +if [ "$ARCH" = "x86_64" ]; then + TEST_SUITE_EXTRAOPTS[1]="--machine-type=q35" +fi +TEST_CASES[1]="virsh.volume" + +for (( i=0; i<${#TEST_SUITE[@]}; i++ )); do + # Update machine.cfg + cp /opt/virt-test/shared/cfg/machines.cfg \ + /opt/virt-test/backends/${TEST_SUITE[$i]}/cfg/ + + # Run tests + echo "# Running ${TEST_SUITE[$i]} tests ${TEST_CASES[$i]}" + ./run $OPTS ${TEST_SUITE_EXTRAOPTS[$i]} -g Enea -t "${TEST_SUITE[$i]}" \ + --tests="${TEST_CASES[$i]}" --arch=$ARCH 2>&1 \ + | filter_output "${TEST_SUITE[$i]}" +done diff --git a/recipes-append/systest-runner/systest-runner.bbappend b/recipes-append/systest-runner/systest-runner.bbappend new file mode 100644 index 0000000..9c6dc67 --- /dev/null +++ b/recipes-append/systest-runner/systest-runner.bbappend @@ -0,0 +1,12 @@ +FILESEXTRAPATHS_append := ":${THISDIR}/files" + +VIRT_TEST_SRC_URI = "file://tests/virt-test" +SRC_URI_append_corei7-64-intel-common = "${VIRT_TEST_SRC_URI}" +SRC_URI_append_e500mc = "${VIRT_TEST_SRC_URI}" +SRC_URI_append_b4860qds-64b = "${VIRT_TEST_SRC_URI}" + +VIRT_TEST_RDEPENDS = "lvm2 e2fsprogs virt-test virt-test-libvirt virt-test-qemu \ + ntpdate bzip2 coreutils" +RDEPENDS_${PN}_append_corei7-64-intel-common = "${VIRT_TEST_RDEPENDS}" +RDEPENDS_${PN}_append_e500mc = "${VIRT_TEST_RDEPENDS}" +RDEPENDS_${PN}_append_b4860qds-64b = "${VIRT_TEST_RDEPENDS}" diff --git a/recipes-containers/lxc/files/init-lxc-mount b/recipes-containers/lxc/files/init-lxc-mount new file mode 100755 index 0000000..c4c77df --- /dev/null +++ b/recipes-containers/lxc/files/init-lxc-mount @@ -0,0 +1,12 @@ +#!/bin/sh -e + +mkdir -p /sys/fs/cgroup/cpuset +mkdir -p /sys/fs/cgroup/cpu,cpuacct +mkdir -p /sys/fs/cgroup/devices +mkdir -p /sys/fs/cgroup/freezer +mkdir -p /sys/fs/cgroup/memory +mount cpuset +mount cpuacct +mount devices +mount freezer +mount memory diff --git a/recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch b/recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch new file mode 100644 index 0000000..4eecfaa --- /dev/null +++ b/recipes-containers/lxc/files/lxc-busybox-support-enea-linux-init.patch @@ -0,0 +1,51 @@ +lxc: Modify lxc-busybox to support Enea Linux + +In Enea Linux, the busybox commands are split between busybox.nosuid (symlinked +as /bin/busybox) and busybox.suid. This patch enables the commands provided by +the latter and also replaces the busybox init with the SysV counterpart. + +Upstream-Status: Pending + +Signed-off-by: Petre Pircalabu + +--- a/templates/lxc-busybox.in ++++ b/templates/lxc-busybox.in +@@ -129,6 +129,7 @@ EOF + # and propose a shell on the tty, the last one is + # not needed + cat <> $rootfs/etc/inittab ++id:5:initdefault: + ::sysinit:/etc/init.d/rcS + tty1::respawn:/bin/getty -L tty1 115200 vt100 + console::askfirst:/bin/sh +@@ -209,8 +210,28 @@ configure_busybox() + xargs -n1 ln -s busybox + popd > /dev/null + +- # relink /sbin/init +- ln $rootfs/bin/busybox $rootfs/sbin/init ++ which busybox.suid >/dev/null 2>&1 ++ ++ if [ $? -eq 0 ]; then ++ # copy busybox.suid in the rootfs ++ cp $(which busybox.suid) $rootfs/bin ++ if [ $? -ne 0 ]; then ++ echo "failed to copy busybox.suid in the rootfs" ++ return 1 ++ fi ++ ++ pushd $rootfs/bin > /dev/null || return 1 ++ ./busybox.suid --help | grep 'Currently defined functions:' -A300 | \ ++ grep -v 'Currently defined functions:' | tr , '\n' | \ ++ xargs -n1 ln -s busybox.suid ++ popd > /dev/null ++ fi ++ ++ # use SysV init ++ pushd $rootfs/sbin > /dev/null || return 1 ++ cp /sbin/init.sysvinit . ++ ln -s init.sysvinit init ++ popd > /dev/null + + # passwd exec must be setuid + chmod +s $rootfs/bin/passwd diff --git a/recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch b/recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch new file mode 100644 index 0000000..88d2450 --- /dev/null +++ b/recipes-containers/lxc/files/lxc-test-attach-replace-cmp-with-grep.patch @@ -0,0 +1,24 @@ +lxc: Update lxc-test-attach + +For Enea Linux, the SysV init file is different from busybox, causing cmp to +return an error. In order to preserve the test's logic it was replaced with a +command which succeeds in every situation: +(e.g. search for root in /etc/passwd using grep). + +Upstream-Status: Pending + +Signed-off-by: Petre Pircalabu + +--- a/src/tests/attach.c ++++ b/src/tests/attach.c +@@ -237,8 +237,8 @@ static int test_attach_cmd(struct lxc_co + { + int ret; + pid_t pid; +- char *argv[] = {"cmp", "-s", "/sbin/init", "/bin/busybox", NULL}; +- lxc_attach_command_t command = {"cmp", argv}; ++ char *argv[] = {"grep", "-q", "root", "/etc/passwd", NULL}; ++ lxc_attach_command_t command = {"grep", argv}; + lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; + + TSTOUT("Testing attach with success command...\n"); diff --git a/recipes-containers/lxc/lxc_1.0.6.bbappend b/recipes-containers/lxc/lxc_1.0.6.bbappend new file mode 100644 index 0000000..84a1cb5 --- /dev/null +++ b/recipes-containers/lxc/lxc_1.0.6.bbappend @@ -0,0 +1,15 @@ +FILESEXTRAPATHS_append := ":${THISDIR}/files" +SRC_URI_append = " file://init-lxc-mount" +SRC_URI_append = " file://lxc-busybox-support-enea-linux-init.patch" +SRC_URI_append = " file://lxc-test-attach-replace-cmp-with-grep.patch" + +inherit update-rc.d + +INITSCRIPT_NAME = "init-lxc-mount" + +do_install_append() { + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/init-lxc-mount ${D}${sysconfdir}/init.d/init-lxc-mount +} + +FILES_${PN} += "${sysconfdir}/init.d/init-lxc-mount" diff --git a/recipes-core/base-files/base-files_3.0.14.bbappend b/recipes-core/base-files/base-files_3.0.14.bbappend new file mode 100644 index 0000000..98b5395 --- /dev/null +++ b/recipes-core/base-files/base-files_3.0.14.bbappend @@ -0,0 +1,13 @@ +do_install_append() { +# Add cgroups to /etc/fstab + echo "# For LXC" >> ${D}${sysconfdir}/fstab + echo "cgroup /sys/fs/cgroup tmpfs defaults 0 0" >> ${D}${sysconfdir}/fstab + echo "cpuset /sys/fs/cgroup/cpuset cgroup cpuset,noauto 0 0" >> ${D}${sysconfdir}/fstab + echo "cpuacct /sys/fs/cgroup/cpu,cpuacct cgroup cpuacct,cpu,noauto 0 0" >> ${D}${sysconfdir}/fstab + echo "devices /sys/fs/cgroup/devices cgroup devices,noauto 0 0" >> ${D}${sysconfdir}/fstab + echo "freezer /sys/fs/cgroup/freezer cgroup freezer,noauto 0 0" >> ${D}${sysconfdir}/fstab + echo "memory /sys/fs/cgroup/memory cgroup memory,noauto 0 0" >> ${D}${sysconfdir}/fstab +# Fix for multiple dnsmasq instances when using libvirt. + echo "interface=eth0" >> ${D}${sysconfdir}/dnsmasq.conf + echo "bind-interfaces" >> ${D}${sysconfdir}/dnsmasq.conf +} diff --git a/recipes-core/packagegroups/packagegroup-enea-virt.bb b/recipes-core/packagegroups/packagegroup-enea-virt.bb new file mode 100644 index 0000000..c3a56bd --- /dev/null +++ b/recipes-core/packagegroups/packagegroup-enea-virt.bb @@ -0,0 +1,39 @@ +DESCRIPTION = "Package group for virtualization" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +PR = "r0" + +inherit packagegroup + +def if_arch_re(regexp, trueval, falseval, d): + import re + target_arch = bb.data.getVar('TUNE_ARCH', d, 1) + return trueval if re.match(regexp, target_arch) else falseval + +RDEPENDS_${PN} = " \ + qemu \ + libvirt \ + libvirt-libvirtd \ + libvirt-virsh \ + ${@if_arch_re("^(i[3-9]86|x86_64)", "kernel-module-kvm", "", d)} \ + ${@if_arch_re("^(i[3-9]86|x86_64)", "kernel-module-kvm-intel", "", d)} \ + lxc \ + " + +RDEPENDS_${PN}_remove_p2020rdb = " \ + qemu \ + " + +RDEPENDS_${PN}_remove_b4860qds-64b = " \ + qemu \ + " + +RDEPENDS_${PN}_remove_zc702-zynq7 = " \ + qemu \ + " + +RRECOMMENDS_${PN} = " \ + ${@if_arch_re("^(i[3-9]86|x86_64)", "kernel-module-igb", "", d)} \ + kernel-module-xt-conntrack \ + " diff --git a/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch b/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch new file mode 100644 index 0000000..13a6ea2 --- /dev/null +++ b/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch @@ -0,0 +1,84 @@ +fix libcap header issue on some distro + +1, When build qemu-native on SLED 11.2, there is an error: +... +| In file included from /usr/include/bits/sigcontext.h:28, +| from /usr/include/signal.h:339, +| from /buildarea2/tmp/work/i686-linux/qemu-native/1.4.0-r0/ +qemu-1.4.0/include/qemu-common.h:42, +| from fsdev/virtfs-proxy-helper.c:23: +| /usr/include/asm/sigcontext.h:28: error: expected specifier- +qualifier-list before '__u64' +| /usr/include/asm/sigcontext.h:191: error: expected specifier- +qualifier-list before '__u64' +... + +2, The virtfs-proxy-helper.c includes and +qemu-common.h in sequence. The header include map is: +(`-->' presents `include') +... +"virtfs-proxy-helper.c" --> +... +"virtfs-proxy-helper.c" --> "qemu-common.h" --> --> + --> --> --> + --> --> +... + +3, The bug is found on SLED 11.2 x86. In libcap header file +/usr/include/sys/capability.h, it does evil stuff like this: +... + 25 /* + 26 * Make sure we can be included from userland by preventing + 27 * capability.h from including other kernel headers + 28 */ + 29 #define _LINUX_TYPES_H + 30 #define _LINUX_FS_H + 31 #define __LINUX_COMPILER_H + 32 #define __user + 33 + 34 typedef unsigned int __u32; + 35 typedef __u32 __le32; +... +This completely prevents including /usr/include/linux/types.h. +The above ` --> ' is prevented, +and '__u64' is defined in . + +4, Modify virtfs-proxy-helper.c to include +last to workaround the issue. + +http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html +http://patchwork.linuxtv.org/patch/12748/ + +Upstream-Status: Pending +Signed-off-by: Hongxu Jia +--- + fsdev/virtfs-proxy-helper.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c +--- a/fsdev/virtfs-proxy-helper.c ++++ b/fsdev/virtfs-proxy-helper.c +@@ -12,7 +12,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -26,7 +25,11 @@ + #include "virtio-9p-marshal.h" + #include "hw/9pfs/virtio-9p-proxy.h" + #include "fsdev/virtio-9p-marshal.h" +- ++/* ++ * Include this one last due to some versions of it being buggy: ++ * http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html ++ */ ++#include + #define PROGNAME "virtfs-proxy-helper" + + #ifndef XFS_SUPER_MAGIC +-- +1.7.10.4 + diff --git a/recipes-devtools/qemu/qemu_2.3.0.bb b/recipes-devtools/qemu/qemu_2.3.0.bb new file mode 100644 index 0000000..8ef3719 --- /dev/null +++ b/recipes-devtools/qemu/qemu_2.3.0.bb @@ -0,0 +1,38 @@ +require recipes-devtools/qemu/qemu.inc + +PROVIDES = "qemu" + +# This is v2.3.0 +#SRCREV = "e5b3a24181ea0cebf1c5b20f44d016311b7048f0" + +LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ + file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913" + +# Discard all files included in qemu.inc, we're not interested in them here +# This is why it is an "=" and not _prepend or "+=" as in other recipes: +SRC_URI = "git://git.qemu.org/qemu.git;tag=v2.3.0" +S = "${WORKDIR}/git" + +DEFAULT_PREFERENCE = "-1" + +COMPATIBLE_HOST_class-target_mips64 = "null" + +# build arm emulators only +QEMU_TARGETS = "arm aarch64" + +# Override --disable-glx, which now is --disable-opengl +PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa" +PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,mesa" + +FILES_${PN} += " \ + /run \ + /usr/share/qemu \ + " + +# Our own do_install function so it doesn't try to install powerpc_rom.bin: +do_install () { + export STRIP="true" + autotools_do_install + install -d ${D}${datadir}/qemu +} + diff --git a/recipes-example/virt-example/files/LICENSE b/recipes-example/virt-example/files/LICENSE new file mode 100644 index 0000000..22b249d --- /dev/null +++ b/recipes-example/virt-example/files/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2014 by Enea Software AB +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Enea Software AB nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/recipes-example/virt-example/files/example-container.conf b/recipes-example/virt-example/files/example-container.conf new file mode 100644 index 0000000..e2e8d5e --- /dev/null +++ b/recipes-example/virt-example/files/example-container.conf @@ -0,0 +1,50 @@ +#Copyright (c) 2014 by Enea Software AB +#All rights reserved. +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Enea Software AB nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +#ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +#(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +#ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +#SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +lxc.tty = 2 +lxc.pts = 2 +lxc.rootfs = /container-images/example-container-rootfs/ +lxc.autodev = 1 +lxc.cgroup.cpuset.cpus = 3 + +lxc.cgroup.devices.deny = a +# /dev/null and zero +lxc.cgroup.devices.allow = c 1:3 rwm +lxc.cgroup.devices.allow = c 1:5 rwm +# /dev/{,u}random +lxc.cgroup.devices.allow = c 1:9 rwm +lxc.cgroup.devices.allow = c 1:8 rwm +# pts consoles +lxc.cgroup.devices.allow = c 136:* rwm +lxc.cgroup.devices.allow = c 5:2 rwm +# rtc +lxc.cgroup.devices.allow = c 254:0 rwm + +lxc.utsname = example-container + +lxc.network.type = veth +lxc.network.link = example-bridge +lxc.network.veth.pair = example-veth +lxc.network.flags = up diff --git a/recipes-example/virt-example/files/example-guest-aarch64.xml b/recipes-example/virt-example/files/example-guest-aarch64.xml new file mode 100644 index 0000000..584ee97 --- /dev/null +++ b/recipes-example/virt-example/files/example-guest-aarch64.xml @@ -0,0 +1,63 @@ + + + + kvm-example-guest + 500 + 2 + + hvm + /usr/share/virt-example/Image.bin + /usr/share/virt-example/rootfs.cpio.gz + "earlyprintk=pl011,0x9000000 console=ttyAMA0 rootwait root=/dev/ram rw" + + destroy + restart + destroy + + + + + 2 + + + + + + + + /usr/bin/qemu-system-aarch64 + + + + + + + + + + diff --git a/recipes-example/virt-example/files/example-guest-ppc.xml b/recipes-example/virt-example/files/example-guest-ppc.xml new file mode 100644 index 0000000..624bb56 --- /dev/null +++ b/recipes-example/virt-example/files/example-guest-ppc.xml @@ -0,0 +1,55 @@ + + + + kvm-example-guest + 500 + 1 + + hvm + /usr/share/virt-example/ppc-uImage.bin + /usr/share/virt-example/ppc-ramdisk.cpio.gz + console=ttyS0 + + destroy + restart + destroy + + + + + + /usr/bin/qemu-system-ppc + + + + + + + + + diff --git a/recipes-example/virt-example/files/example-guest-x86.xml b/recipes-example/virt-example/files/example-guest-x86.xml new file mode 100644 index 0000000..a3d4f6a --- /dev/null +++ b/recipes-example/virt-example/files/example-guest-x86.xml @@ -0,0 +1,71 @@ + + + + kvm-example-guest + 2000000 + 2 + + hvm + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/recipes-example/virt-example/files/example-net.xml b/recipes-example/virt-example/files/example-net.xml new file mode 100644 index 0000000..c8cbca7 --- /dev/null +++ b/recipes-example/virt-example/files/example-net.xml @@ -0,0 +1,39 @@ + + + + virt-example-net + + + + + + + + + + diff --git a/recipes-example/virt-example/files/pxe/pxelinux.cfg/default b/recipes-example/virt-example/files/pxe/pxelinux.cfg/default new file mode 100755 index 0000000..753d6db --- /dev/null +++ b/recipes-example/virt-example/files/pxe/pxelinux.cfg/default @@ -0,0 +1,10 @@ +SERIAL 0 115200 0xab3 + +DEFAULT kvm-example + +LABEL kvm-example + kernel bzImage + append console=ttyS0,115200n8 initrd=enea-image-kvm-example-guest.cpio.gz + +PROMPT 1 +TIMEOUT 0 diff --git a/recipes-example/virt-example/virt-example_1.0.0.bb b/recipes-example/virt-example/virt-example_1.0.0.bb new file mode 100644 index 0000000..86672fe --- /dev/null +++ b/recipes-example/virt-example/virt-example_1.0.0.bb @@ -0,0 +1,42 @@ +DESCRIPTION = "KVM and libvirt examples" + +FILESEXTRAPATHS_append := ":${THISDIR}/files" + +DEPENDS_append_x86-64 += "syslinux" + +SRC_URI = " \ + file://example-container.conf \ + file://example-guest-aarch64.xml \ + file://example-guest-x86.xml \ + file://example-guest-ppc.xml \ + file://example-net.xml \ + file://LICENSE \ + file://pxe/pxelinux.cfg/default \ +" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=b52bab7a403562f36be803f11489f1a4" + +S = "${WORKDIR}" + +DESTDIR = "/usr/share/${PN}/" + +FILES_${PN} = " \ + ${DESTDIR}example-container.conf \ + ${DESTDIR}example-guest-aarch64.xml \ + ${DESTDIR}example-guest-x86.xml \ + ${DESTDIR}example-guest-ppc.xml \ + ${DESTDIR}example-net.xml \ + ${DESTDIR}pxe/pxelinux.cfg/default \ +" + +do_install() { + install -d ${D}${DESTDIR} + install -d ${D}${DESTDIR}pxe/pxelinux.cfg/ + install ${WORKDIR}/pxe/pxelinux.cfg/default ${D}${DESTDIR}pxe/pxelinux.cfg/ + install ${WORKDIR}/example-container.conf ${D}${DESTDIR} + install ${WORKDIR}/example-guest-aarch64.xml ${D}${DESTDIR} + install ${WORKDIR}/example-guest-x86.xml ${D}${DESTDIR} + install ${WORKDIR}/example-guest-ppc.xml ${D}${DESTDIR} + install ${WORKDIR}/example-net.xml ${D}${DESTDIR} +} diff --git a/recipes-extra/python-urlgrabber/python-urlgrabber/pycurl-curl.patch b/recipes-extra/python-urlgrabber/python-urlgrabber/pycurl-curl.patch new file mode 100644 index 0000000..50f87e8 --- /dev/null +++ b/recipes-extra/python-urlgrabber/python-urlgrabber/pycurl-curl.patch @@ -0,0 +1,288 @@ +It seems that pycurl has been renamed to curl. + +Signed-off-by: Jonas Eriksson +Upstream-Status: Pending +diff -uNrp urlgrabber-3.10.1.orig/urlgrabber/grabber.py urlgrabber-3.10.1/urlgrabber/grabber.py +--- urlgrabber-3.10.1.orig/urlgrabber/grabber.py 2014-03-04 17:08:52.345678844 +0100 ++++ urlgrabber-3.10.1/urlgrabber/grabber.py 2014-03-04 17:09:49.074595399 +0100 +@@ -88,7 +88,7 @@ GENERAL ARGUMENTS (kwargs) + a positive integer expressing the number of seconds to wait before + timing out attempts to connect to a server. If the value is None + or 0, connection attempts will not time out. The timeout is passed +- to the underlying pycurl object as its CONNECTTIMEOUT option, see ++ to the underlying curl object as its CONNECTTIMEOUT option, see + the curl documentation on CURLOPT_CONNECTTIMEOUT for more information. + http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTCONNECTTIMEOUT + +@@ -509,7 +509,7 @@ import mimetools + import thread + import types + import stat +-import pycurl ++import curl + from ftplib import parse150 + from StringIO import StringIO + from httplib import HTTPException +@@ -821,7 +821,7 @@ class URLParser: + + def process_http(self, parts, url): + (scheme, host, path, parm, query, frag) = parts +- # TODO: auth-parsing here, maybe? pycurl doesn't really need it ++ # TODO: auth-parsing here, maybe? curl doesn't really need it + return (scheme, host, path, parm, query, frag) + + def quote(self, parts): +@@ -983,7 +983,7 @@ class URLGrabberOptions: + self.username = None + self.password = None + self.ssl_ca_cert = None # sets SSL_CAINFO - path to certdb +- self.ssl_context = None # no-op in pycurl ++ self.ssl_context = None # no-op in curl + self.ssl_verify_peer = True # check peer's cert for authenticityb + self.ssl_verify_host = True # make sure who they are and who the cert is for matches + self.ssl_key = None # client key +@@ -1355,7 +1355,7 @@ class PyCurlFileObject(object): + + return len(buf) + except KeyboardInterrupt: +- return pycurl.READFUNC_ABORT ++ return curl.READFUNC_ABORT + + def _return_hdr_obj(self): + if self._parsed_hdr: +@@ -1370,7 +1370,7 @@ class PyCurlFileObject(object): + + hdr = property(_return_hdr_obj) + http_code = property(fget= +- lambda self: self.curl_obj.getinfo(pycurl.RESPONSE_CODE)) ++ lambda self: self.curl_obj.getinfo(curl.RESPONSE_CODE)) + + def _set_opts(self, opts={}): + # XXX +@@ -1379,109 +1379,109 @@ class PyCurlFileObject(object): + + # keepalives + if not opts.keepalive: +- self.curl_obj.setopt(pycurl.FORBID_REUSE, 1) ++ self.curl_obj.setopt(curl.FORBID_REUSE, 1) + + # defaults we're always going to set +- self.curl_obj.setopt(pycurl.NOPROGRESS, False) +- self.curl_obj.setopt(pycurl.NOSIGNAL, True) +- self.curl_obj.setopt(pycurl.WRITEFUNCTION, self._retrieve) +- self.curl_obj.setopt(pycurl.HEADERFUNCTION, self._hdr_retrieve) +- self.curl_obj.setopt(pycurl.PROGRESSFUNCTION, self._progress_update) +- self.curl_obj.setopt(pycurl.FAILONERROR, True) +- self.curl_obj.setopt(pycurl.OPT_FILETIME, True) +- self.curl_obj.setopt(pycurl.FOLLOWLOCATION, True) ++ self.curl_obj.setopt(curl.NOPROGRESS, False) ++ self.curl_obj.setopt(curl.NOSIGNAL, True) ++ self.curl_obj.setopt(curl.WRITEFUNCTION, self._retrieve) ++ self.curl_obj.setopt(curl.HEADERFUNCTION, self._hdr_retrieve) ++ self.curl_obj.setopt(curl.PROGRESSFUNCTION, self._progress_update) ++ self.curl_obj.setopt(curl.FAILONERROR, True) ++ self.curl_obj.setopt(curl.OPT_FILETIME, True) ++ self.curl_obj.setopt(curl.FOLLOWLOCATION, True) + + if DEBUG and DEBUG.level <= 10: +- self.curl_obj.setopt(pycurl.VERBOSE, True) ++ self.curl_obj.setopt(curl.VERBOSE, True) + if opts.user_agent: +- self.curl_obj.setopt(pycurl.USERAGENT, opts.user_agent) ++ self.curl_obj.setopt(curl.USERAGENT, opts.user_agent) + if opts.ip_resolve: + # Default is: IPRESOLVE_WHATEVER + ipr = opts.ip_resolve.lower() + if ipr == 'whatever': # Do we need this? +- self.curl_obj.setopt(pycurl.IPRESOLVE,pycurl.IPRESOLVE_WHATEVER) ++ self.curl_obj.setopt(curl.IPRESOLVE,curl.IPRESOLVE_WHATEVER) + if ipr == 'ipv4': +- self.curl_obj.setopt(pycurl.IPRESOLVE, pycurl.IPRESOLVE_V4) ++ self.curl_obj.setopt(curl.IPRESOLVE, curl.IPRESOLVE_V4) + if ipr == 'ipv6': +- self.curl_obj.setopt(pycurl.IPRESOLVE, pycurl.IPRESOLVE_V6) ++ self.curl_obj.setopt(curl.IPRESOLVE, curl.IPRESOLVE_V6) + + # maybe to be options later +- self.curl_obj.setopt(pycurl.FOLLOWLOCATION, True) +- self.curl_obj.setopt(pycurl.MAXREDIRS, 5) ++ self.curl_obj.setopt(curl.FOLLOWLOCATION, True) ++ self.curl_obj.setopt(curl.MAXREDIRS, 5) + + # timeouts + timeout = 300 + if hasattr(opts, 'timeout'): + timeout = int(opts.timeout or 0) +- self.curl_obj.setopt(pycurl.CONNECTTIMEOUT, timeout) +- self.curl_obj.setopt(pycurl.LOW_SPEED_LIMIT, opts.minrate or 1000) +- self.curl_obj.setopt(pycurl.LOW_SPEED_TIME, timeout) ++ self.curl_obj.setopt(curl.CONNECTTIMEOUT, timeout) ++ self.curl_obj.setopt(curl.LOW_SPEED_LIMIT, opts.minrate or 1000) ++ self.curl_obj.setopt(curl.LOW_SPEED_TIME, timeout) + + # ssl options + if self.scheme == 'https': + if opts.ssl_ca_cert: # this may do ZERO with nss according to curl docs +- self.curl_obj.setopt(pycurl.CAPATH, opts.ssl_ca_cert) +- self.curl_obj.setopt(pycurl.CAINFO, opts.ssl_ca_cert) +- self.curl_obj.setopt(pycurl.SSL_VERIFYPEER, opts.ssl_verify_peer) ++ self.curl_obj.setopt(curl.CAPATH, opts.ssl_ca_cert) ++ self.curl_obj.setopt(curl.CAINFO, opts.ssl_ca_cert) ++ self.curl_obj.setopt(curl.SSL_VERIFYPEER, opts.ssl_verify_peer) + if opts.ssl_verify_host: # 1 is meaningless to curl +- self.curl_obj.setopt(pycurl.SSL_VERIFYHOST, 2) ++ self.curl_obj.setopt(curl.SSL_VERIFYHOST, 2) + if opts.ssl_key: +- self.curl_obj.setopt(pycurl.SSLKEY, opts.ssl_key) ++ self.curl_obj.setopt(curl.SSLKEY, opts.ssl_key) + if opts.ssl_key_type: +- self.curl_obj.setopt(pycurl.SSLKEYTYPE, opts.ssl_key_type) ++ self.curl_obj.setopt(curl.SSLKEYTYPE, opts.ssl_key_type) + if opts.ssl_cert: +- self.curl_obj.setopt(pycurl.SSLCERT, opts.ssl_cert) ++ self.curl_obj.setopt(curl.SSLCERT, opts.ssl_cert) + # if we have a client side cert - turn off reuse b/c nss is odd +- self.curl_obj.setopt(pycurl.FORBID_REUSE, 1) ++ self.curl_obj.setopt(curl.FORBID_REUSE, 1) + if opts.ssl_cert_type: +- self.curl_obj.setopt(pycurl.SSLCERTTYPE, opts.ssl_cert_type) ++ self.curl_obj.setopt(curl.SSLCERTTYPE, opts.ssl_cert_type) + if opts.ssl_key_pass: +- self.curl_obj.setopt(pycurl.SSLKEYPASSWD, opts.ssl_key_pass) ++ self.curl_obj.setopt(curl.SSLKEYPASSWD, opts.ssl_key_pass) + + #headers: + if opts.http_headers and self.scheme in ('http', 'https'): + headers = [] + for (tag, content) in opts.http_headers: + headers.append('%s:%s' % (tag, content)) +- self.curl_obj.setopt(pycurl.HTTPHEADER, headers) ++ self.curl_obj.setopt(curl.HTTPHEADER, headers) + + # ranges: + if opts.range or opts.reget: + range_str = self._build_range() + if range_str: +- self.curl_obj.setopt(pycurl.RANGE, range_str) ++ self.curl_obj.setopt(curl.RANGE, range_str) + + # throttle/bandwidth + if hasattr(opts, 'raw_throttle') and opts.raw_throttle(): +- self.curl_obj.setopt(pycurl.MAX_RECV_SPEED_LARGE, int(opts.raw_throttle())) ++ self.curl_obj.setopt(curl.MAX_RECV_SPEED_LARGE, int(opts.raw_throttle())) + + # proxy + if opts.proxy is not None: +- self.curl_obj.setopt(pycurl.PROXY, opts.proxy) +- self.curl_obj.setopt(pycurl.PROXYAUTH, ++ self.curl_obj.setopt(curl.PROXY, opts.proxy) ++ self.curl_obj.setopt(curl.PROXYAUTH, + # All but Kerberos. BZ 769254 +- pycurl.HTTPAUTH_ANY - pycurl.HTTPAUTH_GSSNEGOTIATE) ++ curl.HTTPAUTH_ANY - curl.HTTPAUTH_GSSNEGOTIATE) + + if opts.username and opts.password: + if self.scheme in ('http', 'https'): +- self.curl_obj.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_ANY) ++ self.curl_obj.setopt(curl.HTTPAUTH, curl.HTTPAUTH_ANY) + + if opts.username and opts.password: + # apparently when applying them as curlopts they do not require quoting of any kind + userpwd = '%s:%s' % (opts.username, opts.password) +- self.curl_obj.setopt(pycurl.USERPWD, userpwd) ++ self.curl_obj.setopt(curl.USERPWD, userpwd) + + #posts - simple - expects the fields as they are + if opts.data: +- self.curl_obj.setopt(pycurl.POST, True) +- self.curl_obj.setopt(pycurl.POSTFIELDS, _to_utf8(opts.data)) ++ self.curl_obj.setopt(curl.POST, True) ++ self.curl_obj.setopt(curl.POSTFIELDS, _to_utf8(opts.data)) + + # ftp + if opts.ftp_disable_epsv: +- self.curl_obj.setopt(pycurl.FTP_USE_EPSV, False) ++ self.curl_obj.setopt(curl.FTP_USE_EPSV, False) + + # our url +- self.curl_obj.setopt(pycurl.URL, self.url) ++ self.curl_obj.setopt(curl.URL, self.url) + + + def _do_perform(self): +@@ -1490,7 +1490,7 @@ class PyCurlFileObject(object): + + try: + self.curl_obj.perform() +- except pycurl.error, e: ++ except curl.error, e: + # XXX - break some of these out a bit more clearly + # to other URLGrabErrors from + # http://curl.haxx.se/libcurl/c/libcurl-errors.html +@@ -1505,11 +1505,11 @@ class PyCurlFileObject(object): + + if errcode == 23 and 200 <= code <= 299: + # this is probably wrong but ultimately this is what happens +- # we have a legit http code and a pycurl 'writer failed' code ++ # we have a legit http code and a curl 'writer failed' code + # which almost always means something aborted it from outside + # since we cannot know what it is -I'm banking on it being + # a ctrl-c. XXXX - if there's a way of going back two raises to +- # figure out what aborted the pycurl process FIXME ++ # figure out what aborted the curl process FIXME + raise getattr(self, '_cb_error', KeyboardInterrupt) + + elif errcode == 28: +@@ -1519,11 +1519,11 @@ class PyCurlFileObject(object): + + elif errcode == 42: + # this is probably wrong but ultimately this is what happens +- # we have a legit http code and a pycurl 'writer failed' code ++ # we have a legit http code and a curl 'writer failed' code + # which almost always means something aborted it from outside + # since we cannot know what it is -I'm banking on it being + # a ctrl-c. XXXX - if there's a way of going back two raises to +- # figure out what aborted the pycurl process FIXME ++ # figure out what aborted the curl process FIXME + raise KeyboardInterrupt + + else: +@@ -1750,7 +1750,7 @@ class PyCurlFileObject(object): + pass # URL too long. = IOError ... ignore everything. + + # set the time +- mod_time = self.curl_obj.getinfo(pycurl.INFO_FILETIME) ++ mod_time = self.curl_obj.getinfo(curl.INFO_FILETIME) + if mod_time != -1: + try: + os.utime(self.filename, (mod_time, mod_time)) +@@ -1863,7 +1863,7 @@ class PyCurlFileObject(object): + + msg = _("Downloaded more than max size for %s: %s > %s") \ + % (self.url, cur, max_size) +- self._error = (pycurl.E_FILESIZE_EXCEEDED, msg) ++ self._error = (curl.E_FILESIZE_EXCEEDED, msg) + return True + return False + +@@ -1903,16 +1903,16 @@ class PyCurlFileObject(object): + urllib.addinfourl, via. urllib.URLopener.* """ + return self.url + +-if hasattr(pycurl, 'GLOBAL_ACK_EINTR'): ++if hasattr(curl, 'GLOBAL_ACK_EINTR'): + # fail immediately on ctrl-c +- pycurl.global_init(pycurl.GLOBAL_DEFAULT | pycurl.GLOBAL_ACK_EINTR) +-_curl_cache = pycurl.Curl() # make one and reuse it over and over and over ++ curl.global_init(curl.GLOBAL_DEFAULT | curl.GLOBAL_ACK_EINTR) ++_curl_cache = curl.Curl() # make one and reuse it over and over and over + + def reset_curl_obj(): + """To make sure curl has reread the network/dns info we force a reload""" + global _curl_cache + _curl_cache.close() +- _curl_cache = pycurl.Curl() ++ _curl_cache = curl.Curl() + + _libproxy_cache = None + diff --git a/recipes-extra/python-urlgrabber/python-urlgrabber_3.10.1.bb b/recipes-extra/python-urlgrabber/python-urlgrabber_3.10.1.bb new file mode 100644 index 0000000..97dab20 --- /dev/null +++ b/recipes-extra/python-urlgrabber/python-urlgrabber_3.10.1.bb @@ -0,0 +1,37 @@ +DESCRIPTION = "urlgrabber is a pure python package that drastically simplifies the fetching of files." + +HOMEPAGE = "http://urlgrabber.baseurl.org/" +SECTION = "devel/python" +PRIORITY = "optional" +LICENSE = "LGPL2.1+" +PR = "r1" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=68ad62c64cc6c620126241fd429e68fe" + +SRC_URI = "http://urlgrabber.baseurl.org/download/urlgrabber-${PV}.tar.gz \ + file://pycurl-curl.patch" + +S = "${WORKDIR}/urlgrabber-${PV}" + +SRC_URI[md5sum] = "1f5dc63805623cc473e06204fd240bb2" +SRC_URI[sha256sum] = "06b13ff8d527dba3aee04069681b2c09c03117592d5485a80ae4b807cdf33476" + +RDEPENDS_${PN} = "python-pycurl" + +inherit distutils + +FILES_${PN} += "/usr/share/libexec" + +# setup.py will try to include the urlgrabber package, which fails since we +# don't have pycurl in the native sysroot. It's included just to get the +# version and description text strings for inclusion in the package. Avoid this +# by dynamically creating a version of urlgrabber that does not include the +# actual urlgrabber features, that setup.py can include. +do_patch() { + # Create a non-importing version of urlgrabber for the setup script + mkdir ${S}/urlgrabber_version + sed 's/^from grabber import.*//' ${S}/urlgrabber/__init__.py > ${S}/urlgrabber_version/__init__.py + + # Make sure the setup script uses the version-only urlgrabber + sed -i 's/import urlgrabber/&_version/' ${S}/setup.py +} diff --git a/recipes-extra/virt-manager/virt-manager_1.0.0.bb b/recipes-extra/virt-manager/virt-manager_1.0.0.bb new file mode 100644 index 0000000..21ad3bb --- /dev/null +++ b/recipes-extra/virt-manager/virt-manager_1.0.0.bb @@ -0,0 +1,72 @@ +SUMMARY = "virt-manager" +DESCRIPTION = "virt-manager" +HOMEPAGE = "http://virt-manager.org" +SECTION = "devel" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" + +SRC_URI = "https://fedorahosted.org/released/virt-manager/virt-manager-${PV}.tar.gz" +SRC_URI[sha256sum] = "2b2f59f7fccd2fcfbaf4306e33342e5d2be8f0ddd71af9eeca0c1f215e1e29aa" +SRC_URI[md5sum] = "8a0585de48d8060a5394aae912342c95" + +sharedir = "${datadir}" + +FILES_${PN} = " \ + ${bindir}/virt-clone \ + ${bindir}/virt-image \ + ${bindir}/virt-install \ + ${bindir}/virt-convert \ + ${bindir}/virt-xml \ + ${sharedir}/virt-manager/virt-clone \ + ${sharedir}/virt-manager/virt-image \ + ${sharedir}/virt-manager/virt-install \ + ${sharedir}/virt-manager/virt-convert \ + ${sharedir}/virt-manager/virt-xml \ + ${sharedir}/virt-manager/virtinst \ + ${sharedir}/virt-manager/virtconv \ + ${sharedir}/virt-manager/virtcli \ + \ + ${sharedir}/virt-manager/virt-manager \ + ${sharedir}/virt-manager/virtManager \ + ${sharedir}/virt-manager/ui \ + ${sharedir}/virt-manager/icons \ + ${sharedir}/icons \ + ${sharedir}/appdata \ + ${sharedir}/applications \ + ${sharedir}/glib-2.0 \ + ${@base_contains('DISTRO_FEATURES', 'x11', '${bindir}/virt-manager', '', d)} \ + " + +DEPENDS = "nativesdk-perl" + +RDEPENDS_${PN} = " \ + libvirt-python \ + python-urlgrabber \ + libxml2-python \ + ${@base_contains('DISTRO_FEATURES', 'x11', 'python-pygtk', '', d)} \ + " + + +do_configure() { + python setup.py configure +} + +do_build() { + python setup.py build --prefix=${prefix} +} + +# virt-manager is the only command that requires graphical libraries. The +# package does however not supply a --no-graphics argument or such to the +# install program, which is understandable since distutils (which is +# undocumented to a large degree) seems to be called with the complete file +# list before the argument parsing is performed. To avoid that this command is +# available when the package is built as part of a non-x11 distro, remove the +# /usr/bin/virt-manager file. + +REMOVE_COMMAND = "${@base_contains('DISTRO_FEATURES', 'x11', '', 'rm ${D}${bindir}/virt-manager', d)}" +do_install() { + python setup.py install --prefix=${prefix} --root=${D} + + sh -c "${REMOVE_COMMAND}" +} diff --git a/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch b/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch new file mode 100644 index 0000000..058e676 --- /dev/null +++ b/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch @@ -0,0 +1,29 @@ +From: Stephane Eranian +Date: Wed Apr 23 2014 - 13:04:31 EST +This patch fixes a bug introduced by commit 24223657. + +perf/x86: fix RAPL rdmsrl_safe() usage + +The rdmsrl_safe() function returns 0 on success. +The current code was failing to detect the RAPL PMU +on real hardware (missing /sys/devices/power) because +the return value of rdmsrl_safe() was misinterpreted. + +Signed-off-by: Stephane Eranian +Upstream-Status: Backport [http://lkml.iu.edu/hypermail/linux/kernel/1404.2/05008.html] + +diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c +index 7c87424..619f769 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c +@@ -543,7 +543,8 @@ static int rapl_cpu_prepare(int cpu) + if (phys_id < 0) + return -1; + +- if (!rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) ++ /* protect rdmsrl() to handle virtualization */ ++ if (rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) + return -1; + + pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); +-- diff --git a/recipes-kernel/linux/files/perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch b/recipes-kernel/linux/files/perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch new file mode 100644 index 0000000..6b29970 --- /dev/null +++ b/recipes-kernel/linux/files/perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch @@ -0,0 +1,80 @@ +From 24223657806a0ebd0ae5c9caaf7b021091889cf2 Mon Sep 17 00:00:00 2001 +From: Venkatesh Srinivas +Date: Thu, 13 Mar 2014 12:36:26 -0700 +Subject: [PATCH] perf/x86/intel: Use rdmsrl_safe() when initializing RAPL PMU + +CPUs which should support the RAPL counters according to +Family/Model/Stepping may still issue #GP when attempting to access +the RAPL MSRs. This may happen when Linux is running under KVM and +we are passing-through host F/M/S data, for example. Use rdmsrl_safe +to first access the RAPL_POWER_UNIT MSR; if this fails, do not +attempt to use this PMU. + +Signed-off-by: Venkatesh Srinivas +Signed-off-by: Peter Zijlstra +Link: http://lkml.kernel.org/r/1394739386-22260-1-git-send-email-venkateshs@google.com +Cc: zheng.z.yan@intel.com +Cc: eranian@google.com +Cc: ak@linux.intel.com +Cc: linux-kernel@vger.kernel.org +[ The patch also silently fixes another bug: rapl_pmu_init() didn't handle the memory alloc failure case previously. ] +Signed-off-by: Ingo Molnar +Upstream-Status: Backport +--- + arch/x86/kernel/cpu/perf_event_intel_rapl.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c +index 4b9a9e9..7c87424 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c +@@ -535,6 +535,7 @@ static int rapl_cpu_prepare(int cpu) + struct rapl_pmu *pmu = per_cpu(rapl_pmu, cpu); + int phys_id = topology_physical_package_id(cpu); + u64 ms; ++ u64 msr_rapl_power_unit_bits; + + if (pmu) + return 0; +@@ -542,6 +543,9 @@ static int rapl_cpu_prepare(int cpu) + if (phys_id < 0) + return -1; + ++ if (!rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) ++ return -1; ++ + pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); + if (!pmu) + return -1; +@@ -555,8 +559,7 @@ static int rapl_cpu_prepare(int cpu) + * + * we cache in local PMU instance + */ +- rdmsrl(MSR_RAPL_POWER_UNIT, pmu->hw_unit); +- pmu->hw_unit = (pmu->hw_unit >> 8) & 0x1FULL; ++ pmu->hw_unit = (msr_rapl_power_unit_bits >> 8) & 0x1FULL; + pmu->pmu = &rapl_pmu_class; + + /* +@@ -677,7 +680,9 @@ static int __init rapl_pmu_init(void) + cpu_notifier_register_begin(); + + for_each_online_cpu(cpu) { +- rapl_cpu_prepare(cpu); ++ ret = rapl_cpu_prepare(cpu); ++ if (ret) ++ goto out; + rapl_cpu_init(cpu); + } + +@@ -700,6 +705,7 @@ static int __init rapl_pmu_init(void) + hweight32(rapl_cntr_mask), + ktime_to_ms(pmu->timer_interval)); + ++out: + put_online_cpus(); + + return 0; +-- +1.9.0 + diff --git a/recipes-kernel/linux/linux-boundary_3.10.17.bbappend b/recipes-kernel/linux/linux-boundary_3.10.17.bbappend new file mode 100644 index 0000000..dc6b877 --- /dev/null +++ b/recipes-kernel/linux/linux-boundary_3.10.17.bbappend @@ -0,0 +1,13 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +require recipes-kernel/linux/kernel-configure.inc + +KERNEL_DEFCONFIG = "${B}/.config" +KERNEL_FEATURES = " \ + cfg/00043-containers \ + cfg/00047-bridge \ + " + +do_configure_append() { + configure_kernel ${KERNEL_DEFCONFIG} "${KERNEL_FEATURES}" +} diff --git a/recipes-kernel/linux/linux-keystone_3.10.bbappend b/recipes-kernel/linux/linux-keystone_3.10.bbappend new file mode 100644 index 0000000..7914b77 --- /dev/null +++ b/recipes-kernel/linux/linux-keystone_3.10.bbappend @@ -0,0 +1,13 @@ +SRC_URI += " \ + file://cfg/00040-9p.cfg \ + file://cfg/00041-virtio.cfg \ + file://cfg/00042-vhost.cfg \ + file://cfg/00043-containers.cfg \ + " + +KERNEL_FEATURES_append = "\ + cfg/00040-9p \ + cfg/00041-virtio \ + cfg/00042-vhost \ + cfg/00043-containers \ +" diff --git a/recipes-kernel/linux/linux-proliant-m400.bbappend b/recipes-kernel/linux/linux-proliant-m400.bbappend new file mode 100644 index 0000000..7914b77 --- /dev/null +++ b/recipes-kernel/linux/linux-proliant-m400.bbappend @@ -0,0 +1,13 @@ +SRC_URI += " \ + file://cfg/00040-9p.cfg \ + file://cfg/00041-virtio.cfg \ + file://cfg/00042-vhost.cfg \ + file://cfg/00043-containers.cfg \ + " + +KERNEL_FEATURES_append = "\ + cfg/00040-9p \ + cfg/00041-virtio \ + cfg/00042-vhost \ + cfg/00043-containers \ +" diff --git a/recipes-kernel/linux/linux-qoriq_3.12.bbappend b/recipes-kernel/linux/linux-qoriq_3.12.bbappend new file mode 100644 index 0000000..f037b6f --- /dev/null +++ b/recipes-kernel/linux/linux-qoriq_3.12.bbappend @@ -0,0 +1,24 @@ +SRC_URI =+ "\ + file://cfg/00035-netfilter.cfg \ + file://cfg/00036-ppc_virt.cfg \ + file://cfg/00037-ppc_lxc.cfg \ + file://cfg/00040-9p.cfg \ + file://cfg/00041-virtio.cfg \ + file://cfg/00042-vhost.cfg \ + file://cfg/00043-containers.cfg \ + file://cfg/00048-containers_no_user_ns.cfg \ + " + +VIRT_FEATURES = "\ + cfg/00035-netfilter \ + cfg/00036-ppc_virt \ + cfg/00037-ppc_lxc \ + cfg/00040-9p \ + cfg/00041-virtio \ + cfg/00042-vhost \ + cfg/00048-containers_no_user_ns \ +" + + +KERNEL_FEATURES_append_powerpc= " ${VIRT_FEATURES}" +KERNEL_FEATURES_remove_e500v2 = "cfg/00036-ppc_virt" diff --git a/recipes-kernel/linux/linux-xlnx_3.8.bbappend b/recipes-kernel/linux/linux-xlnx_3.8.bbappend new file mode 100644 index 0000000..e4cd65c --- /dev/null +++ b/recipes-kernel/linux/linux-xlnx_3.8.bbappend @@ -0,0 +1,7 @@ +SRC_URI_append = " \ + file://cfg/00035-netfilter.cfg \ + file://cfg/00040-9p.cfg \ + file://cfg/00041-virtio.cfg \ + file://cfg/00042-vhost.cfg \ + file://cfg/00043-containers.cfg \ + " diff --git a/recipes-kernel/linux/linux-yocto_3.10.bbappend b/recipes-kernel/linux/linux-yocto_3.10.bbappend new file mode 100644 index 0000000..7791d06 --- /dev/null +++ b/recipes-kernel/linux/linux-yocto_3.10.bbappend @@ -0,0 +1,6 @@ +SRC_URI += " \ + file://cfg/00040-9p.cfg \ + file://cfg/00041-virtio.cfg \ + file://cfg/00042-vhost.cfg \ + file://cfg/00043-containers.cfg \ + " diff --git a/recipes-kernel/linux/linux-yocto_3.14.bbappend b/recipes-kernel/linux/linux-yocto_3.14.bbappend new file mode 100644 index 0000000..a9cfb3c --- /dev/null +++ b/recipes-kernel/linux/linux-yocto_3.14.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRC_URI += "file://perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch \ + file://perf-x86-fix-RAPL-rdmsrl_safe-usage.patch \ + file://cfg/00040-9p.cfg \ + file://cfg/00041-virtio.cfg \ + file://cfg/00042-vhost.cfg \ + file://cfg/00043-containers.cfg \ + " diff --git a/recipes-missing/lksctp-tools/lksctp-tools_1.0.16.bb b/recipes-missing/lksctp-tools/lksctp-tools_1.0.16.bb new file mode 100644 index 0000000..2c229c3 --- /dev/null +++ b/recipes-missing/lksctp-tools/lksctp-tools_1.0.16.bb @@ -0,0 +1,57 @@ +DESCRIPTION = "The Linux Kernel Stream Control Transmission Protocol (lksctp) project" +SECTION = "libs" +LICENSE = "LGPLv2" + +LIC_FILES_CHKSUM = " \ + file://COPYING.lib;md5=0a1b79af951c42a9c8573533fbba9a92 \ + file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \ +" + +SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz" + +SRC_URI[md5sum] = "708bb0b5a6806ad6e8d13c55b067518e" +SRC_URI[sha256sum] = "0903dd526b7f30a89d5031aa2c82757612becc38ed7bc6e4f972f8deae351f26" + +S = "${WORKDIR}/${BP}" + +BBCLASSEXTEND = "native" + +inherit autotools pkgconfig binconfig + +SOLIBVERSION="${PV}" +SOLIBMAJORVERSION="1" + +PACKAGES =+ "${PN}-withsctp ${PN}-utils" + +FILES_${PN} = " \ + ${libdir}/libsctp.so.${SOLIBVERSION} \ +" + +FILES_${PN}-withsctp = " \ + ${libdir}/lksctp-tools/libwithsctp.so.${SOLIBVERSION} \ +" + +FILES_${PN}-dev += " \ + ${libdir}/libsctp.so.${SOLIBMAJORVERSION} \ + ${libdir}/libsctp.so \ + ${libdir}/lksctp-tools/libwithsctp.so.${SOLIBMAJORVERSION} \ + ${libdir}/lksctp-tools/libwithsctp.so \ + ${datadir}/lksctp-tools/checksctp.c \ + ${datadir}/lksctp-tools/sctp_socket.c \ + ${datadir}/lksctp-tools/sctp_status.c \ + ${datadir}/lksctp-tools/sctp_bind.c \ + ${datadir}/lksctp-tools/sctp_darn.c \ + ${datadir}/lksctp-tools/sctp_load_libs.c \ + ${datadir}/lksctp-tools/sctp_sockopt.c \ + ${datadir}/lksctp-tools/sctp_socket.h \ + ${datadir}/lksctp-tools/sctp_test.c \ + ${datadir}/lksctp-tools/sctp_darn.h \ +" + +FILES_${PN}-utils = " \ + ${bindir}/sctp_test \ + ${bindir}/sctp_darn \ + ${bindir}/checksctp \ + ${bindir}/withsctp \ + ${bindir}/sctp_status \ +" -- cgit v1.2.3-54-g00ecf