summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb')
-rw-r--r--meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb26
1 files changed, 16 insertions, 10 deletions
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
index 0d0aa6c5d..2a53419c2 100644
--- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
+++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
@@ -2,16 +2,18 @@ SUMMARY = "Kernel selftest for Linux"
2DESCRIPTION = "Kernel selftest for Linux" 2DESCRIPTION = "Kernel selftest for Linux"
3LICENSE = "GPLv2" 3LICENSE = "GPLv2"
4 4
5LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" 5LIC_FILES_CHKSUM = "file://../COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
6 6
7DEPENDS = "rsync-native" 7DEPENDS = "rsync-native"
8 8
9# for musl libc 9# for musl libc
10SRC_URI_libc-musl += "file://userfaultfd.patch \ 10SRC_URI_append_libc-musl = "\
11 file://userfaultfd.patch \
11 file://0001-bpf-test_progs.c-add-support-for-musllibc.patch \ 12 file://0001-bpf-test_progs.c-add-support-for-musllibc.patch \
12" 13 "
13SRC_URI += "file://run-ptest \ 14SRC_URI += "file://run-ptest \
14" 15 file://COPYING \
16 "
15 17
16# now we just test bpf and vm 18# now we just test bpf and vm
17# we will append other kernel selftest in the future 19# we will append other kernel selftest in the future
@@ -26,11 +28,9 @@ do_patch[depends] += "virtual/kernel:do_shared_workdir"
26 28
27inherit linux-kernel-base kernel-arch ptest 29inherit linux-kernel-base kernel-arch ptest
28 30
29do_populate_lic[depends] += "virtual/kernel:do_patch"
30
31S = "${WORKDIR}/${BP}" 31S = "${WORKDIR}/${BP}"
32 32
33TEST_LIST = " \ 33TEST_LIST = "\
34 ${@bb.utils.filter('PACKAGECONFIG', 'bpf vm', d)} \ 34 ${@bb.utils.filter('PACKAGECONFIG', 'bpf vm', d)} \
35" 35"
36 36
@@ -48,7 +48,7 @@ KERNEL_SELFTEST_SRC ?= "Makefile \
48 tools \ 48 tools \
49 scripts \ 49 scripts \
50 arch \ 50 arch \
51 COPYING \ 51 LICENSES \
52" 52"
53 53
54python __anonymous () { 54python __anonymous () {
@@ -62,6 +62,9 @@ python __anonymous () {
62} 62}
63 63
64do_compile() { 64do_compile() {
65 bbwarn "clang with bpf support is needed with kernel 4.18+ so \
66either install it and add it to HOSTTOOLS, or add \
67clang-native from meta-clang to dependency"
65 for i in ${TEST_LIST} 68 for i in ${TEST_LIST}
66 do 69 do
67 oe_runmake -C ${S}/tools/testing/selftests/${i} 70 oe_runmake -C ${S}/tools/testing/selftests/${i}
@@ -78,7 +81,7 @@ do_install() {
78} 81}
79 82
80do_configure() { 83do_configure() {
81 : 84 install -D -m 0644 ${WORKDIR}/COPYING ${S}/COPYING
82} 85}
83 86
84do_patch[prefuncs] += "copy_kselftest_source_from_kernel remove_unrelated" 87do_patch[prefuncs] += "copy_kselftest_source_from_kernel remove_unrelated"
@@ -99,7 +102,10 @@ python copy_kselftest_source_from_kernel() {
99remove_unrelated() { 102remove_unrelated() {
100 if ${@bb.utils.contains('PACKAGECONFIG','bpf','true','false',d)} ; then 103 if ${@bb.utils.contains('PACKAGECONFIG','bpf','true','false',d)} ; then
101 test -f ${S}/tools/testing/selftests/bpf/Makefile && \ 104 test -f ${S}/tools/testing/selftests/bpf/Makefile && \
102 sed -i -e '/test_pkt_access/d' -e '/test_pkt_md_access/d' -e '/sockmap_verdict_prog/d' -e '/llc/d' ${S}/tools/testing/selftests/bpf/Makefile || \ 105 sed -i -e 's/test_pkt_access.*$/\\/' \
106 -e 's/test_pkt_md_access.*$/\\/' \
107 -e 's/sockmap_verdict_prog.*$/\\/' \
108 ${S}/tools/testing/selftests/bpf/Makefile || \
103 bberror "Your kernel is probably older than 4.10 and doesn't have tools/testing/selftests/bpf/Makefile file from https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d, disable bpf PACKAGECONFIG" 109 bberror "Your kernel is probably older than 4.10 and doesn't have tools/testing/selftests/bpf/Makefile file from https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d, disable bpf PACKAGECONFIG"
104 fi 110 fi
105} 111}