diff options
author | Yongxin Liu <yongxin.liu@windriver.com> | 2019-07-08 14:39:00 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-07-10 09:24:33 -0700 |
commit | 415e213ad75ec9a93171c963395a1c4b92c6233b (patch) | |
tree | 96228c88058c0bbd1c3fc441a21e13c24d8143be /meta-oe/recipes-security/keyutils | |
parent | 64d8fc68a6134ab06a9e625645a849f95cbe1059 (diff) | |
download | meta-openembedded-415e213ad75ec9a93171c963395a1c4b92c6233b.tar.gz |
keyutils: move recipe and patches from meta-security to meta-oe
keyutils is originally in https://git.yoctoproject.org/git/meta-security.
Move it to meta-oe since other recipes in OE depend on it.
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-security/keyutils')
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 @@ | |||
1 | From b0355cc205543ffd33752874295139d57c4fbc3e Mon Sep 17 00:00:00 2001 | ||
2 | From: Wenzong Fan <wenzong.fan@windriver.com> | ||
3 | Date: Tue, 26 Sep 2017 07:59:51 +0000 | ||
4 | Subject: [PATCH] Subject: [PATCH] keyutils: use relative path for link | ||
5 | |||
6 | The absolute path of the symlink will be invalid | ||
7 | when populated in sysroot, so use relative path instead. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
12 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | ||
13 | {rebased for 1.6] | ||
14 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | ||
15 | |||
16 | Index: 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 @@ | |||
1 | fix keyutils test error report | ||
2 | |||
3 | Upstream-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. | ||
7 | EXPIRED and REVOKED are 2 status of kernel security keys features. | ||
8 | But the userspace keyutils lib will output the error message, which may | ||
9 | have several reasons. | ||
10 | |||
11 | Signed-off-by: Han Chao <chan@windriver.com> | ||
12 | |||
13 | diff --git a/tests/toolbox.inc.sh b/tests/toolbox.inc.sh | ||
14 | index 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 @@ | |||
1 | From 49b6321368e4bd3cd233d045cd09004ddd7968b2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
3 | Date: Mon, 15 May 2017 14:52:00 +0800 | ||
4 | Subject: [PATCH] keyutils: fix output format | ||
5 | |||
6 | keyutils ptest output format is incorrect, according to yocto | ||
7 | Development Manual | ||
8 | (http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#testing-packages-with-ptest) | ||
9 | 5.10.6. Testing Packages With ptestThe test generates output in the format used by Automake: | ||
10 | <result>: <testname> | ||
11 | where the result can be PASS, FAIL, or SKIP, and the testname can be any | ||
12 | identifying string. | ||
13 | So we should change the test result format to match yocto ptest rules. | ||
14 | |||
15 | Upstream-Status: Inappropriate [OE ptest specific] | ||
16 | |||
17 | Signed-off-by: Li Wang <li.wang@windriver.com> | ||
18 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
19 | --- | ||
20 | tests/runtest.sh | 5 +++++ | ||
21 | 1 file changed, 5 insertions(+) | ||
22 | |||
23 | diff --git a/tests/runtest.sh b/tests/runtest.sh | ||
24 | index 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 | -- | ||
40 | 2.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 | ||
2 | export AUTOMATED=1 | ||
3 | make -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 @@ | |||
1 | SUMMARY = "Linux Key Management Utilities" | ||
2 | DESCRIPTION = "\ | ||
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 | " | ||
7 | HOMEPAGE = "http://people.redhat.com/dhowells/keyutils" | ||
8 | SECTION = "base" | ||
9 | |||
10 | LICENSE = "LGPLv2.1+ & GPLv2.0+" | ||
11 | |||
12 | LIC_FILES_CHKSUM = "file://LICENCE.GPL;md5=5f6e72824f5da505c1f4a7197f004b45 \ | ||
13 | file://LICENCE.LGPL;md5=7d1cacaa3ea752b72ea5e525df54a21f" | ||
14 | |||
15 | inherit siteinfo autotools-brokensep ptest | ||
16 | |||
17 | SRC_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 | |||
24 | SRC_URI[md5sum] = "191987b0ab46bb5b50efd70a6e6ce808" | ||
25 | SRC_URI[sha256sum] = "d3aef20cec0005c0fa6b4be40079885567473185b1a57b629b030e67942c7115" | ||
26 | |||
27 | EXTRA_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 | |||
38 | do_install () { | ||
39 | install -d ${D}/${libdir}/pkgconfig | ||
40 | oe_runmake DESTDIR=${D} install | ||
41 | } | ||
42 | |||
43 | do_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 | |||
49 | RDEPENDS_${PN}-ptest += "lsb" | ||
50 | RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" | ||
51 | RDEPENDS_${PN}-ptest_append_libc-musl = " musl-utils" | ||
52 | |||
53 | BBCLASSEXTEND = "native nativesdk" | ||