summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurt Bodiker <kurt.bodiker@braintrust-us.com>2018-05-01 10:05:31 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2018-05-01 23:17:29 -0400
commite1279d6de619e50871178d0c061073922fdb3c53 (patch)
tree7f93bda23641183495a8d04e41c4785f22a3a68f
parentb9f265377c8a673c6a5bd4f4bab0ac41a075bfde (diff)
downloadmeta-virtualization-e1279d6de619e50871178d0c061073922fdb3c53.tar.gz
xen: PolarSSL recipe and patches for Xen stubdoms
PolarSSL (now mbedTLS) is a lightweight SSL library optimized for embedded systems. In the case of Xen stubdomains, we are using MiniOS. This PolarSSL recipe creates a static library that is cross-compiled against MiniOS, Xen, LWIP, and Newlib headers and subsequently used during the cross-compilation and linking of the stubdom specific GMP, TPM Emulator, and the Xen vTPM and vTPM Manager stubdomains. The current Xen source code is hardcoded to fetch a specific version of this package. The patch files originate from the Xen/stubdom source tree. This recipe provides the flexibility to change version or modify the patches. Signed-off-by: Kurt Bodiker <kurt.bodiker@braintrust-us.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-extended/xen/files/polarssl.patch64
-rw-r--r--recipes-extended/xen/polarssl.inc27
-rw-r--r--recipes-extended/xen/polarssl_1.1.4.bb19
3 files changed, 110 insertions, 0 deletions
diff --git a/recipes-extended/xen/files/polarssl.patch b/recipes-extended/xen/files/polarssl.patch
new file mode 100644
index 00000000..95487308
--- /dev/null
+++ b/recipes-extended/xen/files/polarssl.patch
@@ -0,0 +1,64 @@
1diff -Naur polarssl-1.1.4/include/polarssl/config.h polarssl-x86_64/include/polarssl/config.h
2--- a/include/polarssl/config.h 2011-12-22 05:06:27.000000000 -0500
3+++ b/include/polarssl/config.h 2012-10-30 17:18:07.567001000 -0400
4@@ -164,8 +164,8 @@
5 * application.
6 *
7 * Uncomment this macro to prevent loading of default entropy functions.
8-#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
9 */
10+#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
11
12 /**
13 * \def POLARSSL_NO_PLATFORM_ENTROPY
14@@ -175,8 +175,8 @@
15 * standards like the /dev/urandom or Windows CryptoAPI.
16 *
17 * Uncomment this macro to disable the built-in platform entropy functions.
18-#define POLARSSL_NO_PLATFORM_ENTROPY
19 */
20+#define POLARSSL_NO_PLATFORM_ENTROPY
21
22 /**
23 * \def POLARSSL_PKCS1_V21
24@@ -426,8 +426,8 @@
25 * Requires: POLARSSL_TIMING_C
26 *
27 * This module enables the HAVEGE random number generator.
28- */
29 #define POLARSSL_HAVEGE_C
30+ */
31
32 /**
33 * \def POLARSSL_MD_C
34@@ -490,7 +490,7 @@
35 *
36 * This module provides TCP/IP networking routines.
37 */
38-#define POLARSSL_NET_C
39+//#define POLARSSL_NET_C
40
41 /**
42 * \def POLARSSL_PADLOCK_C
43@@ -644,8 +644,8 @@
44 * Caller: library/havege.c
45 *
46 * This module is used by the HAVEGE random number generator.
47- */
48 #define POLARSSL_TIMING_C
49+ */
50
51 /**
52 * \def POLARSSL_VERSION_C
53diff -Naur polarssl-1.1.4/library/bignum.c polarssl-x86_64/library/bignum.c
54--- a/library/bignum.c 2012-04-29 16:15:55.000000000 -0400
55+++ b/library/bignum.c 2012-10-30 17:21:52.135000999 -0400
56@@ -1101,7 +1101,7 @@
57 Z.p[i - t - 1] = ~0;
58 else
59 {
60-#if defined(POLARSSL_HAVE_LONGLONG)
61+#if 0 //defined(POLARSSL_HAVE_LONGLONG)
62 t_udbl r;
63
64 r = (t_udbl) X.p[i] << biL;
diff --git a/recipes-extended/xen/polarssl.inc b/recipes-extended/xen/polarssl.inc
new file mode 100644
index 00000000..eae95f40
--- /dev/null
+++ b/recipes-extended/xen/polarssl.inc
@@ -0,0 +1,27 @@
1# Copyright (C) 2017 Kurt Bodiker <kurt.bodiker@braintrust-us.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4require stubdom.inc
5
6DEPENDS += "\
7 newlib \
8"
9STUBDOM_CFLAGS += "\
10 -Wno-memset-elt-size \
11 -Wno-implicit-fallthrough \
12"
13
14# nothing to configure
15do_configure[noexec] = "1"
16
17do_compile() {
18 ${MAKE} CC="${HOST_PREFIX}gcc --sysroot=${RECIPE_SYSROOT} ${STUBDOM_CPPFLAGS} ${STUBDOM_CFLAGS}"
19}
20
21do_install() {
22 install -d ${D}${includedir}
23 cp -r -t ${D}${includedir} ${S}/include/polarssl
24
25 install -d ${D}/${libdir}
26 install -m 644 -t ${D}/${libdir} ${S}/library/libpolarssl.a
27}
diff --git a/recipes-extended/xen/polarssl_1.1.4.bb b/recipes-extended/xen/polarssl_1.1.4.bb
new file mode 100644
index 00000000..80ea45a7
--- /dev/null
+++ b/recipes-extended/xen/polarssl_1.1.4.bb
@@ -0,0 +1,19 @@
1# Copyright (C) 2017 Kurt Bodiker <kurt.bodiker@braintrust-us.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4DESCRIPTION = "PolarSSL (now 'mbed TLS') is an open source, portable, easy to use, readable and flexible SSL library."
5HOMEPAGE = "https://tls.mbed.org"
6LICENSE = "GPLv2"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe"
8
9# git hash for release tag polarssl-1.1.4
10SRCREV_polarssl = "d36da11125a9c85c572a4fdf63e0a25e76d7bb18"
11SRC_URI = "\
12 git://github.com/ARMmbed/mbedtls.git;protocol=https;nobranch=1;destsuffix=polarssl;name=polarssl \
13 file://polarssl.patch; \
14"
15
16S="${WORKDIR}/${PN}"
17B="${S}/library"
18
19require polarssl.inc