diff options
-rw-r--r-- | meta-crystalforest/recipes-extended/zlib-qat/zlib-qat.bb | 110 | ||||
-rw-r--r-- | meta-crystalforest/recipes-extended/zlib-qat/zlib-qat/0001-Fix-for-Zlib-qat-Compilation-issue.patch | 54 |
2 files changed, 164 insertions, 0 deletions
diff --git a/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat.bb b/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat.bb new file mode 100644 index 00000000..a9cc1d7f --- /dev/null +++ b/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat.bb | |||
@@ -0,0 +1,110 @@ | |||
1 | SUMMARY = "Zlib QAT_MEM Memory Management Module for Intel Quick Assist \ | ||
2 | Technology" | ||
3 | |||
4 | DESCRIPTION = "This software acelerates the data compression algorithm \ | ||
5 | in the zlib software library via the Intel QuickAssist Technology \ | ||
6 | implemented on Intel Communications Chipset 89xx and 895x Series based platforms." | ||
7 | |||
8 | HOMEPAGE = "http://zlib.net/" | ||
9 | SECTION = "libs" | ||
10 | LICENSE = "Zlib & GPLv2 & BSD" | ||
11 | LIC_FILES_CHKSUM = "file://${WORKDIR}/zlib-${ZLIB_VERSION}/zlib.h;beginline=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd \ | ||
12 | file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \ | ||
13 | file://${COMMON_LICENSE_DIR}/BSD;md5=3775480a712fc46a69647678acb234cb" | ||
14 | |||
15 | # For target side versions of openssl enable support for OCF Linux driver | ||
16 | # if they are available. | ||
17 | DEPENDS += "cryptodev-linux pkgconfig qat16" | ||
18 | |||
19 | SRC_URI = "http://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz;name=zlib \ | ||
20 | https://01.org/sites/default/files/page/zlib_shim_0.4.7-002_withdocumentation.zip;name=zlibqat \ | ||
21 | file://0001-Fix-for-Zlib-qat-Compilation-issue.patch \ | ||
22 | " | ||
23 | |||
24 | SRC_URI[zlib.md5sum] = "44d667c142d7cda120332623eab69f40" | ||
25 | SRC_URI[zlib.sha256sum] = "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d" | ||
26 | |||
27 | SRC_URI[zlibqat.md5sum] = "dfde8618198aa8d35ecc00d10dcc7000" | ||
28 | SRC_URI[zlibqat.sha256sum] = "8e5786400bbc2a879ae705c864ec63b53ae019b4f2d1c94524a97223847b6e46" | ||
29 | |||
30 | ZLIB_VERSION = "1.2.8" | ||
31 | ZLIB_QAT_VERSION = "0.4.7-002" | ||
32 | |||
33 | S = "${WORKDIR}/zlib-${ZLIB_VERSION}" | ||
34 | |||
35 | export ICP_ROOT = "${PKG_CONFIG_SYSROOT_DIR}" | ||
36 | export ZLIB_ROOT = "${S}" | ||
37 | export ICP_ZLIBQAT = "${S}" | ||
38 | export ICP_BUILD_OUTPUT = "${ICP_ROOT}/lib" | ||
39 | export KERNEL_SOURCE_ROOT = "${STAGING_KERNEL_DIR}" | ||
40 | |||
41 | CFLAGS += "\ | ||
42 | -I${ICP_ROOT}/usr/include \ | ||
43 | -I${ICP_ROOT}/usr/include/dc \ | ||
44 | -I${ZLIB_ROOT}/ \ | ||
45 | -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -DUSE_QAT_MEM -I${ZLIB_ROOT}/contrib/qat/qat_mem -D_GNU_SOURCE \ | ||
46 | -L${ZLIB_ROOT} -lz \ | ||
47 | -L${ICP_ROOT}/usr/lib/ -lpthread -lcrypto -ldl -lrt \ | ||
48 | -L${ICP_ROOT}/usr/lib/ -licp_qa_al -losal -ladf_proxy" | ||
49 | |||
50 | inherit module | ||
51 | MODULE_DIR = "${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers" | ||
52 | MEM_PATH = "${S}/contrib/qat" | ||
53 | |||
54 | do_unpack2(){ | ||
55 | cd ${WORKDIR}/ | ||
56 | unzip zlib_quickassist_patch_l.0.4.7_002_stable.zip | ||
57 | cd zlib_quickassist_patch_l.0.4.7_002_devbranch | ||
58 | tar -xvzf zlib-1.2.8-qat.L.0.4.7-002.tar.gz | ||
59 | cp zlib-1.2.8-qat.patch ${WORKDIR} | ||
60 | } | ||
61 | |||
62 | addtask unpack2 after do_unpack before do_patch | ||
63 | |||
64 | do_patch() { | ||
65 | cd ${S} | ||
66 | patch -p1 < ${WORKDIR}/zlib-1.2.8-qat.patch | ||
67 | patch -p1 < ${WORKDIR}/0001-Fix-for-Zlib-qat-Compilation-issue.patch | ||
68 | } | ||
69 | |||
70 | do_configure() { | ||
71 | cd ${S} | ||
72 | ./configure | ||
73 | } | ||
74 | |||
75 | do_compile() { | ||
76 | EXTRA_OEMAKE="'CFLAGS=${CFLAGS} -fPIC'" | ||
77 | cd ${MEM_PATH}/qat_mem/ | ||
78 | oe_runmake | ||
79 | cd ${S}/ | ||
80 | oe_runmake | ||
81 | cd ${MEM_PATH}/qat_zlib_test/ | ||
82 | oe_runmake | ||
83 | } | ||
84 | |||
85 | do_install() { | ||
86 | chrpath -d ${MEM_PATH}/qat_zlib_test/comptestapp | ||
87 | install -m 0755 -d ${MODULE_DIR}/ | ||
88 | install -m 0755 -d ${D}${bindir}/ | ||
89 | install -m 0755 -d ${D}${sysconfdir}/zlib_conf/ | ||
90 | install -m 640 ${MEM_PATH}/qat_mem/qat_mem.ko ${MODULE_DIR}/ | ||
91 | install -m 0755 ${WORKDIR}/zlib-${ZLIB_VERSION}/zpipe ${D}${bindir}/ | ||
92 | install -m 0755 ${WORKDIR}/zlib-${ZLIB_VERSION}/minigzip ${D}${bindir}/ | ||
93 | install -m 0755 ${MEM_PATH}/qat_zlib_test/comptestapp ${D}${bindir}/ | ||
94 | install -m 660 ${MEM_PATH}/config/dh895xcc/multi_thread_optimized/* ${D}${sysconfdir}/zlib_conf/ | ||
95 | install -m 660 ${MEM_PATH}/config/dh89xxcc/multi_thread_optimized/* ${D}${sysconfdir}/zlib_conf/ | ||
96 | } | ||
97 | |||
98 | PACKAGES += "${PN}-app" | ||
99 | |||
100 | FILES_${PN} += " \ | ||
101 | ${sysconfdir}/zlib_conf/ \ | ||
102 | " | ||
103 | |||
104 | FILES_${PN}-app += " \ | ||
105 | ${bindir}/* \ | ||
106 | " | ||
107 | |||
108 | FILES_${PN}-dbg += " \ | ||
109 | ${bindir}/.debug \ | ||
110 | " | ||
diff --git a/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat/0001-Fix-for-Zlib-qat-Compilation-issue.patch b/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat/0001-Fix-for-Zlib-qat-Compilation-issue.patch new file mode 100644 index 00000000..5d7ca95c --- /dev/null +++ b/meta-crystalforest/recipes-extended/zlib-qat/zlib-qat/0001-Fix-for-Zlib-qat-Compilation-issue.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | From 9ba7bca8e30f76cdc9d667dd7b6d203314301edc Mon Sep 17 00:00:00 2001 | ||
2 | From: venkatasubramanian pattu <venkatasubramanianx.pattu@intel.com> | ||
3 | Date: Thu, 11 Jun 2015 11:45:33 +0800 | ||
4 | Subject: [PATCH] Fix for Zlib-qat Compilation issue | ||
5 | |||
6 | This patch is used to fix the compliation issue when QAT is enabled with | ||
7 | Zlib. | ||
8 | |||
9 | When compiling the Zlib-qat by default it takes the kernel source from the host machine . | ||
10 | Since we are working on the yocto recipe implementation we need to change the path | ||
11 | of the kernel source by exporting the variable (KERNEL_SOURCE_ROOT) in the main recipe. | ||
12 | |||
13 | Upstream-Status: Inappropriate | ||
14 | |||
15 | Signed-off-by: venkatasubramanian pattu <venkatasubramanianx.pattu@intel.com> | ||
16 | --- | ||
17 | contrib/qat/qat_mem/Makefile | 12 ++++-------- | ||
18 | 1 file changed, 4 insertions(+), 8 deletions(-) | ||
19 | |||
20 | diff --git a/contrib/qat/qat_mem/Makefile b/contrib/qat/qat_mem/Makefile | ||
21 | index ddf5b59..0a521f2 100644 | ||
22 | --- a/contrib/qat/qat_mem/Makefile | ||
23 | +++ b/contrib/qat/qat_mem/Makefile | ||
24 | @@ -61,16 +61,10 @@ | ||
25 | ######################################################################### | ||
26 | |||
27 | MODULENAME := qat_mem | ||
28 | -KDIR := /lib/modules/$(shell uname -r)/build | ||
29 | +KDIR := $(KERNEL_SOURCE_ROOT) | ||
30 | PWD := $(shell pwd) | ||
31 | |||
32 | -ifeq ($(shell uname -r|grep -c grsec-WR), 1) | ||
33 | -AUTO_CONF=/lib/modules/$(shell uname -r)/build/include/generated/autoconf.h | ||
34 | -else | ||
35 | -AUTO_CONF=/usr/src/kernels/$(shell uname -r)/include/linux/autoconf.h | ||
36 | -endif | ||
37 | - | ||
38 | -CC := gcc -Wall -imacros $(AUTO_CONF) | ||
39 | +CC := gcc -Wall -imacros $(KERNEL_SOURCE_ROOT)/include/generated/autoconf.h | ||
40 | |||
41 | ifeq ($(KERNELRELEASE),) | ||
42 | all: $(MODULENAME)_test | ||
43 | @@ -80,6 +74,8 @@ else | ||
44 | obj-m := $(MODULENAME).o | ||
45 | endif | ||
46 | |||
47 | +modules_install: | ||
48 | + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules_install | ||
49 | $(MODULENAME)_test: $(MODULENAME)_test.c | ||
50 | $(CC) -g -o $(MODULENAME)_test $(MODULENAME)_test.c | ||
51 | |||
52 | -- | ||
53 | 1.9.1 | ||
54 | |||