summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-security/keyutils
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-security/keyutils')
-rw-r--r--meta-oe/recipes-security/keyutils/files/fix_library_install_path.patch28
-rw-r--r--meta-oe/recipes-security/keyutils/files/keyutils-fix-error-report-by-adding-default-message.patch42
-rw-r--r--meta-oe/recipes-security/keyutils/files/keyutils-test-fix-output-format.patch41
-rwxr-xr-xmeta-oe/recipes-security/keyutils/files/run-ptest3
-rw-r--r--meta-oe/recipes-security/keyutils/keyutils_1.6.bb53
5 files changed, 167 insertions, 0 deletions
diff --git a/meta-oe/recipes-security/keyutils/files/fix_library_install_path.patch b/meta-oe/recipes-security/keyutils/files/fix_library_install_path.patch
new file mode 100644
index 000000000..938fe2eb5
--- /dev/null
+++ b/meta-oe/recipes-security/keyutils/files/fix_library_install_path.patch
@@ -0,0 +1,28 @@
1From b0355cc205543ffd33752874295139d57c4fbc3e Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Tue, 26 Sep 2017 07:59:51 +0000
4Subject: [PATCH] Subject: [PATCH] keyutils: use relative path for link
5
6The absolute path of the symlink will be invalid
7when populated in sysroot, so use relative path instead.
8
9Upstream-Status: Pending
10
11Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
12Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
13{rebased for 1.6]
14Signed-off-by: Armin Kuster <akuster808@gmail.com>
15
16Index: keyutils-1.6/Makefile
17===================================================================
18--- keyutils-1.6.orig/Makefile
19+++ keyutils-1.6/Makefile
20@@ -184,7 +184,7 @@ ifeq ($(NO_SOLIB),0)
21 $(INSTALL) -D $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
22 $(LNS) $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
23 mkdir -p $(DESTDIR)$(USRLIBDIR)
24- $(LNS) $(LIBDIR)/$(SONAME) $(DESTDIR)$(USRLIBDIR)/$(DEVELLIB)
25+ $(LNS) $(SONAME) $(DESTDIR)$(USRLIBDIR)/$(DEVELLIB)
26 sed \
27 -e 's,@VERSION\@,$(VERSION),g' \
28 -e 's,@prefix\@,$(PREFIX),g' \
diff --git a/meta-oe/recipes-security/keyutils/files/keyutils-fix-error-report-by-adding-default-message.patch b/meta-oe/recipes-security/keyutils/files/keyutils-fix-error-report-by-adding-default-message.patch
new file mode 100644
index 000000000..acd91c01c
--- /dev/null
+++ b/meta-oe/recipes-security/keyutils/files/keyutils-fix-error-report-by-adding-default-message.patch
@@ -0,0 +1,42 @@
1fix keyutils test error report
2
3Upstream-Status: Pending
4
5"Permission denied" may be the reason of EKEYEXPIRED and EKEYREVOKED.
6"Required key not available" may be the reason of EKEYREVOKED.
7EXPIRED and REVOKED are 2 status of kernel security keys features.
8But the userspace keyutils lib will output the error message, which may
9have several reasons.
10
11Signed-off-by: Han Chao <chan@windriver.com>
12
13diff --git a/tests/toolbox.inc.sh b/tests/toolbox.inc.sh
14index bbca00a..739e9d0 100644
15--- a/tests/toolbox.inc.sh
16+++ b/tests/toolbox.inc.sh
17@@ -227,11 +227,12 @@ function expect_error ()
18 ;;
19 EKEYEXPIRED)
20 my_err="Key has expired"
21- alt_err="Unknown error 127"
22+ alt_err="Permission denied"
23 ;;
24 EKEYREVOKED)
25 my_err="Key has been revoked"
26- alt_err="Unknown error 128"
27+ alt_err="Permission denied"
28+ alt2_err="Required key not available"
29 ;;
30 EKEYREJECTED)
31 my_err="Key has been rejected"
32@@ -249,6 +250,9 @@ function expect_error ()
33 elif [ "x$alt_err" != "x" ] && expr "$my_errmsg" : ".*: $alt_err" >&/dev/null
34 then
35 :
36+ elif [ "x$alt2_err" != "x" ] && expr "$my_errmsg" : ".*: $alt2_err" >&/dev/null
37+ then
38+ :
39 elif [ "x$old_err" != "x" ] && expr "$my_errmsg" : ".*: $old_err" >&/dev/null
40 then
41 :
42
diff --git a/meta-oe/recipes-security/keyutils/files/keyutils-test-fix-output-format.patch b/meta-oe/recipes-security/keyutils/files/keyutils-test-fix-output-format.patch
new file mode 100644
index 000000000..a4ffd50ce
--- /dev/null
+++ b/meta-oe/recipes-security/keyutils/files/keyutils-test-fix-output-format.patch
@@ -0,0 +1,41 @@
1From 49b6321368e4bd3cd233d045cd09004ddd7968b2 Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Mon, 15 May 2017 14:52:00 +0800
4Subject: [PATCH] keyutils: fix output format
5
6keyutils ptest output format is incorrect, according to yocto
7Development Manual
8(http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest)
95.10.6. Testing Packages With ptestThe test generates output in the format used by Automake:
10<result>: <testname>
11where the result can be PASS, FAIL, or SKIP, and the testname can be any
12identifying string.
13So we should change the test result format to match yocto ptest rules.
14
15Upstream-Status: Inappropriate [OE ptest specific]
16
17Signed-off-by: Li Wang <li.wang@windriver.com>
18Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
19---
20 tests/runtest.sh | 5 +++++
21 1 file changed, 5 insertions(+)
22
23diff --git a/tests/runtest.sh b/tests/runtest.sh
24index b6eaa7c..84263fb 100644
25--- a/tests/runtest.sh
26+++ b/tests/runtest.sh
27@@ -21,6 +21,11 @@ for i in ${TESTS}; do
28 echo "### RUNNING TEST $i"
29 if [[ $AUTOMATED != 0 ]] ; then
30 bash ./runtest.sh
31+ if [ $? != 0 ]; then
32+ echo "FAIL: $i"
33+ else
34+ echo "PASS: $i"
35+ fi
36 else
37 bash ./runtest.sh || exit 1
38 fi
39--
402.11.0
41
diff --git a/meta-oe/recipes-security/keyutils/files/run-ptest b/meta-oe/recipes-security/keyutils/files/run-ptest
new file mode 100755
index 000000000..305707f65
--- /dev/null
+++ b/meta-oe/recipes-security/keyutils/files/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2export AUTOMATED=1
3make -C tests run
diff --git a/meta-oe/recipes-security/keyutils/keyutils_1.6.bb b/meta-oe/recipes-security/keyutils/keyutils_1.6.bb
new file mode 100644
index 000000000..4d3a96f29
--- /dev/null
+++ b/meta-oe/recipes-security/keyutils/keyutils_1.6.bb
@@ -0,0 +1,53 @@
1SUMMARY = "Linux Key Management Utilities"
2DESCRIPTION = "\
3 Utilities to control the kernel key management facility and to provide \
4 a mechanism by which the kernel call back to userspace to get a key \
5 instantiated. \
6 "
7HOMEPAGE = "http://people.redhat.com/dhowells/keyutils"
8SECTION = "base"
9
10LICENSE = "LGPLv2.1+ & GPLv2.0+"
11
12LIC_FILES_CHKSUM = "file://LICENCE.GPL;md5=5f6e72824f5da505c1f4a7197f004b45 \
13 file://LICENCE.LGPL;md5=7d1cacaa3ea752b72ea5e525df54a21f"
14
15inherit siteinfo autotools-brokensep ptest
16
17SRC_URI = "http://people.redhat.com/dhowells/keyutils/${BP}.tar.bz2 \
18 file://keyutils-test-fix-output-format.patch \
19 file://keyutils-fix-error-report-by-adding-default-message.patch \
20 file://run-ptest \
21 file://fix_library_install_path.patch \
22 "
23
24SRC_URI[md5sum] = "191987b0ab46bb5b50efd70a6e6ce808"
25SRC_URI[sha256sum] = "d3aef20cec0005c0fa6b4be40079885567473185b1a57b629b030e67942c7115"
26
27EXTRA_OEMAKE = "'CFLAGS=${CFLAGS} -Wall' \
28 NO_ARLIB=1 \
29 BINDIR=${base_bindir} \
30 SBINDIR=${base_sbindir} \
31 LIBDIR=${libdir} \
32 USRLIBDIR=${libdir} \
33 INCLUDEDIR=${includedir} \
34 BUILDFOR=${SITEINFO_BITS}-bit \
35 NO_GLIBC_KEYERR=1 \
36 "
37
38do_install () {
39 install -d ${D}/${libdir}/pkgconfig
40 oe_runmake DESTDIR=${D} install
41}
42
43do_install_ptest () {
44 cp -r ${S}/tests ${D}${PTEST_PATH}/
45 sed -i -e 's/OSDIST=Unknown/OSDIST=${DISTRO}/' ${D}${PTEST_PATH}/tests/prepare.inc.sh
46}
47
48
49RDEPENDS_${PN}-ptest += "lsb"
50RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils"
51RDEPENDS_${PN}-ptest_append_libc-musl = " musl-utils"
52
53BBCLASSEXTEND = "native nativesdk"