diff options
Diffstat (limited to 'recipes-kernel/cryptodev')
3 files changed, 146 insertions, 0 deletions
diff --git a/recipes-kernel/cryptodev/cryptodev_1.5.bb b/recipes-kernel/cryptodev/cryptodev_1.5.bb new file mode 100644 index 0000000..4c1dade --- /dev/null +++ b/recipes-kernel/cryptodev/cryptodev_1.5.bb | |||
@@ -0,0 +1,51 @@ | |||
1 | SECTION = "devel" | ||
2 | SUMMARY = "Linux Cryptodev KERNEL MODULE" | ||
3 | DESCRIPTION = "The Cryptodev package contains the kernel /dev/crypto module" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
6 | RCONFLICTS_${PN} = "ocf-linux" | ||
7 | |||
8 | inherit module | ||
9 | |||
10 | PR = "r1" | ||
11 | DEPENDS += "openssl" | ||
12 | |||
13 | SRCREV = "1c24a0aa996630518d47826a2e3fea129ea094c7" | ||
14 | |||
15 | SRC_URI = "git://repo.or.cz/cryptodev-linux.git;protocol=git \ | ||
16 | file://makefile_fixup.patch \ | ||
17 | file://Add-the-compile-and-install-rules-for-cryptodev-test.patch" | ||
18 | |||
19 | EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"' | ||
20 | |||
21 | S = "${WORKDIR}/git" | ||
22 | python () { | ||
23 | ma = d.getVar("DISTRO_FEATURES", True) | ||
24 | arch = d.getVar("OVERRIDES", True) | ||
25 | |||
26 | # the : after the arch is to skip the message on 64b | ||
27 | if not "multiarch" in ma and ("e5500:" in arch or "e6500:" in arch): | ||
28 | raise bb.parse.SkipPackage("Building the kernel for this arch requires multiarch to be in DISTRO_FEATURES") | ||
29 | |||
30 | promote_kernel = d.getVar('BUILD_64BIT_KERNEL') | ||
31 | |||
32 | if promote_kernel == "1": | ||
33 | d.setVar('KERNEL_CC_append', ' -m64') | ||
34 | d.setVar('KERNEL_LD_append', ' -melf64ppc') | ||
35 | |||
36 | error_qa = d.getVar('ERROR_QA', True) | ||
37 | if 'arch' in error_qa: | ||
38 | d.setVar('ERROR_QA', error_qa.replace(' arch', '')) | ||
39 | } | ||
40 | |||
41 | do_compile_append() { | ||
42 | oe_runmake testprogs | ||
43 | } | ||
44 | |||
45 | do_install_append() { | ||
46 | oe_runmake install_tests | ||
47 | } | ||
48 | |||
49 | PACKAGES += "${PN}-tests" | ||
50 | FILES_${PN}-dbg += "${bindir}/tests_cryptodev/.debug" | ||
51 | FILES_${PN}-tests = "${bindir}/tests_cryptodev/*" | ||
diff --git a/recipes-kernel/cryptodev/files/Add-the-compile-and-install-rules-for-cryptodev-test.patch b/recipes-kernel/cryptodev/files/Add-the-compile-and-install-rules-for-cryptodev-test.patch new file mode 100644 index 0000000..cb871f6 --- /dev/null +++ b/recipes-kernel/cryptodev/files/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/recipes-kernel/cryptodev/files/makefile_fixup.patch b/recipes-kernel/cryptodev/files/makefile_fixup.patch new file mode 100644 index 0000000..323aacd --- /dev/null +++ b/recipes-kernel/cryptodev/files/makefile_fixup.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | diff --git a/Makefile b/Makefile | ||
2 | index 2be8825..b36d68c 100644 | ||
3 | --- a/Makefile | ||
4 | +++ b/Makefile | ||
5 | @@ -1,6 +1,7 @@ | ||
6 | KBUILD_CFLAGS += -I$(src) | ||
7 | KERNEL_DIR = /lib/modules/$(shell uname -r)/build | ||
8 | VERSION = 1.5 | ||
9 | +PREFIX = | ||
10 | |||
11 | cryptodev-objs = ioctl.o main.o cryptlib.o authenc.o zc.o util.o | ||
12 | |||
13 | @@ -12,10 +13,10 @@ build: version.h | ||
14 | version.h: Makefile | ||
15 | @echo "#define VERSION \"$(VERSION)\"" > version.h | ||
16 | |||
17 | -install: | ||
18 | +modules_install: | ||
19 | make -C $(KERNEL_DIR) SUBDIRS=`pwd` modules_install | ||
20 | - @echo "Installing cryptodev.h in /usr/include/crypto ..." | ||
21 | - @install -D crypto/cryptodev.h /usr/include/crypto/cryptodev.h | ||
22 | + @echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..." | ||
23 | + @install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h | ||
24 | |||
25 | clean: | ||
26 | make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean | ||