diff options
Diffstat (limited to 'meta/recipes-kernel/cryptodev')
8 files changed, 279 insertions, 0 deletions
diff --git a/meta/recipes-kernel/cryptodev/cryptodev-linux_1.6.bb b/meta/recipes-kernel/cryptodev/cryptodev-linux_1.6.bb new file mode 100644 index 0000000000..43f58f311c --- /dev/null +++ b/meta/recipes-kernel/cryptodev/cryptodev-linux_1.6.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | require cryptodev_${PV}.inc | ||
2 | |||
3 | SUMMARY = "A /dev/crypto device driver header file" | ||
4 | |||
5 | do_compile() { | ||
6 | : | ||
7 | } | ||
8 | |||
9 | # Just install cryptodev.h which is the only header file needed to be exported | ||
10 | do_install() { | ||
11 | install -D ${S}/crypto/cryptodev.h ${D}${includedir}/crypto/cryptodev.h | ||
12 | } | ||
13 | |||
14 | ALLOW_EMPTY_${PN} = "1" | ||
15 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-kernel/cryptodev/cryptodev-module_1.6.bb b/meta/recipes-kernel/cryptodev/cryptodev-module_1.6.bb new file mode 100644 index 0000000000..df50e5a1c6 --- /dev/null +++ b/meta/recipes-kernel/cryptodev/cryptodev-module_1.6.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | require cryptodev_${PV}.inc | ||
2 | |||
3 | SUMMARY = "A /dev/crypto device driver kernel module" | ||
4 | |||
5 | inherit module | ||
6 | |||
7 | # Header file provided by a separate package | ||
8 | DEPENDS += "cryptodev-linux" | ||
9 | |||
10 | SRC_URI += " \ | ||
11 | file://0001-Disable-installing-header-file-provided-by-another-p.patch \ | ||
12 | file://0002-In-the-3.13-rc1-Linux-kernel-the-INIT_COMPLETION-mac.patch \ | ||
13 | " | ||
14 | |||
15 | EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"' | ||
16 | |||
17 | RCONFLICTS_${PN} = "ocf-linux" | ||
18 | RREPLACES_${PN} = "ocf-linux" | ||
diff --git a/meta/recipes-kernel/cryptodev/cryptodev-tests_1.6.bb b/meta/recipes-kernel/cryptodev/cryptodev-tests_1.6.bb new file mode 100644 index 0000000000..efc41ae427 --- /dev/null +++ b/meta/recipes-kernel/cryptodev/cryptodev-tests_1.6.bb | |||
@@ -0,0 +1,23 @@ | |||
1 | require cryptodev_${PV}.inc | ||
2 | |||
3 | SUMMARY = "A test suite for /dev/crypto device driver" | ||
4 | |||
5 | DEPENDS += "openssl" | ||
6 | |||
7 | SRC_URI += " \ | ||
8 | file://0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch \ | ||
9 | file://0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch \ | ||
10 | " | ||
11 | |||
12 | EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"' | ||
13 | |||
14 | do_compile() { | ||
15 | oe_runmake testprogs | ||
16 | } | ||
17 | |||
18 | do_install() { | ||
19 | oe_runmake install_tests | ||
20 | } | ||
21 | |||
22 | FILES_${PN}-dbg += "${bindir}/tests_cryptodev/.debug" | ||
23 | FILES_${PN} = "${bindir}/tests_cryptodev/*" | ||
diff --git a/meta/recipes-kernel/cryptodev/cryptodev_1.6.inc b/meta/recipes-kernel/cryptodev/cryptodev_1.6.inc new file mode 100644 index 0000000000..946faac7d2 --- /dev/null +++ b/meta/recipes-kernel/cryptodev/cryptodev_1.6.inc | |||
@@ -0,0 +1,11 @@ | |||
1 | HOMEPAGE = "http://cryptodev-linux.org/" | ||
2 | |||
3 | LICENSE = "GPLv2" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
5 | |||
6 | SRC_URI = "http://download.gna.org/cryptodev-linux/cryptodev-linux-${PV}.tar.gz" | ||
7 | |||
8 | SRC_URI[md5sum] = "eade38998313c25fd7934719cdf8a2ea" | ||
9 | SRC_URI[sha256sum] = "75f1425c8ea1f8cae523905a5a046a35092327a6152800b0b86efc4e56fb3e2f" | ||
10 | |||
11 | S = "${WORKDIR}/cryptodev-linux-${PV}" | ||
diff --git a/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch b/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch new file mode 100644 index 0000000000..cb871f6b44 --- /dev/null +++ b/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | From 1980a8f4779a955e73285e7a0d86549b69bea5c8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yu Zongchun <b40527@freescale.com> | ||
3 | Date: Sun, 28 Apr 2013 14:39:22 +0800 | ||
4 | Subject: [PATCH] Add the compile and install rules for cryptodev tests folder | ||
5 | |||
6 | This is required to install the cryptodev tests folder to rootfs | ||
7 | |||
8 | Signed-off-by: Yu Zongchun <b40527@freescale.com> | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | --- | ||
13 | Makefile | 6 ++++++ | ||
14 | tests/Makefile | 8 ++++++++ | ||
15 | 2 files changed, 14 insertions(+), 0 deletions(-) | ||
16 | |||
17 | diff --git a/Makefile b/Makefile | ||
18 | index 2be8825..4cbb865 100644 | ||
19 | --- a/Makefile | ||
20 | +++ b/Makefile | ||
21 | @@ -17,6 +17,9 @@ install: | ||
22 | @echo "Installing cryptodev.h in /usr/include/crypto ..." | ||
23 | @install -D crypto/cryptodev.h /usr/include/crypto/cryptodev.h | ||
24 | |||
25 | +install_tests: | ||
26 | + make -C tests install DESTDIR=$(PREFIX) | ||
27 | + | ||
28 | clean: | ||
29 | make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean | ||
30 | rm -f $(hostprogs) *~ | ||
31 | @@ -25,6 +28,9 @@ clean: | ||
32 | check: | ||
33 | KERNEL_DIR=$(KERNEL_DIR) make -C tests check | ||
34 | |||
35 | +testprogs: | ||
36 | + KERNEL_DIR=$(KERNEL_DIR) make -C tests testprogs | ||
37 | + | ||
38 | FILEBASE = cryptodev-linux-$(VERSION) | ||
39 | TMPDIR ?= /tmp | ||
40 | OUTPUT = $(FILEBASE).tar.gz | ||
41 | diff --git a/tests/Makefile b/tests/Makefile | ||
42 | index 87ca3c7..0488cf6 100644 | ||
43 | --- a/tests/Makefile | ||
44 | +++ b/tests/Makefile | ||
45 | @@ -19,6 +19,12 @@ example-async-hmac-objs := async_hmac.o | ||
46 | example-async-speed-objs := async_speed.o | ||
47 | example-hashcrypt-speed-objs := hashcrypt_speed.c | ||
48 | |||
49 | +install: | ||
50 | + install -d $(DESTDIR)/usr/bin/tests_cryptodev | ||
51 | + for bin in $(hostprogs); do \ | ||
52 | + install -m 755 $${bin} $(DESTDIR)/usr/bin/tests_cryptodev/; \ | ||
53 | + done | ||
54 | + | ||
55 | check: $(hostprogs) | ||
56 | ./cipher | ||
57 | ./hmac | ||
58 | @@ -28,6 +34,8 @@ check: $(hostprogs) | ||
59 | ./cipher-gcm | ||
60 | ./cipher-aead | ||
61 | |||
62 | +testprogs: $(hostprogs) | ||
63 | + | ||
64 | clean: | ||
65 | rm -f *.o *~ $(hostprogs) | ||
66 | |||
67 | -- | ||
68 | 1.7.5.4 | ||
69 | |||
diff --git a/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch b/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch new file mode 100644 index 0000000000..a580fc68e1 --- /dev/null +++ b/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 8a884f55bd1527baa82fab68c186ba546273860c Mon Sep 17 00:00:00 2001 | ||
2 | From: Denys Dmytriyenko <denys@ti.com> | ||
3 | Date: Sun, 6 Apr 2014 19:51:39 -0400 | ||
4 | Subject: [PATCH] Disable installing header file provided by another package | ||
5 | |||
6 | Signed-off-by: Denys Dmytriyenko <denys@ti.com> | ||
7 | |||
8 | Upstream-Status: Inappropriate [ OE specific ] | ||
9 | --- | ||
10 | Makefile | 2 -- | ||
11 | 1 file changed, 2 deletions(-) | ||
12 | |||
13 | diff --git a/Makefile b/Makefile | ||
14 | index d66ef26..8e97c6a 100644 | ||
15 | --- a/Makefile | ||
16 | +++ b/Makefile | ||
17 | @@ -23,8 +23,6 @@ install: modules_install | ||
18 | |||
19 | modules_install: | ||
20 | make -C $(KERNEL_DIR) SUBDIRS=`pwd` modules_install | ||
21 | - @echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..." | ||
22 | - @install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h | ||
23 | |||
24 | clean: | ||
25 | make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean | ||
26 | -- | ||
27 | 1.9.1 | ||
28 | |||
diff --git a/meta/recipes-kernel/cryptodev/files/0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch b/meta/recipes-kernel/cryptodev/files/0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch new file mode 100644 index 0000000000..f5ab8b4f96 --- /dev/null +++ b/meta/recipes-kernel/cryptodev/files/0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 47ff1eb9bb4f872c1d731b93d334ee5865bf3439 Mon Sep 17 00:00:00 2001 | ||
2 | From: Denys Dmytriyenko <denys@ti.com> | ||
3 | Date: Sun, 6 Apr 2014 22:16:30 -0400 | ||
4 | Subject: [PATCH] Fix tests Makefile usage of LDLIBS vs. LDFLAGS | ||
5 | |||
6 | Libraries must come after objects, as link order matters, especially | ||
7 | when using linker flags like -Wl,--as-needed. | ||
8 | |||
9 | Signed-off-by: Denys Dmytriyenko <denys@ti.com> | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | --- | ||
13 | tests/Makefile | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/tests/Makefile b/tests/Makefile | ||
17 | index cd202af..67c3c83 100644 | ||
18 | --- a/tests/Makefile | ||
19 | +++ b/tests/Makefile | ||
20 | @@ -39,5 +39,5 @@ testprogs: $(hostprogs) | ||
21 | clean: | ||
22 | rm -f *.o *~ $(hostprogs) | ||
23 | |||
24 | -${comp_progs}: LDFLAGS += -lssl -lcrypto | ||
25 | +${comp_progs}: LDLIBS += -lssl -lcrypto | ||
26 | ${comp_progs}: %: %.o openssl_wrapper.o | ||
27 | -- | ||
28 | 1.9.1 | ||
29 | |||
diff --git a/meta/recipes-kernel/cryptodev/files/0002-In-the-3.13-rc1-Linux-kernel-the-INIT_COMPLETION-mac.patch b/meta/recipes-kernel/cryptodev/files/0002-In-the-3.13-rc1-Linux-kernel-the-INIT_COMPLETION-mac.patch new file mode 100644 index 0000000000..c5c7ec75f9 --- /dev/null +++ b/meta/recipes-kernel/cryptodev/files/0002-In-the-3.13-rc1-Linux-kernel-the-INIT_COMPLETION-mac.patch | |||
@@ -0,0 +1,86 @@ | |||
1 | From 57b5544de80db85c8955499831fdaa30829db77a Mon Sep 17 00:00:00 2001 | ||
2 | From: Cosmin Paraschiv <cosmin.paraschiv@freescale.com> | ||
3 | Date: Thu, 23 Jan 2014 03:40:00 +0100 | ||
4 | Subject: [PATCH] In the 3.13-rc1 Linux kernel, the INIT_COMPLETION macro has | ||
5 | been replaced with an inline function, reinit_completion [1][2]. We are | ||
6 | currently using the 3.13-rc3 Linux kernel, which leads to the following | ||
7 | error: | ||
8 | |||
9 | cryptlib.c:279:2: error: implicit declaration of function 'INIT_COMPLETION' [-Werror=implicit-function-declaration] | ||
10 | INIT_COMPLETION(cdata->async.result->completion); | ||
11 | |||
12 | [1] https://github.com/torvalds/linux/commit/c32f74ab2872994bc8336ed367313da3139350ca | ||
13 | [2] https://github.com/torvalds/linux/commit/62026aedaacedbe1ffe94a3599ad4acd8ecdf587 | ||
14 | |||
15 | Signed-off-by: Cosmin Paraschiv <cosmin.paraschiv@freescale.com> | ||
16 | Reviewed-by: Cristian Stoica <cristian.stoica@freescale.com> | ||
17 | Tested-by: Cristian Stoica <cristian.stoica@freescale.com> | ||
18 | Signed-off-by: Horia Geanta <horia.geanta@freescale.com> | ||
19 | Signed-off-by: Phil Sutter <phil@nwl.cc> | ||
20 | |||
21 | Upstream-Status: Backport | ||
22 | --- | ||
23 | cryptlib.c | 8 ++++---- | ||
24 | cryptodev_int.h | 6 ++++++ | ||
25 | 2 files changed, 10 insertions(+), 4 deletions(-) | ||
26 | |||
27 | diff --git a/cryptlib.c b/cryptlib.c | ||
28 | index 54d5d41..a923c14 100644 | ||
29 | --- a/cryptlib.c | ||
30 | +++ b/cryptlib.c | ||
31 | @@ -217,7 +217,7 @@ ssize_t cryptodev_cipher_encrypt(struct cipher_data *cdata, | ||
32 | { | ||
33 | int ret; | ||
34 | |||
35 | - INIT_COMPLETION(cdata->async.result->completion); | ||
36 | + reinit_completion(&cdata->async.result->completion); | ||
37 | |||
38 | if (cdata->aead == 0) { | ||
39 | ablkcipher_request_set_crypt(cdata->async.request, | ||
40 | @@ -240,7 +240,7 @@ ssize_t cryptodev_cipher_decrypt(struct cipher_data *cdata, | ||
41 | { | ||
42 | int ret; | ||
43 | |||
44 | - INIT_COMPLETION(cdata->async.result->completion); | ||
45 | + reinit_completion(&cdata->async.result->completion); | ||
46 | if (cdata->aead == 0) { | ||
47 | ablkcipher_request_set_crypt(cdata->async.request, | ||
48 | (struct scatterlist *)src, dst, | ||
49 | @@ -351,7 +351,7 @@ ssize_t cryptodev_hash_update(struct hash_data *hdata, | ||
50 | { | ||
51 | int ret; | ||
52 | |||
53 | - INIT_COMPLETION(hdata->async.result->completion); | ||
54 | + reinit_completion(&hdata->async.result->completion); | ||
55 | ahash_request_set_crypt(hdata->async.request, sg, NULL, len); | ||
56 | |||
57 | ret = crypto_ahash_update(hdata->async.request); | ||
58 | @@ -363,7 +363,7 @@ int cryptodev_hash_final(struct hash_data *hdata, void* output) | ||
59 | { | ||
60 | int ret; | ||
61 | |||
62 | - INIT_COMPLETION(hdata->async.result->completion); | ||
63 | + reinit_completion(&hdata->async.result->completion); | ||
64 | ahash_request_set_crypt(hdata->async.request, NULL, output, 0); | ||
65 | |||
66 | ret = crypto_ahash_final(hdata->async.request); | ||
67 | diff --git a/cryptodev_int.h b/cryptodev_int.h | ||
68 | index 12dd5b1..188063d 100644 | ||
69 | --- a/cryptodev_int.h | ||
70 | +++ b/cryptodev_int.h | ||
71 | @@ -2,6 +2,12 @@ | ||
72 | #ifndef CRYPTODEV_INT_H | ||
73 | # define CRYPTODEV_INT_H | ||
74 | |||
75 | +#include <linux/version.h> | ||
76 | + | ||
77 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)) | ||
78 | +# define reinit_completion(x) INIT_COMPLETION(*(x)) | ||
79 | +#endif | ||
80 | + | ||
81 | #include <linux/init.h> | ||
82 | #include <linux/sched.h> | ||
83 | #include <linux/fs.h> | ||
84 | -- | ||
85 | 1.9.1 | ||
86 | |||