diff options
43 files changed, 1729 insertions, 0 deletions
@@ -0,0 +1,49 @@ | |||
1 | Enea Linux virtualization support | ||
2 | ================================= | ||
3 | |||
4 | This layer provides virtualization support and related tools to Enea Linux. | ||
5 | |||
6 | Supported Platforms | ||
7 | ------------------- | ||
8 | |||
9 | KVM - Kernel Virtual Machine for x86-64 and PowerPC (e500mc). | ||
10 | LXC - Linux Containers for x86-64, 32-bit ARM, PowerPC. | ||
11 | |||
12 | Dependencies | ||
13 | ------------ | ||
14 | meta-enea: | ||
15 | URI: git://git.enea.com/linux/meta-enea | ||
16 | branch: daisy | ||
17 | |||
18 | meta-virtualization: | ||
19 | URI: git://git.enea.com/linux/meta-virtualization | ||
20 | branch: daisy | ||
21 | |||
22 | meta-openembedded: | ||
23 | URI: git://git.enea.com/linux/meta-openembedded | ||
24 | branch: daisy | ||
25 | layers: meta-oe | ||
26 | meta-networking | ||
27 | |||
28 | Source Code | ||
29 | ----------- | ||
30 | |||
31 | git://git.enea.com/linux/meta-enea/meta-vt | ||
32 | |||
33 | Maintenance | ||
34 | ----------- | ||
35 | |||
36 | Maintainers: Enea Linux Team <linux-maintainers@enea.com> | ||
37 | |||
38 | Contributing | ||
39 | ------------ | ||
40 | |||
41 | Contributions and patches can be sent to the Enea Linux mailing | ||
42 | list: enealinux@lists.enea.com (open) | ||
43 | |||
44 | License | ||
45 | ------- | ||
46 | |||
47 | All metadata is MIT licensed unless otherwise stated. Source code included | ||
48 | in tree for individual recipes is under the LICENSE stated in each recipe | ||
49 | (.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 @@ | |||
1 | # We have a packages directory, add to BBFILES | ||
2 | BBPATH .= ":${LAYERDIR}" | ||
3 | |||
4 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb*" | ||
5 | BBFILES += "${LAYERDIR}/images/*.bb*" | ||
6 | BBFILES += "${LAYERDIR}/images-append/*.bb*" | ||
7 | |||
8 | BBFILE_COLLECTIONS += "enea-vt" | ||
9 | BBFILE_PATTERN_enea-vt := "^${LAYERDIR}/" | ||
10 | BBFILE_PRIORITY_enea-vt = "7" | ||
11 | LAYERDEPENDS_enea-vt = "enea" | ||
12 | |||
13 | 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 @@ | |||
1 | IMAGE_INSTALL += " \ | ||
2 | packagegroup-enea-virt \ | ||
3 | virt-example \ | ||
4 | " | ||
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 @@ | |||
1 | IMAGE_INSTALL += " \ | ||
2 | packagegroup-enea-virt \ | ||
3 | virt-example \ | ||
4 | " | ||
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 @@ | |||
1 | do_prepare_config_append () { | ||
2 | sed -i -e 's/# CONFIG_CHPASSWD is not set/CONFIG_CHPASSWD=y/' .config | ||
3 | } | ||
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 @@ | |||
1 | |||
2 | Upstream-status: Inappropriate (needed only for meta-fsl-ppc) | ||
3 | |||
4 | Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com> | ||
5 | |||
6 | diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c | ||
7 | index a5c6879..b491f58 100644 | ||
8 | --- a/src/qemu/qemu_capabilities.c | ||
9 | +++ b/src/qemu/qemu_capabilities.c | ||
10 | @@ -1956,7 +1956,7 @@ | ||
11 | if (qemuCaps->version >= 2000000) | ||
12 | return true; | ||
13 | |||
14 | - if (qemuCaps->version >= 1006000 && | ||
15 | + if (qemuCaps->version >= 1004000 && | ||
16 | STREQ(def->os.machine, "ppce500")) | ||
17 | return true; | ||
18 | |||
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 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
2 | |||
3 | SRC_URI_append_e500mc = " \ | ||
4 | file://Fix-pci-bus-naming-for-PPC.patch \ | ||
5 | " | ||
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 @@ | |||
1 | From df85edda5f6632f12f5802173a5012a35b19ccdd Mon Sep 17 00:00:00 2001 | ||
2 | From: Jonas Eriksson <jonas.eriksson@enea.com> | ||
3 | Date: Thu, 6 Mar 2014 08:22:23 +0100 | ||
4 | Subject: [PATCH] configure: Add --with-python-install-dir | ||
5 | |||
6 | Cross-compiling the python bindings is a bit difficult today, as the | ||
7 | configure script will figure out the site packages dir | ||
8 | (PYTHON_SITE_PACKAGES) by either: | ||
9 | |||
10 | - Generating the path to the site-package target directories using | ||
11 | libdir, and see if it exists. As it is not possible to point to the | ||
12 | full path of the sysroot, since that will yield the wrong install | ||
13 | path, and that the directory does not neccessarily exist on the host, | ||
14 | this approach will not work. | ||
15 | |||
16 | - Fetch the site packages dir from the python interpreter as pointed to | ||
17 | by --with-python. Since this python interpreter will point to the | ||
18 | sysroot, the install dir generated will be inside the sysroot and thus | ||
19 | not work. | ||
20 | |||
21 | This patch approaches the problem by adding the possibility of | ||
22 | explicitly stating the install dir of the python packages, leaving it up | ||
23 | to the cross-compilation environment to specify it. The patch does not | ||
24 | affect the default case (non-cross compilation). | ||
25 | |||
26 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
27 | |||
28 | Upstream-Status: Submitted [xml@gnome.org] | ||
29 | --- | ||
30 | configure.in | 7 +++++++ | ||
31 | 1 file changed, 7 insertions(+) | ||
32 | |||
33 | diff --git a/configure.in b/configure.in | ||
34 | index ecaa403..21ad1e7 100644 | ||
35 | --- a/configure.in | ||
36 | +++ b/configure.in | ||
37 | @@ -148,6 +148,9 @@ AC_ARG_WITH(push, | ||
38 | [ --with-push add the PUSH parser interfaces (on)]) | ||
39 | AC_ARG_WITH(python, | ||
40 | [ --with-python[[=DIR]] build Python bindings if found]) | ||
41 | +AC_ARG_WITH(python_install_dir, | ||
42 | +[ --with-python-install-dir=DIR | ||
43 | + install Python bindings in DIR]) | ||
44 | AC_ARG_WITH(reader, | ||
45 | [ --with-reader add the xmlReader parsing interface (on)]) | ||
46 | AC_ARG_WITH(readline, | ||
47 | @@ -866,6 +869,10 @@ if test "$with_python" != "no" ; then | ||
48 | fi | ||
49 | fi | ||
50 | fi | ||
51 | + if test "$with_python_install_dir" != "" | ||
52 | + then | ||
53 | + PYTHON_SITE_PACKAGES="$with_python_install_dir" | ||
54 | + fi | ||
55 | if test "$PYTHON_VERSION" != "" -a "$PYTHON_SITE_PACKAGES" = "" | ||
56 | then | ||
57 | if test -d $libdir/python$PYTHON_VERSION/site-packages | ||
58 | -- | ||
59 | 1.9.0 | ||
60 | |||
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 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
2 | |||
3 | SRC_URI += "file://configure-Add-with-python-install-dir.patch" | ||
4 | |||
5 | PACKAGES += "${PN}-python-staticdev ${PN}-python-dbg" | ||
6 | |||
7 | DEPENDS += "python-dev" | ||
8 | |||
9 | FILES_${PN}-python = " \ | ||
10 | ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.so \ | ||
11 | ${PYTHON_SITEPACKAGES_DIR}/drv_libxml2.py \ | ||
12 | ${PYTHON_SITEPACKAGES_DIR}/libxml2.py \ | ||
13 | " | ||
14 | FILES_${PN}-python-staticdev += " \ | ||
15 | ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.a \ | ||
16 | ${PYTHON_SITEPACKAGES_DIR}/libxml2mod.la \ | ||
17 | " | ||
18 | FILES_${PN}-python-dbg += " \ | ||
19 | ${PYTHON_SITEPACKAGES_DIR}/.debug/libxml2mod.so \ | ||
20 | " | ||
21 | |||
22 | # +: --with-catalog, --with-python-install-dir | ||
23 | 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" | ||
24 | |||
25 | # +: --with-python-install-dir | ||
26 | 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 @@ | |||
1 | PACKAGECONFIG ??= "sctp" | ||
2 | PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools," | ||
3 | |||
4 | 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 @@ | |||
1 | # Fixes the DEPENDS variable to not require x11 | ||
2 | DEPENDS = "glib-2.0 zlib alsa-lib pixman dtc libsdl \ | ||
3 | ${@base_contains('DISTRO_FEATURES', 'x11', 'virtual/libx11', '', d)}" | ||
4 | |||
5 | PACKAGECONFIG += "virtfs" | ||
6 | 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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | filter_output() { | ||
4 | test_name="$1" | ||
5 | debug_dir="" | ||
6 | while read row; do | ||
7 | echo "# $row" | ||
8 | # Output is colorized; remove escape characters | ||
9 | row_cleaned=`echo "$row" | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"` | ||
10 | # Transform "SETUP: PASS|FAIL" to "SETUP ($test_name): PASS|FAIL" | ||
11 | row_cleaned=`echo "$row_cleaned" | sed "s/^SETUP:/SETUP ($test_name):/"` | ||
12 | if echo "$row_cleaned" | grep -q '^[^:]*: \(PASS\|FAIL\|ERROR\)\( \[result=[^]]*\]\)\? ([0-9\.]\{1,\} s)$'; then | ||
13 | # The row is a test result | ||
14 | test_case=`echo "$row_cleaned" | grep -o '^\(SETUP\|([0-9]\{1,\}/[0-9]\{1,\})\)[^:]*' | sed 's|^([0-9]\{1,\}/[0-9]\{1,\}) ||'` | ||
15 | status=`echo "$row_cleaned" | grep -o ': \(PASS\|FAIL\|ERROR\)' | sed -e 's/^: //' -e 's/ERROR/FAIL/'` | ||
16 | echo -n "$status: $test_case" | ||
17 | # Are there any textual results to be appended? | ||
18 | keyval_file="$debug_dir/$test_case/keyval" | ||
19 | if [ -n "$debug_dir" -a -e "$keyval_file" ]; then | ||
20 | result=`grep '^result=' $keyval_file | sed 's/^result=//'` | ||
21 | if [ -n "$result" ]; then | ||
22 | echo -n " [result=$result]" | ||
23 | fi | ||
24 | fi | ||
25 | echo "" | ||
26 | elif echo "$row_cleaned" | grep -q '^DEBUG LOG: '; then | ||
27 | # The row specifies the path to the debug log: Extract the debug directory and save it | ||
28 | debug_dir=`echo "$row_cleaned" | sed -e 's,^DEBUG LOG: ,,' -e 's,/debug\.log$,,'` | ||
29 | fi | ||
30 | done | ||
31 | } | ||
32 | |||
33 | create_empty_image() { | ||
34 | IMAGE_NAME="$1" | ||
35 | COMPRESSION_TYPE="$2" | ||
36 | |||
37 | COMPRESSED_IMAGE_NAME="${IMAGE_NAME}.${COMPRESSION_TYPE}" | ||
38 | if [ -z "$COMPRESSION_TYPE" ]; then | ||
39 | COMPRESSED_IMAGE_NAME="${IMAGE_NAME}" | ||
40 | fi | ||
41 | SHA1_NAME="${COMPRESSED_IMAGE_NAME}.sha1" | ||
42 | |||
43 | pushd /opt/virt-test/shared/data/images/ &> /dev/null | ||
44 | |||
45 | rm -f "$IMAGE_NAME" "$SHA1_NAME" "$COMPRESSED_IMAGE_NAME" | ||
46 | rm -f "${IMAGE_NAME}.backup" | ||
47 | |||
48 | echo "# Creating empty image ${IMAGE_NAME}" | ||
49 | qemu-img create -f qcow2 ${IMAGE_NAME} 10M | ||
50 | case "$COMPRESSION_TYPE" in | ||
51 | bz2) | ||
52 | bzip2 -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" | ||
53 | ;; | ||
54 | gz) | ||
55 | gzip -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" | ||
56 | ;; | ||
57 | xz) | ||
58 | xz -c "$IMAGE_NAME" > "$COMPRESSED_IMAGE_NAME" | ||
59 | ;; | ||
60 | *) | ||
61 | echo "ERROR: Invalid compression type: $COMPRESSION_TYPE" | ||
62 | popd | ||
63 | exit 1 | ||
64 | ;; | ||
65 | esac | ||
66 | sha1sum "$COMPRESSED_IMAGE_NAME" > "$SHA1_NAME" | ||
67 | |||
68 | cp "$IMAGE_NAME" "${IMAGE_NAME}.backup" | ||
69 | |||
70 | echo "# Empty image $IMAGE_NAME created" | ||
71 | echo | ||
72 | |||
73 | popd &> /dev/null | ||
74 | } | ||
75 | |||
76 | get_image() { | ||
77 | URL_BASE="$1" | ||
78 | IMAGE_NAME="$2" | ||
79 | COMPRESSION_TYPE="$3" | ||
80 | |||
81 | COMPRESSED_IMAGE_NAME="${IMAGE_NAME}.${COMPRESSION_TYPE}" | ||
82 | if [ -z "$COMPRESSION_TYPE" ]; then | ||
83 | COMPRESSED_IMAGE_NAME="${IMAGE_NAME}" | ||
84 | fi | ||
85 | SHA1_NAME="${COMPRESSED_IMAGE_NAME}.sha1" | ||
86 | COMPRESSED_IMAGE_URL="${URL_BASE}/${COMPRESSED_IMAGE_NAME}" | ||
87 | SHA1_URL="${URL_BASE}/${SHA1_NAME}" | ||
88 | |||
89 | pushd /opt/virt-test/shared/data/images/ &> /dev/null | ||
90 | |||
91 | rm -f "$IMAGE_NAME" "$SHA1_NAME" "$COMPRESSED_IMAGE_NAME" | ||
92 | rm -f "${IMAGE_NAME}.backup" | ||
93 | |||
94 | echo "# Downloading $COMPRESSED_IMAGE_URL" | ||
95 | wget $COMPRESSED_IMAGE_URL | ||
96 | wget $SHA1_URL | ||
97 | |||
98 | if ! sha1sum -c "$SHA1_NAME" > /dev/null; then | ||
99 | echo "ERROR: Invalid sha1 sum!" | ||
100 | exit 1 | ||
101 | fi | ||
102 | |||
103 | echo "# Uncompressing $COMPRESSED_IMAGE_NAME -> $IMAGE_NAME" | ||
104 | case "$COMPRESSION_TYPE" in | ||
105 | bz2) | ||
106 | bunzip2 -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" | ||
107 | ;; | ||
108 | gz) | ||
109 | gunzip -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" | ||
110 | ;; | ||
111 | xz) | ||
112 | unxz -c "$COMPRESSED_IMAGE_NAME" > "$IMAGE_NAME" | ||
113 | ;; | ||
114 | "") | ||
115 | ;; | ||
116 | *) | ||
117 | echo "ERROR: Invalid compression type: $COMPRESSION_TYPE" | ||
118 | popd | ||
119 | exit 1 | ||
120 | ;; | ||
121 | esac | ||
122 | |||
123 | cp "$IMAGE_NAME" "${IMAGE_NAME}.backup" | ||
124 | |||
125 | echo "# Download of $IMAGE_NAME completed" | ||
126 | echo | ||
127 | |||
128 | popd &> /dev/null | ||
129 | } | ||
130 | |||
131 | # Verbose? | ||
132 | VERBOSE= | ||
133 | if [ "$1" = '-v' ]; then | ||
134 | VERBOSE=1 | ||
135 | set -x | ||
136 | fi | ||
137 | |||
138 | # Servers | ||
139 | NTP_SERVER=ntp.enea.se | ||
140 | |||
141 | # Architecture | ||
142 | ARCH=`uname -m` | ||
143 | |||
144 | # Needed by virt-test | ||
145 | export AUTOTEST_PATH="/opt/autotest/" | ||
146 | |||
147 | # Init LVM | ||
148 | DEST_DIR=/opt/virt-test/shared/data | ||
149 | if ! [ -e /dev/rootvg ]; then | ||
150 | vgchange -ay | ||
151 | udevadm settle # Wait for device nodes | ||
152 | fi | ||
153 | if [ -e /dev/rootvg ]; then | ||
154 | if ! [ -e /dev/rootvg/virttestdatalv ]; then | ||
155 | if ! lvcreate -L30G -n virttestdatalv /dev/rootvg; then | ||
156 | echo "ERROR: Unable to create virttestdatalv!" >&2 | ||
157 | exit 1 | ||
158 | fi | ||
159 | udevadm settle | ||
160 | if ! mkfs.ext4 /dev/rootvg/virttestdatalv; then | ||
161 | echo "ERROR: Unable to format virttestdatalv!" >&2 | ||
162 | exit 1 | ||
163 | fi | ||
164 | fi | ||
165 | |||
166 | # Mount the virttestdatalv | ||
167 | mkdir -p $DEST_DIR | ||
168 | if ! mountpoint -q $DEST_DIR; then | ||
169 | if ! mount /dev/rootvg/virttestdatalv $DEST_DIR; then | ||
170 | echo "ERROR: Unable to mount virttestdatalv!" >&2 | ||
171 | exit 1 | ||
172 | fi | ||
173 | fi | ||
174 | else | ||
175 | echo "WARNING: No rootvg volume group! Continuing anyway" >&2 | ||
176 | fi | ||
177 | ( | ||
178 | cd $DEST_DIR | ||
179 | mkdir -p gpg images isos steps_data | ||
180 | ) | ||
181 | |||
182 | # Sync the clock before starting tests, as some tests will do this, and thereby | ||
183 | # cause tests that run for a negative amount of time unless the time is synced | ||
184 | # from the very beginning | ||
185 | ntpdate $NTP_SERVER | ||
186 | |||
187 | # Download/create images, kernel, initrd | ||
188 | JEOS_VERSION="19-64" | ||
189 | ENEA_VERSION="4.0" | ||
190 | # virt-test will try to unpack the images for all architectures, even though | ||
191 | # they are not used, so always create the (empty) images. | ||
192 | create_empty_image "enea-${ENEA_VERSION}-x86_64.qcow2" "gz" | ||
193 | create_empty_image "enea-${ENEA_VERSION}-ppc.qcow2" "gz" | ||
194 | create_empty_image "enea-${ENEA_VERSION}-ppc64.qcow2" "gz" | ||
195 | if [ "$ARCH" = "x86_64" ]; then | ||
196 | #get_image "http://172.21.3.124/~jori/jeos/" "jeos-${JEOS_VERSION}.qcow2" "bz2" | ||
197 | get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.qcow2" "gz" | ||
198 | elif [ "$ARCH" = "ppc" -o "$ARCH" = "ppc64" ]; then | ||
199 | get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.uImage" "" | ||
200 | get_image "http://172.21.3.124/~jori/enea/" "enea-${ENEA_VERSION}-${ARCH}.cpio.gz" "" | ||
201 | else | ||
202 | echo "ERROR: Architecture '$ARCH' not supported" | ||
203 | exit 1 | ||
204 | fi | ||
205 | |||
206 | # Create virbr0 | ||
207 | if ! [ -e /sys/class/net/virbr0 ]; then | ||
208 | ip link add virbr0 type bridge | ||
209 | ip addr add dev virbr0 10.99.99.1/24 | ||
210 | ip link set virbr0 up | ||
211 | /etc/init.d/dnsmasq stop | ||
212 | sleep 5 | ||
213 | /etc/init.d/dnsmasq start | ||
214 | fi | ||
215 | |||
216 | # Run tests | ||
217 | cd /opt/virt-test/ | ||
218 | QEMU_BIN=`which qemu-system-$ARCH` | ||
219 | OPTS="--qemu-bin=$QEMU_BIN --qemu_sandbox=off --no-downloads" | ||
220 | if ! [ "$VERBOSE" = "" ]; then | ||
221 | OPTS="$OPTS -v" | ||
222 | fi | ||
223 | |||
224 | declare -a TEST_SUITE TEST_SUITE_EXTRAOPTS TEST_CASES | ||
225 | |||
226 | TEST_SUITE[0]="qemu" | ||
227 | TEST_SUITE_EXTRAOPTS[0]="" | ||
228 | TEST_CASES[0]="check_clock_offset.with_syscall,migrate.default.fd,pong" | ||
229 | |||
230 | TEST_SUITE[1]="libvirt" | ||
231 | TEST_SUITE_EXTRAOPTS[1]="" | ||
232 | if [ "$ARCH" = "x86_64" ]; then | ||
233 | TEST_SUITE_EXTRAOPTS[1]="--machine-type=q35" | ||
234 | fi | ||
235 | TEST_CASES[1]="virsh.volume" | ||
236 | |||
237 | for (( i=0; i<${#TEST_SUITE[@]}; i++ )); do | ||
238 | # Update machine.cfg | ||
239 | cp /opt/virt-test/shared/cfg/machines.cfg \ | ||
240 | /opt/virt-test/backends/${TEST_SUITE[$i]}/cfg/ | ||
241 | |||
242 | # Run tests | ||
243 | echo "# Running ${TEST_SUITE[$i]} tests ${TEST_CASES[$i]}" | ||
244 | ./run $OPTS ${TEST_SUITE_EXTRAOPTS[$i]} -g Enea -t "${TEST_SUITE[$i]}" \ | ||
245 | --tests="${TEST_CASES[$i]}" --arch=$ARCH 2>&1 \ | ||
246 | | filter_output "${TEST_SUITE[$i]}" | ||
247 | 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 @@ | |||
1 | FILESEXTRAPATHS_append := ":${THISDIR}/files" | ||
2 | |||
3 | VIRT_TEST_SRC_URI = "file://tests/virt-test" | ||
4 | SRC_URI_append_corei7-64-intel-common = "${VIRT_TEST_SRC_URI}" | ||
5 | SRC_URI_append_e500mc = "${VIRT_TEST_SRC_URI}" | ||
6 | SRC_URI_append_b4860qds-64b = "${VIRT_TEST_SRC_URI}" | ||
7 | |||
8 | VIRT_TEST_RDEPENDS = "lvm2 e2fsprogs virt-test virt-test-libvirt virt-test-qemu \ | ||
9 | ntpdate bzip2 coreutils" | ||
10 | RDEPENDS_${PN}_append_corei7-64-intel-common = "${VIRT_TEST_RDEPENDS}" | ||
11 | RDEPENDS_${PN}_append_e500mc = "${VIRT_TEST_RDEPENDS}" | ||
12 | 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 @@ | |||
1 | #!/bin/sh -e | ||
2 | |||
3 | mkdir -p /sys/fs/cgroup/cpuset | ||
4 | mkdir -p /sys/fs/cgroup/cpu,cpuacct | ||
5 | mkdir -p /sys/fs/cgroup/devices | ||
6 | mkdir -p /sys/fs/cgroup/freezer | ||
7 | mkdir -p /sys/fs/cgroup/memory | ||
8 | mount cpuset | ||
9 | mount cpuacct | ||
10 | mount devices | ||
11 | mount freezer | ||
12 | 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 @@ | |||
1 | lxc: Modify lxc-busybox to support Enea Linux | ||
2 | |||
3 | In Enea Linux, the busybox commands are split between busybox.nosuid (symlinked | ||
4 | as /bin/busybox) and busybox.suid. This patch enables the commands provided by | ||
5 | the latter and also replaces the busybox init with the SysV counterpart. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Petre Pircalabu <petre.pircalabu@enea.com> | ||
10 | |||
11 | --- a/templates/lxc-busybox.in | ||
12 | +++ b/templates/lxc-busybox.in | ||
13 | @@ -129,6 +129,7 @@ EOF | ||
14 | # and propose a shell on the tty, the last one is | ||
15 | # not needed | ||
16 | cat <<EOF >> $rootfs/etc/inittab | ||
17 | +id:5:initdefault: | ||
18 | ::sysinit:/etc/init.d/rcS | ||
19 | tty1::respawn:/bin/getty -L tty1 115200 vt100 | ||
20 | console::askfirst:/bin/sh | ||
21 | @@ -209,8 +210,28 @@ configure_busybox() | ||
22 | xargs -n1 ln -s busybox | ||
23 | popd > /dev/null | ||
24 | |||
25 | - # relink /sbin/init | ||
26 | - ln $rootfs/bin/busybox $rootfs/sbin/init | ||
27 | + which busybox.suid >/dev/null 2>&1 | ||
28 | + | ||
29 | + if [ $? -eq 0 ]; then | ||
30 | + # copy busybox.suid in the rootfs | ||
31 | + cp $(which busybox.suid) $rootfs/bin | ||
32 | + if [ $? -ne 0 ]; then | ||
33 | + echo "failed to copy busybox.suid in the rootfs" | ||
34 | + return 1 | ||
35 | + fi | ||
36 | + | ||
37 | + pushd $rootfs/bin > /dev/null || return 1 | ||
38 | + ./busybox.suid --help | grep 'Currently defined functions:' -A300 | \ | ||
39 | + grep -v 'Currently defined functions:' | tr , '\n' | \ | ||
40 | + xargs -n1 ln -s busybox.suid | ||
41 | + popd > /dev/null | ||
42 | + fi | ||
43 | + | ||
44 | + # use SysV init | ||
45 | + pushd $rootfs/sbin > /dev/null || return 1 | ||
46 | + cp /sbin/init.sysvinit . | ||
47 | + ln -s init.sysvinit init | ||
48 | + popd > /dev/null | ||
49 | |||
50 | # passwd exec must be setuid | ||
51 | 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 @@ | |||
1 | lxc: Update lxc-test-attach | ||
2 | |||
3 | For Enea Linux, the SysV init file is different from busybox, causing cmp to | ||
4 | return an error. In order to preserve the test's logic it was replaced with a | ||
5 | command which succeeds in every situation: | ||
6 | (e.g. search for root in /etc/passwd using grep). | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Petre Pircalabu <petre.pircalabu@enea.com> | ||
11 | |||
12 | --- a/src/tests/attach.c | ||
13 | +++ b/src/tests/attach.c | ||
14 | @@ -237,8 +237,8 @@ static int test_attach_cmd(struct lxc_co | ||
15 | { | ||
16 | int ret; | ||
17 | pid_t pid; | ||
18 | - char *argv[] = {"cmp", "-s", "/sbin/init", "/bin/busybox", NULL}; | ||
19 | - lxc_attach_command_t command = {"cmp", argv}; | ||
20 | + char *argv[] = {"grep", "-q", "root", "/etc/passwd", NULL}; | ||
21 | + lxc_attach_command_t command = {"grep", argv}; | ||
22 | lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; | ||
23 | |||
24 | 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 @@ | |||
1 | FILESEXTRAPATHS_append := ":${THISDIR}/files" | ||
2 | SRC_URI_append = " file://init-lxc-mount" | ||
3 | SRC_URI_append = " file://lxc-busybox-support-enea-linux-init.patch" | ||
4 | SRC_URI_append = " file://lxc-test-attach-replace-cmp-with-grep.patch" | ||
5 | |||
6 | inherit update-rc.d | ||
7 | |||
8 | INITSCRIPT_NAME = "init-lxc-mount" | ||
9 | |||
10 | do_install_append() { | ||
11 | install -d ${D}${sysconfdir}/init.d | ||
12 | install -m 0755 ${WORKDIR}/init-lxc-mount ${D}${sysconfdir}/init.d/init-lxc-mount | ||
13 | } | ||
14 | |||
15 | 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 @@ | |||
1 | do_install_append() { | ||
2 | # Add cgroups to /etc/fstab | ||
3 | echo "# For LXC" >> ${D}${sysconfdir}/fstab | ||
4 | echo "cgroup /sys/fs/cgroup tmpfs defaults 0 0" >> ${D}${sysconfdir}/fstab | ||
5 | echo "cpuset /sys/fs/cgroup/cpuset cgroup cpuset,noauto 0 0" >> ${D}${sysconfdir}/fstab | ||
6 | echo "cpuacct /sys/fs/cgroup/cpu,cpuacct cgroup cpuacct,cpu,noauto 0 0" >> ${D}${sysconfdir}/fstab | ||
7 | echo "devices /sys/fs/cgroup/devices cgroup devices,noauto 0 0" >> ${D}${sysconfdir}/fstab | ||
8 | echo "freezer /sys/fs/cgroup/freezer cgroup freezer,noauto 0 0" >> ${D}${sysconfdir}/fstab | ||
9 | echo "memory /sys/fs/cgroup/memory cgroup memory,noauto 0 0" >> ${D}${sysconfdir}/fstab | ||
10 | # Fix for multiple dnsmasq instances when using libvirt. | ||
11 | echo "interface=eth0" >> ${D}${sysconfdir}/dnsmasq.conf | ||
12 | echo "bind-interfaces" >> ${D}${sysconfdir}/dnsmasq.conf | ||
13 | } | ||
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 @@ | |||
1 | DESCRIPTION = "Package group for virtualization" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ | ||
4 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
5 | PR = "r0" | ||
6 | |||
7 | inherit packagegroup | ||
8 | |||
9 | def if_arch_re(regexp, trueval, falseval, d): | ||
10 | import re | ||
11 | target_arch = bb.data.getVar('TUNE_ARCH', d, 1) | ||
12 | return trueval if re.match(regexp, target_arch) else falseval | ||
13 | |||
14 | RDEPENDS_${PN} = " \ | ||
15 | qemu \ | ||
16 | libvirt \ | ||
17 | libvirt-libvirtd \ | ||
18 | libvirt-virsh \ | ||
19 | ${@if_arch_re("^(i[3-9]86|x86_64)", "kernel-module-kvm", "", d)} \ | ||
20 | ${@if_arch_re("^(i[3-9]86|x86_64)", "kernel-module-kvm-intel", "", d)} \ | ||
21 | lxc \ | ||
22 | " | ||
23 | |||
24 | RDEPENDS_${PN}_remove_p2020rdb = " \ | ||
25 | qemu \ | ||
26 | " | ||
27 | |||
28 | RDEPENDS_${PN}_remove_b4860qds-64b = " \ | ||
29 | qemu \ | ||
30 | " | ||
31 | |||
32 | RDEPENDS_${PN}_remove_zc702-zynq7 = " \ | ||
33 | qemu \ | ||
34 | " | ||
35 | |||
36 | RRECOMMENDS_${PN} = " \ | ||
37 | ${@if_arch_re("^(i[3-9]86|x86_64)", "kernel-module-igb", "", d)} \ | ||
38 | kernel-module-xt-conntrack \ | ||
39 | " | ||
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 @@ | |||
1 | fix libcap header issue on some distro | ||
2 | |||
3 | 1, When build qemu-native on SLED 11.2, there is an error: | ||
4 | ... | ||
5 | | In file included from /usr/include/bits/sigcontext.h:28, | ||
6 | | from /usr/include/signal.h:339, | ||
7 | | from /buildarea2/tmp/work/i686-linux/qemu-native/1.4.0-r0/ | ||
8 | qemu-1.4.0/include/qemu-common.h:42, | ||
9 | | from fsdev/virtfs-proxy-helper.c:23: | ||
10 | | /usr/include/asm/sigcontext.h:28: error: expected specifier- | ||
11 | qualifier-list before '__u64' | ||
12 | | /usr/include/asm/sigcontext.h:191: error: expected specifier- | ||
13 | qualifier-list before '__u64' | ||
14 | ... | ||
15 | |||
16 | 2, The virtfs-proxy-helper.c includes <sys/capability.h> and | ||
17 | qemu-common.h in sequence. The header include map is: | ||
18 | (`-->' presents `include') | ||
19 | ... | ||
20 | "virtfs-proxy-helper.c" --> <sys/capability.h> | ||
21 | ... | ||
22 | "virtfs-proxy-helper.c" --> "qemu-common.h" --> <signal.h> --> | ||
23 | <bits/sigcontext.h> --> <asm/sigcontext.h> --> <linux/types.h> --> | ||
24 | <asm/types.h> --> <asm-generic/types.h> --> <asm-generic/int-ll64.h> | ||
25 | ... | ||
26 | |||
27 | 3, The bug is found on SLED 11.2 x86. In libcap header file | ||
28 | /usr/include/sys/capability.h, it does evil stuff like this: | ||
29 | ... | ||
30 | 25 /* | ||
31 | 26 * Make sure we can be included from userland by preventing | ||
32 | 27 * capability.h from including other kernel headers | ||
33 | 28 */ | ||
34 | 29 #define _LINUX_TYPES_H | ||
35 | 30 #define _LINUX_FS_H | ||
36 | 31 #define __LINUX_COMPILER_H | ||
37 | 32 #define __user | ||
38 | 33 | ||
39 | 34 typedef unsigned int __u32; | ||
40 | 35 typedef __u32 __le32; | ||
41 | ... | ||
42 | This completely prevents including /usr/include/linux/types.h. | ||
43 | The above `<asm/sigcontext.h> --> <linux/types.h>' is prevented, | ||
44 | and '__u64' is defined in <asm-generic/int-ll64.h>. | ||
45 | |||
46 | 4, Modify virtfs-proxy-helper.c to include <sys/capability.h> | ||
47 | last to workaround the issue. | ||
48 | |||
49 | http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html | ||
50 | http://patchwork.linuxtv.org/patch/12748/ | ||
51 | |||
52 | Upstream-Status: Pending | ||
53 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
54 | --- | ||
55 | fsdev/virtfs-proxy-helper.c | 7 +++++-- | ||
56 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
57 | |||
58 | diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c | ||
59 | --- a/fsdev/virtfs-proxy-helper.c | ||
60 | +++ b/fsdev/virtfs-proxy-helper.c | ||
61 | @@ -12,7 +12,6 @@ | ||
62 | #include <sys/resource.h> | ||
63 | #include <getopt.h> | ||
64 | #include <syslog.h> | ||
65 | -#include <sys/capability.h> | ||
66 | #include <sys/fsuid.h> | ||
67 | #include <sys/vfs.h> | ||
68 | #include <sys/ioctl.h> | ||
69 | @@ -26,7 +25,11 @@ | ||
70 | #include "virtio-9p-marshal.h" | ||
71 | #include "hw/9pfs/virtio-9p-proxy.h" | ||
72 | #include "fsdev/virtio-9p-marshal.h" | ||
73 | - | ||
74 | +/* | ||
75 | + * Include this one last due to some versions of it being buggy: | ||
76 | + * http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html | ||
77 | + */ | ||
78 | +#include <sys/capability.h> | ||
79 | #define PROGNAME "virtfs-proxy-helper" | ||
80 | |||
81 | #ifndef XFS_SUPER_MAGIC | ||
82 | -- | ||
83 | 1.7.10.4 | ||
84 | |||
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 @@ | |||
1 | require recipes-devtools/qemu/qemu.inc | ||
2 | |||
3 | PROVIDES = "qemu" | ||
4 | |||
5 | # This is v2.3.0 | ||
6 | #SRCREV = "e5b3a24181ea0cebf1c5b20f44d016311b7048f0" | ||
7 | |||
8 | LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ | ||
9 | file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913" | ||
10 | |||
11 | # Discard all files included in qemu.inc, we're not interested in them here | ||
12 | # This is why it is an "=" and not _prepend or "+=" as in other recipes: | ||
13 | SRC_URI = "git://git.qemu.org/qemu.git;tag=v2.3.0" | ||
14 | S = "${WORKDIR}/git" | ||
15 | |||
16 | DEFAULT_PREFERENCE = "-1" | ||
17 | |||
18 | COMPATIBLE_HOST_class-target_mips64 = "null" | ||
19 | |||
20 | # build arm emulators only | ||
21 | QEMU_TARGETS = "arm aarch64" | ||
22 | |||
23 | # Override --disable-glx, which now is --disable-opengl | ||
24 | PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa" | ||
25 | PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,mesa" | ||
26 | |||
27 | FILES_${PN} += " \ | ||
28 | /run \ | ||
29 | /usr/share/qemu \ | ||
30 | " | ||
31 | |||
32 | # Our own do_install function so it doesn't try to install powerpc_rom.bin: | ||
33 | do_install () { | ||
34 | export STRIP="true" | ||
35 | autotools_do_install | ||
36 | install -d ${D}${datadir}/qemu | ||
37 | } | ||
38 | |||
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 @@ | |||
1 | Copyright (c) 2014 by Enea Software AB | ||
2 | All rights reserved. | ||
3 | |||
4 | Redistribution and use in source and binary forms, with or without | ||
5 | modification, are permitted provided that the following conditions are met: | ||
6 | * Redistributions of source code must retain the above copyright | ||
7 | notice, this list of conditions and the following disclaimer. | ||
8 | * Redistributions in binary form must reproduce the above copyright | ||
9 | notice, this list of conditions and the following disclaimer in the | ||
10 | documentation and/or other materials provided with the distribution. | ||
11 | * Neither the name of Enea Software AB nor the | ||
12 | names of its contributors may be used to endorse or promote products | ||
13 | derived from this software without specific prior written permission. | ||
14 | |||
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
24 | 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 @@ | |||
1 | #Copyright (c) 2014 by Enea Software AB | ||
2 | #All rights reserved. | ||
3 | # | ||
4 | #Redistribution and use in source and binary forms, with or without | ||
5 | #modification, are permitted provided that the following conditions are met: | ||
6 | # * Redistributions of source code must retain the above copyright | ||
7 | # notice, this list of conditions and the following disclaimer. | ||
8 | # * Redistributions in binary form must reproduce the above copyright | ||
9 | # notice, this list of conditions and the following disclaimer in the | ||
10 | # documentation and/or other materials provided with the distribution. | ||
11 | # * Neither the name of Enea Software AB nor the | ||
12 | # names of its contributors may be used to endorse or promote products | ||
13 | # derived from this software without specific prior written permission. | ||
14 | # | ||
15 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
16 | #ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
17 | #WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
18 | #DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
19 | #ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
20 | #(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
21 | #LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
22 | #ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
23 | #(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
24 | #SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
25 | |||
26 | lxc.tty = 2 | ||
27 | lxc.pts = 2 | ||
28 | lxc.rootfs = /container-images/example-container-rootfs/ | ||
29 | lxc.autodev = 1 | ||
30 | lxc.cgroup.cpuset.cpus = 3 | ||
31 | |||
32 | lxc.cgroup.devices.deny = a | ||
33 | # /dev/null and zero | ||
34 | lxc.cgroup.devices.allow = c 1:3 rwm | ||
35 | lxc.cgroup.devices.allow = c 1:5 rwm | ||
36 | # /dev/{,u}random | ||
37 | lxc.cgroup.devices.allow = c 1:9 rwm | ||
38 | lxc.cgroup.devices.allow = c 1:8 rwm | ||
39 | # pts consoles | ||
40 | lxc.cgroup.devices.allow = c 136:* rwm | ||
41 | lxc.cgroup.devices.allow = c 5:2 rwm | ||
42 | # rtc | ||
43 | lxc.cgroup.devices.allow = c 254:0 rwm | ||
44 | |||
45 | lxc.utsname = example-container | ||
46 | |||
47 | lxc.network.type = veth | ||
48 | lxc.network.link = example-bridge | ||
49 | lxc.network.veth.pair = example-veth | ||
50 | 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 @@ | |||
1 | <!-- | ||
2 | Copyright (c) 2014 by Enea Software AB | ||
3 | All rights reserved. | ||
4 | |||
5 | Redistribution and use in source and binary forms, with or without | ||
6 | modification, are permitted provided that the following conditions are met: | ||
7 | * Redistributions of source code must retain the above copyright | ||
8 | notice, this list of conditions and the following disclaimer. | ||
9 | * Redistributions in binary form must reproduce the above copyright | ||
10 | notice, this list of conditions and the following disclaimer in the | ||
11 | documentation and/or other materials provided with the distribution. | ||
12 | * Neither the name of Enea Software AB nor the | ||
13 | names of its contributors may be used to endorse or promote products | ||
14 | derived from this software without specific prior written permission. | ||
15 | |||
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | --> | ||
27 | |||
28 | <domain type='kvm'> | ||
29 | <name>kvm-example-guest</name> | ||
30 | <memory unit='MiB'>500</memory> | ||
31 | <vcpu>2</vcpu> | ||
32 | <os> | ||
33 | <type arch='aarch64' machine="virt">hvm</type> | ||
34 | <kernel>/usr/share/virt-example/Image.bin</kernel> | ||
35 | <initrd>/usr/share/virt-example/rootfs.cpio.gz</initrd> | ||
36 | <cmdline>"earlyprintk=pl011,0x9000000 console=ttyAMA0 rootwait root=/dev/ram rw"</cmdline> | ||
37 | </os> | ||
38 | <on_poweroff>destroy</on_poweroff> | ||
39 | <on_reboot>restart</on_reboot> | ||
40 | <on_crash>destroy</on_crash> | ||
41 | <features> | ||
42 | <acpi /> | ||
43 | </features> | ||
44 | <cpu mode='host-passthrough'/> | ||
45 | <vcpu placement='static'>2</vcpu> | ||
46 | <cputune> | ||
47 | <vcpupin vcpu='0' cpuset='2'/> | ||
48 | <vcpupin vcpu='1' cpuset='3'/> | ||
49 | <emulatorpin cpuset="2"/> | ||
50 | </cputune> | ||
51 | <clock offset='utc'/> | ||
52 | <devices> | ||
53 | <emulator>/usr/bin/qemu-system-aarch64</emulator> | ||
54 | <serial type='pty'> | ||
55 | <target port='0'/> | ||
56 | </serial> | ||
57 | <console type='pty' > | ||
58 | <target type='serial' port='0'/> | ||
59 | </console> | ||
60 | <memballoon model='virtio'> | ||
61 | </memballoon> | ||
62 | </devices> | ||
63 | </domain> | ||
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 @@ | |||
1 | <!-- | ||
2 | Copyright (c) 2014 by Enea Software AB | ||
3 | All rights reserved. | ||
4 | |||
5 | Redistribution and use in source and binary forms, with or without | ||
6 | modification, are permitted provided that the following conditions are met: | ||
7 | * Redistributions of source code must retain the above copyright | ||
8 | notice, this list of conditions and the following disclaimer. | ||
9 | * Redistributions in binary form must reproduce the above copyright | ||
10 | notice, this list of conditions and the following disclaimer in the | ||
11 | documentation and/or other materials provided with the distribution. | ||
12 | * Neither the name of Enea Software AB nor the | ||
13 | names of its contributors may be used to endorse or promote products | ||
14 | derived from this software without specific prior written permission. | ||
15 | |||
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | --> | ||
27 | |||
28 | <domain type='kvm'> | ||
29 | <name>kvm-example-guest</name> | ||
30 | <memory unit='MiB'>500</memory> | ||
31 | <vcpu>1</vcpu> | ||
32 | <os> | ||
33 | <type arch='ppc' machine="ppce500">hvm</type> | ||
34 | <kernel>/usr/share/virt-example/ppc-uImage.bin</kernel> | ||
35 | <ramdisk>/usr/share/virt-example/ppc-ramdisk.cpio.gz</ramdisk> | ||
36 | <cmdline>console=ttyS0</cmdline> | ||
37 | </os> | ||
38 | <on_poweroff>destroy</on_poweroff> | ||
39 | <on_reboot>restart</on_reboot> | ||
40 | <on_crash>destroy</on_crash> | ||
41 | <features> | ||
42 | <acpi /> | ||
43 | </features> | ||
44 | <clock offset='utc'/> | ||
45 | <devices> | ||
46 | <emulator>/usr/bin/qemu-system-ppc</emulator> | ||
47 | <serial type='pty'> | ||
48 | <target port='0'/> | ||
49 | </serial> | ||
50 | <console type='pty' > | ||
51 | <target type='serial' port='0'/> | ||
52 | </console> | ||
53 | <memballoon model='virtio' /> | ||
54 | </devices> | ||
55 | </domain> | ||
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 @@ | |||
1 | <!-- | ||
2 | Copyright (c) 2014 by Enea Software AB | ||
3 | All rights reserved. | ||
4 | |||
5 | Redistribution and use in source and binary forms, with or without | ||
6 | modification, are permitted provided that the following conditions are met: | ||
7 | * Redistributions of source code must retain the above copyright | ||
8 | notice, this list of conditions and the following disclaimer. | ||
9 | * Redistributions in binary form must reproduce the above copyright | ||
10 | notice, this list of conditions and the following disclaimer in the | ||
11 | documentation and/or other materials provided with the distribution. | ||
12 | * Neither the name of Enea Software AB nor the | ||
13 | names of its contributors may be used to endorse or promote products | ||
14 | derived from this software without specific prior written permission. | ||
15 | |||
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | --> | ||
27 | |||
28 | <domain type='kvm'> | ||
29 | <name>kvm-example-guest</name> | ||
30 | <memory unit='KiB'>2000000</memory> | ||
31 | <vcpu>2</vcpu> | ||
32 | <os> | ||
33 | <type arch='x86_64'>hvm</type> | ||
34 | </os> | ||
35 | <clock offset='utc'/> | ||
36 | <on_poweroff>destroy</on_poweroff> | ||
37 | <on_reboot>restart</on_reboot> | ||
38 | <on_crash>destroy</on_crash> | ||
39 | <devices> | ||
40 | <emulator>/usr/bin/qemu-system-x86_64</emulator> | ||
41 | <!-- Bootable cd-rom drive that will only be used | ||
42 | if pxe boot is unavailable. --> | ||
43 | <disk type='file' device='cdrom'> | ||
44 | <source file='/usr/share/virt-example/enea-image-kvm-example-guest.iso'/> | ||
45 | <target dev='hdb' bus='ide'/> | ||
46 | <boot order="2"/> | ||
47 | </disk> | ||
48 | <!-- Shared folder that is accessible from both guest and host --> | ||
49 | <filesystem type='mount' accessmode='passthrough'> | ||
50 | <source dir='/mnt/guest-example'/> | ||
51 | <target dir='guest-example-shared-folder'/> | ||
52 | </filesystem> | ||
53 | <!-- Network that we use to pxe boot, MAC address is assigned | ||
54 | a specific ip in the example network definition --> | ||
55 | <interface type='network'> | ||
56 | <mac address='98:99:99:99:99:90'/> | ||
57 | <model type='virtio'/> | ||
58 | <source network='virt-example-net'/> | ||
59 | <boot order="1"/> | ||
60 | </interface> | ||
61 | <serial type='pty'> | ||
62 | <target port='0'/> | ||
63 | </serial> | ||
64 | <console type='pty' > | ||
65 | <target type='serial' port='0'/> | ||
66 | </console> | ||
67 | <memballoon model='virtio'> | ||
68 | </memballoon> | ||
69 | </devices> | ||
70 | </domain> | ||
71 | |||
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 @@ | |||
1 | <!-- | ||
2 | Copyright (c) 2014 by Enea Software AB | ||
3 | All rights reserved. | ||
4 | |||
5 | Redistribution and use in source and binary forms, with or without | ||
6 | modification, are permitted provided that the following conditions are met: | ||
7 | * Redistributions of source code must retain the above copyright | ||
8 | notice, this list of conditions and the following disclaimer. | ||
9 | * Redistributions in binary form must reproduce the above copyright | ||
10 | notice, this list of conditions and the following disclaimer in the | ||
11 | documentation and/or other materials provided with the distribution. | ||
12 | * Neither the name of Enea Software AB nor the | ||
13 | names of its contributors may be used to endorse or promote products | ||
14 | derived from this software without specific prior written permission. | ||
15 | |||
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | --> | ||
27 | |||
28 | <network> | ||
29 | <name>virt-example-net</name> | ||
30 | <ip address='192.168.123.1' netmask='255.255.255.0'> | ||
31 | <tftp root='/usr/share/virt-example/pxe'/> | ||
32 | <dhcp> | ||
33 | <host mac="98:99:99:99:99:90" ip="192.168.123.2"/> | ||
34 | <range start='192.168.123.3' end='192.168.123.254'/> | ||
35 | <bootp file='pxelinux.0'/> | ||
36 | </dhcp> | ||
37 | </ip> | ||
38 | </network> | ||
39 | |||
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 @@ | |||
1 | SERIAL 0 115200 0xab3 | ||
2 | |||
3 | DEFAULT kvm-example | ||
4 | |||
5 | LABEL kvm-example | ||
6 | kernel bzImage | ||
7 | append console=ttyS0,115200n8 initrd=enea-image-kvm-example-guest.cpio.gz | ||
8 | |||
9 | PROMPT 1 | ||
10 | 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 @@ | |||
1 | DESCRIPTION = "KVM and libvirt examples" | ||
2 | |||
3 | FILESEXTRAPATHS_append := ":${THISDIR}/files" | ||
4 | |||
5 | DEPENDS_append_x86-64 += "syslinux" | ||
6 | |||
7 | SRC_URI = " \ | ||
8 | file://example-container.conf \ | ||
9 | file://example-guest-aarch64.xml \ | ||
10 | file://example-guest-x86.xml \ | ||
11 | file://example-guest-ppc.xml \ | ||
12 | file://example-net.xml \ | ||
13 | file://LICENSE \ | ||
14 | file://pxe/pxelinux.cfg/default \ | ||
15 | " | ||
16 | |||
17 | LICENSE = "BSD" | ||
18 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=b52bab7a403562f36be803f11489f1a4" | ||
19 | |||
20 | S = "${WORKDIR}" | ||
21 | |||
22 | DESTDIR = "/usr/share/${PN}/" | ||
23 | |||
24 | FILES_${PN} = " \ | ||
25 | ${DESTDIR}example-container.conf \ | ||
26 | ${DESTDIR}example-guest-aarch64.xml \ | ||
27 | ${DESTDIR}example-guest-x86.xml \ | ||
28 | ${DESTDIR}example-guest-ppc.xml \ | ||
29 | ${DESTDIR}example-net.xml \ | ||
30 | ${DESTDIR}pxe/pxelinux.cfg/default \ | ||
31 | " | ||
32 | |||
33 | do_install() { | ||
34 | install -d ${D}${DESTDIR} | ||
35 | install -d ${D}${DESTDIR}pxe/pxelinux.cfg/ | ||
36 | install ${WORKDIR}/pxe/pxelinux.cfg/default ${D}${DESTDIR}pxe/pxelinux.cfg/ | ||
37 | install ${WORKDIR}/example-container.conf ${D}${DESTDIR} | ||
38 | install ${WORKDIR}/example-guest-aarch64.xml ${D}${DESTDIR} | ||
39 | install ${WORKDIR}/example-guest-x86.xml ${D}${DESTDIR} | ||
40 | install ${WORKDIR}/example-guest-ppc.xml ${D}${DESTDIR} | ||
41 | install ${WORKDIR}/example-net.xml ${D}${DESTDIR} | ||
42 | } | ||
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 @@ | |||
1 | It seems that pycurl has been renamed to curl. | ||
2 | |||
3 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
4 | Upstream-Status: Pending | ||
5 | diff -uNrp urlgrabber-3.10.1.orig/urlgrabber/grabber.py urlgrabber-3.10.1/urlgrabber/grabber.py | ||
6 | --- urlgrabber-3.10.1.orig/urlgrabber/grabber.py 2014-03-04 17:08:52.345678844 +0100 | ||
7 | +++ urlgrabber-3.10.1/urlgrabber/grabber.py 2014-03-04 17:09:49.074595399 +0100 | ||
8 | @@ -88,7 +88,7 @@ GENERAL ARGUMENTS (kwargs) | ||
9 | a positive integer expressing the number of seconds to wait before | ||
10 | timing out attempts to connect to a server. If the value is None | ||
11 | or 0, connection attempts will not time out. The timeout is passed | ||
12 | - to the underlying pycurl object as its CONNECTTIMEOUT option, see | ||
13 | + to the underlying curl object as its CONNECTTIMEOUT option, see | ||
14 | the curl documentation on CURLOPT_CONNECTTIMEOUT for more information. | ||
15 | http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTCONNECTTIMEOUT | ||
16 | |||
17 | @@ -509,7 +509,7 @@ import mimetools | ||
18 | import thread | ||
19 | import types | ||
20 | import stat | ||
21 | -import pycurl | ||
22 | +import curl | ||
23 | from ftplib import parse150 | ||
24 | from StringIO import StringIO | ||
25 | from httplib import HTTPException | ||
26 | @@ -821,7 +821,7 @@ class URLParser: | ||
27 | |||
28 | def process_http(self, parts, url): | ||
29 | (scheme, host, path, parm, query, frag) = parts | ||
30 | - # TODO: auth-parsing here, maybe? pycurl doesn't really need it | ||
31 | + # TODO: auth-parsing here, maybe? curl doesn't really need it | ||
32 | return (scheme, host, path, parm, query, frag) | ||
33 | |||
34 | def quote(self, parts): | ||
35 | @@ -983,7 +983,7 @@ class URLGrabberOptions: | ||
36 | self.username = None | ||
37 | self.password = None | ||
38 | self.ssl_ca_cert = None # sets SSL_CAINFO - path to certdb | ||
39 | - self.ssl_context = None # no-op in pycurl | ||
40 | + self.ssl_context = None # no-op in curl | ||
41 | self.ssl_verify_peer = True # check peer's cert for authenticityb | ||
42 | self.ssl_verify_host = True # make sure who they are and who the cert is for matches | ||
43 | self.ssl_key = None # client key | ||
44 | @@ -1355,7 +1355,7 @@ class PyCurlFileObject(object): | ||
45 | |||
46 | return len(buf) | ||
47 | except KeyboardInterrupt: | ||
48 | - return pycurl.READFUNC_ABORT | ||
49 | + return curl.READFUNC_ABORT | ||
50 | |||
51 | def _return_hdr_obj(self): | ||
52 | if self._parsed_hdr: | ||
53 | @@ -1370,7 +1370,7 @@ class PyCurlFileObject(object): | ||
54 | |||
55 | hdr = property(_return_hdr_obj) | ||
56 | http_code = property(fget= | ||
57 | - lambda self: self.curl_obj.getinfo(pycurl.RESPONSE_CODE)) | ||
58 | + lambda self: self.curl_obj.getinfo(curl.RESPONSE_CODE)) | ||
59 | |||
60 | def _set_opts(self, opts={}): | ||
61 | # XXX | ||
62 | @@ -1379,109 +1379,109 @@ class PyCurlFileObject(object): | ||
63 | |||
64 | # keepalives | ||
65 | if not opts.keepalive: | ||
66 | - self.curl_obj.setopt(pycurl.FORBID_REUSE, 1) | ||
67 | + self.curl_obj.setopt(curl.FORBID_REUSE, 1) | ||
68 | |||
69 | # defaults we're always going to set | ||
70 | - self.curl_obj.setopt(pycurl.NOPROGRESS, False) | ||
71 | - self.curl_obj.setopt(pycurl.NOSIGNAL, True) | ||
72 | - self.curl_obj.setopt(pycurl.WRITEFUNCTION, self._retrieve) | ||
73 | - self.curl_obj.setopt(pycurl.HEADERFUNCTION, self._hdr_retrieve) | ||
74 | - self.curl_obj.setopt(pycurl.PROGRESSFUNCTION, self._progress_update) | ||
75 | - self.curl_obj.setopt(pycurl.FAILONERROR, True) | ||
76 | - self.curl_obj.setopt(pycurl.OPT_FILETIME, True) | ||
77 | - self.curl_obj.setopt(pycurl.FOLLOWLOCATION, True) | ||
78 | + self.curl_obj.setopt(curl.NOPROGRESS, False) | ||
79 | + self.curl_obj.setopt(curl.NOSIGNAL, True) | ||
80 | + self.curl_obj.setopt(curl.WRITEFUNCTION, self._retrieve) | ||
81 | + self.curl_obj.setopt(curl.HEADERFUNCTION, self._hdr_retrieve) | ||
82 | + self.curl_obj.setopt(curl.PROGRESSFUNCTION, self._progress_update) | ||
83 | + self.curl_obj.setopt(curl.FAILONERROR, True) | ||
84 | + self.curl_obj.setopt(curl.OPT_FILETIME, True) | ||
85 | + self.curl_obj.setopt(curl.FOLLOWLOCATION, True) | ||
86 | |||
87 | if DEBUG and DEBUG.level <= 10: | ||
88 | - self.curl_obj.setopt(pycurl.VERBOSE, True) | ||
89 | + self.curl_obj.setopt(curl.VERBOSE, True) | ||
90 | if opts.user_agent: | ||
91 | - self.curl_obj.setopt(pycurl.USERAGENT, opts.user_agent) | ||
92 | + self.curl_obj.setopt(curl.USERAGENT, opts.user_agent) | ||
93 | if opts.ip_resolve: | ||
94 | # Default is: IPRESOLVE_WHATEVER | ||
95 | ipr = opts.ip_resolve.lower() | ||
96 | if ipr == 'whatever': # Do we need this? | ||
97 | - self.curl_obj.setopt(pycurl.IPRESOLVE,pycurl.IPRESOLVE_WHATEVER) | ||
98 | + self.curl_obj.setopt(curl.IPRESOLVE,curl.IPRESOLVE_WHATEVER) | ||
99 | if ipr == 'ipv4': | ||
100 | - self.curl_obj.setopt(pycurl.IPRESOLVE, pycurl.IPRESOLVE_V4) | ||
101 | + self.curl_obj.setopt(curl.IPRESOLVE, curl.IPRESOLVE_V4) | ||
102 | if ipr == 'ipv6': | ||
103 | - self.curl_obj.setopt(pycurl.IPRESOLVE, pycurl.IPRESOLVE_V6) | ||
104 | + self.curl_obj.setopt(curl.IPRESOLVE, curl.IPRESOLVE_V6) | ||
105 | |||
106 | # maybe to be options later | ||
107 | - self.curl_obj.setopt(pycurl.FOLLOWLOCATION, True) | ||
108 | - self.curl_obj.setopt(pycurl.MAXREDIRS, 5) | ||
109 | + self.curl_obj.setopt(curl.FOLLOWLOCATION, True) | ||
110 | + self.curl_obj.setopt(curl.MAXREDIRS, 5) | ||
111 | |||
112 | # timeouts | ||
113 | timeout = 300 | ||
114 | if hasattr(opts, 'timeout'): | ||
115 | timeout = int(opts.timeout or 0) | ||
116 | - self.curl_obj.setopt(pycurl.CONNECTTIMEOUT, timeout) | ||
117 | - self.curl_obj.setopt(pycurl.LOW_SPEED_LIMIT, opts.minrate or 1000) | ||
118 | - self.curl_obj.setopt(pycurl.LOW_SPEED_TIME, timeout) | ||
119 | + self.curl_obj.setopt(curl.CONNECTTIMEOUT, timeout) | ||
120 | + self.curl_obj.setopt(curl.LOW_SPEED_LIMIT, opts.minrate or 1000) | ||
121 | + self.curl_obj.setopt(curl.LOW_SPEED_TIME, timeout) | ||
122 | |||
123 | # ssl options | ||
124 | if self.scheme == 'https': | ||
125 | if opts.ssl_ca_cert: # this may do ZERO with nss according to curl docs | ||
126 | - self.curl_obj.setopt(pycurl.CAPATH, opts.ssl_ca_cert) | ||
127 | - self.curl_obj.setopt(pycurl.CAINFO, opts.ssl_ca_cert) | ||
128 | - self.curl_obj.setopt(pycurl.SSL_VERIFYPEER, opts.ssl_verify_peer) | ||
129 | + self.curl_obj.setopt(curl.CAPATH, opts.ssl_ca_cert) | ||
130 | + self.curl_obj.setopt(curl.CAINFO, opts.ssl_ca_cert) | ||
131 | + self.curl_obj.setopt(curl.SSL_VERIFYPEER, opts.ssl_verify_peer) | ||
132 | if opts.ssl_verify_host: # 1 is meaningless to curl | ||
133 | - self.curl_obj.setopt(pycurl.SSL_VERIFYHOST, 2) | ||
134 | + self.curl_obj.setopt(curl.SSL_VERIFYHOST, 2) | ||
135 | if opts.ssl_key: | ||
136 | - self.curl_obj.setopt(pycurl.SSLKEY, opts.ssl_key) | ||
137 | + self.curl_obj.setopt(curl.SSLKEY, opts.ssl_key) | ||
138 | if opts.ssl_key_type: | ||
139 | - self.curl_obj.setopt(pycurl.SSLKEYTYPE, opts.ssl_key_type) | ||
140 | + self.curl_obj.setopt(curl.SSLKEYTYPE, opts.ssl_key_type) | ||
141 | if opts.ssl_cert: | ||
142 | - self.curl_obj.setopt(pycurl.SSLCERT, opts.ssl_cert) | ||
143 | + self.curl_obj.setopt(curl.SSLCERT, opts.ssl_cert) | ||
144 | # if we have a client side cert - turn off reuse b/c nss is odd | ||
145 | - self.curl_obj.setopt(pycurl.FORBID_REUSE, 1) | ||
146 | + self.curl_obj.setopt(curl.FORBID_REUSE, 1) | ||
147 | if opts.ssl_cert_type: | ||
148 | - self.curl_obj.setopt(pycurl.SSLCERTTYPE, opts.ssl_cert_type) | ||
149 | + self.curl_obj.setopt(curl.SSLCERTTYPE, opts.ssl_cert_type) | ||
150 | if opts.ssl_key_pass: | ||
151 | - self.curl_obj.setopt(pycurl.SSLKEYPASSWD, opts.ssl_key_pass) | ||
152 | + self.curl_obj.setopt(curl.SSLKEYPASSWD, opts.ssl_key_pass) | ||
153 | |||
154 | #headers: | ||
155 | if opts.http_headers and self.scheme in ('http', 'https'): | ||
156 | headers = [] | ||
157 | for (tag, content) in opts.http_headers: | ||
158 | headers.append('%s:%s' % (tag, content)) | ||
159 | - self.curl_obj.setopt(pycurl.HTTPHEADER, headers) | ||
160 | + self.curl_obj.setopt(curl.HTTPHEADER, headers) | ||
161 | |||
162 | # ranges: | ||
163 | if opts.range or opts.reget: | ||
164 | range_str = self._build_range() | ||
165 | if range_str: | ||
166 | - self.curl_obj.setopt(pycurl.RANGE, range_str) | ||
167 | + self.curl_obj.setopt(curl.RANGE, range_str) | ||
168 | |||
169 | # throttle/bandwidth | ||
170 | if hasattr(opts, 'raw_throttle') and opts.raw_throttle(): | ||
171 | - self.curl_obj.setopt(pycurl.MAX_RECV_SPEED_LARGE, int(opts.raw_throttle())) | ||
172 | + self.curl_obj.setopt(curl.MAX_RECV_SPEED_LARGE, int(opts.raw_throttle())) | ||
173 | |||
174 | # proxy | ||
175 | if opts.proxy is not None: | ||
176 | - self.curl_obj.setopt(pycurl.PROXY, opts.proxy) | ||
177 | - self.curl_obj.setopt(pycurl.PROXYAUTH, | ||
178 | + self.curl_obj.setopt(curl.PROXY, opts.proxy) | ||
179 | + self.curl_obj.setopt(curl.PROXYAUTH, | ||
180 | # All but Kerberos. BZ 769254 | ||
181 | - pycurl.HTTPAUTH_ANY - pycurl.HTTPAUTH_GSSNEGOTIATE) | ||
182 | + curl.HTTPAUTH_ANY - curl.HTTPAUTH_GSSNEGOTIATE) | ||
183 | |||
184 | if opts.username and opts.password: | ||
185 | if self.scheme in ('http', 'https'): | ||
186 | - self.curl_obj.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_ANY) | ||
187 | + self.curl_obj.setopt(curl.HTTPAUTH, curl.HTTPAUTH_ANY) | ||
188 | |||
189 | if opts.username and opts.password: | ||
190 | # apparently when applying them as curlopts they do not require quoting of any kind | ||
191 | userpwd = '%s:%s' % (opts.username, opts.password) | ||
192 | - self.curl_obj.setopt(pycurl.USERPWD, userpwd) | ||
193 | + self.curl_obj.setopt(curl.USERPWD, userpwd) | ||
194 | |||
195 | #posts - simple - expects the fields as they are | ||
196 | if opts.data: | ||
197 | - self.curl_obj.setopt(pycurl.POST, True) | ||
198 | - self.curl_obj.setopt(pycurl.POSTFIELDS, _to_utf8(opts.data)) | ||
199 | + self.curl_obj.setopt(curl.POST, True) | ||
200 | + self.curl_obj.setopt(curl.POSTFIELDS, _to_utf8(opts.data)) | ||
201 | |||
202 | # ftp | ||
203 | if opts.ftp_disable_epsv: | ||
204 | - self.curl_obj.setopt(pycurl.FTP_USE_EPSV, False) | ||
205 | + self.curl_obj.setopt(curl.FTP_USE_EPSV, False) | ||
206 | |||
207 | # our url | ||
208 | - self.curl_obj.setopt(pycurl.URL, self.url) | ||
209 | + self.curl_obj.setopt(curl.URL, self.url) | ||
210 | |||
211 | |||
212 | def _do_perform(self): | ||
213 | @@ -1490,7 +1490,7 @@ class PyCurlFileObject(object): | ||
214 | |||
215 | try: | ||
216 | self.curl_obj.perform() | ||
217 | - except pycurl.error, e: | ||
218 | + except curl.error, e: | ||
219 | # XXX - break some of these out a bit more clearly | ||
220 | # to other URLGrabErrors from | ||
221 | # http://curl.haxx.se/libcurl/c/libcurl-errors.html | ||
222 | @@ -1505,11 +1505,11 @@ class PyCurlFileObject(object): | ||
223 | |||
224 | if errcode == 23 and 200 <= code <= 299: | ||
225 | # this is probably wrong but ultimately this is what happens | ||
226 | - # we have a legit http code and a pycurl 'writer failed' code | ||
227 | + # we have a legit http code and a curl 'writer failed' code | ||
228 | # which almost always means something aborted it from outside | ||
229 | # since we cannot know what it is -I'm banking on it being | ||
230 | # a ctrl-c. XXXX - if there's a way of going back two raises to | ||
231 | - # figure out what aborted the pycurl process FIXME | ||
232 | + # figure out what aborted the curl process FIXME | ||
233 | raise getattr(self, '_cb_error', KeyboardInterrupt) | ||
234 | |||
235 | elif errcode == 28: | ||
236 | @@ -1519,11 +1519,11 @@ class PyCurlFileObject(object): | ||
237 | |||
238 | elif errcode == 42: | ||
239 | # this is probably wrong but ultimately this is what happens | ||
240 | - # we have a legit http code and a pycurl 'writer failed' code | ||
241 | + # we have a legit http code and a curl 'writer failed' code | ||
242 | # which almost always means something aborted it from outside | ||
243 | # since we cannot know what it is -I'm banking on it being | ||
244 | # a ctrl-c. XXXX - if there's a way of going back two raises to | ||
245 | - # figure out what aborted the pycurl process FIXME | ||
246 | + # figure out what aborted the curl process FIXME | ||
247 | raise KeyboardInterrupt | ||
248 | |||
249 | else: | ||
250 | @@ -1750,7 +1750,7 @@ class PyCurlFileObject(object): | ||
251 | pass # URL too long. = IOError ... ignore everything. | ||
252 | |||
253 | # set the time | ||
254 | - mod_time = self.curl_obj.getinfo(pycurl.INFO_FILETIME) | ||
255 | + mod_time = self.curl_obj.getinfo(curl.INFO_FILETIME) | ||
256 | if mod_time != -1: | ||
257 | try: | ||
258 | os.utime(self.filename, (mod_time, mod_time)) | ||
259 | @@ -1863,7 +1863,7 @@ class PyCurlFileObject(object): | ||
260 | |||
261 | msg = _("Downloaded more than max size for %s: %s > %s") \ | ||
262 | % (self.url, cur, max_size) | ||
263 | - self._error = (pycurl.E_FILESIZE_EXCEEDED, msg) | ||
264 | + self._error = (curl.E_FILESIZE_EXCEEDED, msg) | ||
265 | return True | ||
266 | return False | ||
267 | |||
268 | @@ -1903,16 +1903,16 @@ class PyCurlFileObject(object): | ||
269 | urllib.addinfourl, via. urllib.URLopener.* """ | ||
270 | return self.url | ||
271 | |||
272 | -if hasattr(pycurl, 'GLOBAL_ACK_EINTR'): | ||
273 | +if hasattr(curl, 'GLOBAL_ACK_EINTR'): | ||
274 | # fail immediately on ctrl-c | ||
275 | - pycurl.global_init(pycurl.GLOBAL_DEFAULT | pycurl.GLOBAL_ACK_EINTR) | ||
276 | -_curl_cache = pycurl.Curl() # make one and reuse it over and over and over | ||
277 | + curl.global_init(curl.GLOBAL_DEFAULT | curl.GLOBAL_ACK_EINTR) | ||
278 | +_curl_cache = curl.Curl() # make one and reuse it over and over and over | ||
279 | |||
280 | def reset_curl_obj(): | ||
281 | """To make sure curl has reread the network/dns info we force a reload""" | ||
282 | global _curl_cache | ||
283 | _curl_cache.close() | ||
284 | - _curl_cache = pycurl.Curl() | ||
285 | + _curl_cache = curl.Curl() | ||
286 | |||
287 | _libproxy_cache = None | ||
288 | |||
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 @@ | |||
1 | DESCRIPTION = "urlgrabber is a pure python package that drastically simplifies the fetching of files." | ||
2 | |||
3 | HOMEPAGE = "http://urlgrabber.baseurl.org/" | ||
4 | SECTION = "devel/python" | ||
5 | PRIORITY = "optional" | ||
6 | LICENSE = "LGPL2.1+" | ||
7 | PR = "r1" | ||
8 | |||
9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=68ad62c64cc6c620126241fd429e68fe" | ||
10 | |||
11 | SRC_URI = "http://urlgrabber.baseurl.org/download/urlgrabber-${PV}.tar.gz \ | ||
12 | file://pycurl-curl.patch" | ||
13 | |||
14 | S = "${WORKDIR}/urlgrabber-${PV}" | ||
15 | |||
16 | SRC_URI[md5sum] = "1f5dc63805623cc473e06204fd240bb2" | ||
17 | SRC_URI[sha256sum] = "06b13ff8d527dba3aee04069681b2c09c03117592d5485a80ae4b807cdf33476" | ||
18 | |||
19 | RDEPENDS_${PN} = "python-pycurl" | ||
20 | |||
21 | inherit distutils | ||
22 | |||
23 | FILES_${PN} += "/usr/share/libexec" | ||
24 | |||
25 | # setup.py will try to include the urlgrabber package, which fails since we | ||
26 | # don't have pycurl in the native sysroot. It's included just to get the | ||
27 | # version and description text strings for inclusion in the package. Avoid this | ||
28 | # by dynamically creating a version of urlgrabber that does not include the | ||
29 | # actual urlgrabber features, that setup.py can include. | ||
30 | do_patch() { | ||
31 | # Create a non-importing version of urlgrabber for the setup script | ||
32 | mkdir ${S}/urlgrabber_version | ||
33 | sed 's/^from grabber import.*//' ${S}/urlgrabber/__init__.py > ${S}/urlgrabber_version/__init__.py | ||
34 | |||
35 | # Make sure the setup script uses the version-only urlgrabber | ||
36 | sed -i 's/import urlgrabber/&_version/' ${S}/setup.py | ||
37 | } | ||
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 @@ | |||
1 | SUMMARY = "virt-manager" | ||
2 | DESCRIPTION = "virt-manager" | ||
3 | HOMEPAGE = "http://virt-manager.org" | ||
4 | SECTION = "devel" | ||
5 | |||
6 | LICENSE = "GPLv2+" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | ||
8 | |||
9 | SRC_URI = "https://fedorahosted.org/released/virt-manager/virt-manager-${PV}.tar.gz" | ||
10 | SRC_URI[sha256sum] = "2b2f59f7fccd2fcfbaf4306e33342e5d2be8f0ddd71af9eeca0c1f215e1e29aa" | ||
11 | SRC_URI[md5sum] = "8a0585de48d8060a5394aae912342c95" | ||
12 | |||
13 | sharedir = "${datadir}" | ||
14 | |||
15 | FILES_${PN} = " \ | ||
16 | ${bindir}/virt-clone \ | ||
17 | ${bindir}/virt-image \ | ||
18 | ${bindir}/virt-install \ | ||
19 | ${bindir}/virt-convert \ | ||
20 | ${bindir}/virt-xml \ | ||
21 | ${sharedir}/virt-manager/virt-clone \ | ||
22 | ${sharedir}/virt-manager/virt-image \ | ||
23 | ${sharedir}/virt-manager/virt-install \ | ||
24 | ${sharedir}/virt-manager/virt-convert \ | ||
25 | ${sharedir}/virt-manager/virt-xml \ | ||
26 | ${sharedir}/virt-manager/virtinst \ | ||
27 | ${sharedir}/virt-manager/virtconv \ | ||
28 | ${sharedir}/virt-manager/virtcli \ | ||
29 | \ | ||
30 | ${sharedir}/virt-manager/virt-manager \ | ||
31 | ${sharedir}/virt-manager/virtManager \ | ||
32 | ${sharedir}/virt-manager/ui \ | ||
33 | ${sharedir}/virt-manager/icons \ | ||
34 | ${sharedir}/icons \ | ||
35 | ${sharedir}/appdata \ | ||
36 | ${sharedir}/applications \ | ||
37 | ${sharedir}/glib-2.0 \ | ||
38 | ${@base_contains('DISTRO_FEATURES', 'x11', '${bindir}/virt-manager', '', d)} \ | ||
39 | " | ||
40 | |||
41 | DEPENDS = "nativesdk-perl" | ||
42 | |||
43 | RDEPENDS_${PN} = " \ | ||
44 | libvirt-python \ | ||
45 | python-urlgrabber \ | ||
46 | libxml2-python \ | ||
47 | ${@base_contains('DISTRO_FEATURES', 'x11', 'python-pygtk', '', d)} \ | ||
48 | " | ||
49 | |||
50 | |||
51 | do_configure() { | ||
52 | python setup.py configure | ||
53 | } | ||
54 | |||
55 | do_build() { | ||
56 | python setup.py build --prefix=${prefix} | ||
57 | } | ||
58 | |||
59 | # virt-manager is the only command that requires graphical libraries. The | ||
60 | # package does however not supply a --no-graphics argument or such to the | ||
61 | # install program, which is understandable since distutils (which is | ||
62 | # undocumented to a large degree) seems to be called with the complete file | ||
63 | # list before the argument parsing is performed. To avoid that this command is | ||
64 | # available when the package is built as part of a non-x11 distro, remove the | ||
65 | # /usr/bin/virt-manager file. | ||
66 | |||
67 | REMOVE_COMMAND = "${@base_contains('DISTRO_FEATURES', 'x11', '', 'rm ${D}${bindir}/virt-manager', d)}" | ||
68 | do_install() { | ||
69 | python setup.py install --prefix=${prefix} --root=${D} | ||
70 | |||
71 | sh -c "${REMOVE_COMMAND}" | ||
72 | } | ||
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 @@ | |||
1 | From: Stephane Eranian | ||
2 | Date: Wed Apr 23 2014 - 13:04:31 EST | ||
3 | This patch fixes a bug introduced by commit 24223657. | ||
4 | |||
5 | perf/x86: fix RAPL rdmsrl_safe() usage | ||
6 | |||
7 | The rdmsrl_safe() function returns 0 on success. | ||
8 | The current code was failing to detect the RAPL PMU | ||
9 | on real hardware (missing /sys/devices/power) because | ||
10 | the return value of rdmsrl_safe() was misinterpreted. | ||
11 | |||
12 | Signed-off-by: Stephane Eranian <eranian@xxxxxxxxxx> | ||
13 | Upstream-Status: Backport [http://lkml.iu.edu/hypermail/linux/kernel/1404.2/05008.html] | ||
14 | |||
15 | diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
16 | index 7c87424..619f769 100644 | ||
17 | --- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
18 | +++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
19 | @@ -543,7 +543,8 @@ static int rapl_cpu_prepare(int cpu) | ||
20 | if (phys_id < 0) | ||
21 | return -1; | ||
22 | |||
23 | - if (!rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) | ||
24 | + /* protect rdmsrl() to handle virtualization */ | ||
25 | + if (rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) | ||
26 | return -1; | ||
27 | |||
28 | pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); | ||
29 | -- | ||
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 @@ | |||
1 | From 24223657806a0ebd0ae5c9caaf7b021091889cf2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Venkatesh Srinivas <venkateshs@google.com> | ||
3 | Date: Thu, 13 Mar 2014 12:36:26 -0700 | ||
4 | Subject: [PATCH] perf/x86/intel: Use rdmsrl_safe() when initializing RAPL PMU | ||
5 | |||
6 | CPUs which should support the RAPL counters according to | ||
7 | Family/Model/Stepping may still issue #GP when attempting to access | ||
8 | the RAPL MSRs. This may happen when Linux is running under KVM and | ||
9 | we are passing-through host F/M/S data, for example. Use rdmsrl_safe | ||
10 | to first access the RAPL_POWER_UNIT MSR; if this fails, do not | ||
11 | attempt to use this PMU. | ||
12 | |||
13 | Signed-off-by: Venkatesh Srinivas <venkateshs@google.com> | ||
14 | Signed-off-by: Peter Zijlstra <peterz@infradead.org> | ||
15 | Link: http://lkml.kernel.org/r/1394739386-22260-1-git-send-email-venkateshs@google.com | ||
16 | Cc: zheng.z.yan@intel.com | ||
17 | Cc: eranian@google.com | ||
18 | Cc: ak@linux.intel.com | ||
19 | Cc: linux-kernel@vger.kernel.org | ||
20 | [ The patch also silently fixes another bug: rapl_pmu_init() didn't handle the memory alloc failure case previously. ] | ||
21 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | ||
22 | Upstream-Status: Backport | ||
23 | --- | ||
24 | arch/x86/kernel/cpu/perf_event_intel_rapl.c | 12 +++++++++--- | ||
25 | 1 file changed, 9 insertions(+), 3 deletions(-) | ||
26 | |||
27 | diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
28 | index 4b9a9e9..7c87424 100644 | ||
29 | --- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
30 | +++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
31 | @@ -535,6 +535,7 @@ static int rapl_cpu_prepare(int cpu) | ||
32 | struct rapl_pmu *pmu = per_cpu(rapl_pmu, cpu); | ||
33 | int phys_id = topology_physical_package_id(cpu); | ||
34 | u64 ms; | ||
35 | + u64 msr_rapl_power_unit_bits; | ||
36 | |||
37 | if (pmu) | ||
38 | return 0; | ||
39 | @@ -542,6 +543,9 @@ static int rapl_cpu_prepare(int cpu) | ||
40 | if (phys_id < 0) | ||
41 | return -1; | ||
42 | |||
43 | + if (!rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) | ||
44 | + return -1; | ||
45 | + | ||
46 | pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); | ||
47 | if (!pmu) | ||
48 | return -1; | ||
49 | @@ -555,8 +559,7 @@ static int rapl_cpu_prepare(int cpu) | ||
50 | * | ||
51 | * we cache in local PMU instance | ||
52 | */ | ||
53 | - rdmsrl(MSR_RAPL_POWER_UNIT, pmu->hw_unit); | ||
54 | - pmu->hw_unit = (pmu->hw_unit >> 8) & 0x1FULL; | ||
55 | + pmu->hw_unit = (msr_rapl_power_unit_bits >> 8) & 0x1FULL; | ||
56 | pmu->pmu = &rapl_pmu_class; | ||
57 | |||
58 | /* | ||
59 | @@ -677,7 +680,9 @@ static int __init rapl_pmu_init(void) | ||
60 | cpu_notifier_register_begin(); | ||
61 | |||
62 | for_each_online_cpu(cpu) { | ||
63 | - rapl_cpu_prepare(cpu); | ||
64 | + ret = rapl_cpu_prepare(cpu); | ||
65 | + if (ret) | ||
66 | + goto out; | ||
67 | rapl_cpu_init(cpu); | ||
68 | } | ||
69 | |||
70 | @@ -700,6 +705,7 @@ static int __init rapl_pmu_init(void) | ||
71 | hweight32(rapl_cntr_mask), | ||
72 | ktime_to_ms(pmu->timer_interval)); | ||
73 | |||
74 | +out: | ||
75 | put_online_cpus(); | ||
76 | |||
77 | return 0; | ||
78 | -- | ||
79 | 1.9.0 | ||
80 | |||
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 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
2 | |||
3 | require recipes-kernel/linux/kernel-configure.inc | ||
4 | |||
5 | KERNEL_DEFCONFIG = "${B}/.config" | ||
6 | KERNEL_FEATURES = " \ | ||
7 | cfg/00043-containers \ | ||
8 | cfg/00047-bridge \ | ||
9 | " | ||
10 | |||
11 | do_configure_append() { | ||
12 | configure_kernel ${KERNEL_DEFCONFIG} "${KERNEL_FEATURES}" | ||
13 | } | ||
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 @@ | |||
1 | SRC_URI += " \ | ||
2 | file://cfg/00040-9p.cfg \ | ||
3 | file://cfg/00041-virtio.cfg \ | ||
4 | file://cfg/00042-vhost.cfg \ | ||
5 | file://cfg/00043-containers.cfg \ | ||
6 | " | ||
7 | |||
8 | KERNEL_FEATURES_append = "\ | ||
9 | cfg/00040-9p \ | ||
10 | cfg/00041-virtio \ | ||
11 | cfg/00042-vhost \ | ||
12 | cfg/00043-containers \ | ||
13 | " | ||
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 @@ | |||
1 | SRC_URI += " \ | ||
2 | file://cfg/00040-9p.cfg \ | ||
3 | file://cfg/00041-virtio.cfg \ | ||
4 | file://cfg/00042-vhost.cfg \ | ||
5 | file://cfg/00043-containers.cfg \ | ||
6 | " | ||
7 | |||
8 | KERNEL_FEATURES_append = "\ | ||
9 | cfg/00040-9p \ | ||
10 | cfg/00041-virtio \ | ||
11 | cfg/00042-vhost \ | ||
12 | cfg/00043-containers \ | ||
13 | " | ||
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 @@ | |||
1 | SRC_URI =+ "\ | ||
2 | file://cfg/00035-netfilter.cfg \ | ||
3 | file://cfg/00036-ppc_virt.cfg \ | ||
4 | file://cfg/00037-ppc_lxc.cfg \ | ||
5 | file://cfg/00040-9p.cfg \ | ||
6 | file://cfg/00041-virtio.cfg \ | ||
7 | file://cfg/00042-vhost.cfg \ | ||
8 | file://cfg/00043-containers.cfg \ | ||
9 | file://cfg/00048-containers_no_user_ns.cfg \ | ||
10 | " | ||
11 | |||
12 | VIRT_FEATURES = "\ | ||
13 | cfg/00035-netfilter \ | ||
14 | cfg/00036-ppc_virt \ | ||
15 | cfg/00037-ppc_lxc \ | ||
16 | cfg/00040-9p \ | ||
17 | cfg/00041-virtio \ | ||
18 | cfg/00042-vhost \ | ||
19 | cfg/00048-containers_no_user_ns \ | ||
20 | " | ||
21 | |||
22 | |||
23 | KERNEL_FEATURES_append_powerpc= " ${VIRT_FEATURES}" | ||
24 | 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 @@ | |||
1 | SRC_URI_append = " \ | ||
2 | file://cfg/00035-netfilter.cfg \ | ||
3 | file://cfg/00040-9p.cfg \ | ||
4 | file://cfg/00041-virtio.cfg \ | ||
5 | file://cfg/00042-vhost.cfg \ | ||
6 | file://cfg/00043-containers.cfg \ | ||
7 | " | ||
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 @@ | |||
1 | SRC_URI += " \ | ||
2 | file://cfg/00040-9p.cfg \ | ||
3 | file://cfg/00041-virtio.cfg \ | ||
4 | file://cfg/00042-vhost.cfg \ | ||
5 | file://cfg/00043-containers.cfg \ | ||
6 | " | ||
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 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
2 | SRC_URI += "file://perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch \ | ||
3 | file://perf-x86-fix-RAPL-rdmsrl_safe-usage.patch \ | ||
4 | file://cfg/00040-9p.cfg \ | ||
5 | file://cfg/00041-virtio.cfg \ | ||
6 | file://cfg/00042-vhost.cfg \ | ||
7 | file://cfg/00043-containers.cfg \ | ||
8 | " | ||
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 @@ | |||
1 | DESCRIPTION = "The Linux Kernel Stream Control Transmission Protocol (lksctp) project" | ||
2 | SECTION = "libs" | ||
3 | LICENSE = "LGPLv2" | ||
4 | |||
5 | LIC_FILES_CHKSUM = " \ | ||
6 | file://COPYING.lib;md5=0a1b79af951c42a9c8573533fbba9a92 \ | ||
7 | file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \ | ||
8 | " | ||
9 | |||
10 | SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz" | ||
11 | |||
12 | SRC_URI[md5sum] = "708bb0b5a6806ad6e8d13c55b067518e" | ||
13 | SRC_URI[sha256sum] = "0903dd526b7f30a89d5031aa2c82757612becc38ed7bc6e4f972f8deae351f26" | ||
14 | |||
15 | S = "${WORKDIR}/${BP}" | ||
16 | |||
17 | BBCLASSEXTEND = "native" | ||
18 | |||
19 | inherit autotools pkgconfig binconfig | ||
20 | |||
21 | SOLIBVERSION="${PV}" | ||
22 | SOLIBMAJORVERSION="1" | ||
23 | |||
24 | PACKAGES =+ "${PN}-withsctp ${PN}-utils" | ||
25 | |||
26 | FILES_${PN} = " \ | ||
27 | ${libdir}/libsctp.so.${SOLIBVERSION} \ | ||
28 | " | ||
29 | |||
30 | FILES_${PN}-withsctp = " \ | ||
31 | ${libdir}/lksctp-tools/libwithsctp.so.${SOLIBVERSION} \ | ||
32 | " | ||
33 | |||
34 | FILES_${PN}-dev += " \ | ||
35 | ${libdir}/libsctp.so.${SOLIBMAJORVERSION} \ | ||
36 | ${libdir}/libsctp.so \ | ||
37 | ${libdir}/lksctp-tools/libwithsctp.so.${SOLIBMAJORVERSION} \ | ||
38 | ${libdir}/lksctp-tools/libwithsctp.so \ | ||
39 | ${datadir}/lksctp-tools/checksctp.c \ | ||
40 | ${datadir}/lksctp-tools/sctp_socket.c \ | ||
41 | ${datadir}/lksctp-tools/sctp_status.c \ | ||
42 | ${datadir}/lksctp-tools/sctp_bind.c \ | ||
43 | ${datadir}/lksctp-tools/sctp_darn.c \ | ||
44 | ${datadir}/lksctp-tools/sctp_load_libs.c \ | ||
45 | ${datadir}/lksctp-tools/sctp_sockopt.c \ | ||
46 | ${datadir}/lksctp-tools/sctp_socket.h \ | ||
47 | ${datadir}/lksctp-tools/sctp_test.c \ | ||
48 | ${datadir}/lksctp-tools/sctp_darn.h \ | ||
49 | " | ||
50 | |||
51 | FILES_${PN}-utils = " \ | ||
52 | ${bindir}/sctp_test \ | ||
53 | ${bindir}/sctp_darn \ | ||
54 | ${bindir}/checksctp \ | ||
55 | ${bindir}/withsctp \ | ||
56 | ${bindir}/sctp_status \ | ||
57 | " | ||