diff options
| -rw-r--r-- | meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb index 27d98a3049..34a869d1fe 100644 --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | |||
| @@ -2,14 +2,19 @@ SUMMARY = "Kernel selftest for Linux" | |||
| 2 | DESCRIPTION = "Kernel selftest for Linux" | 2 | DESCRIPTION = "Kernel selftest for Linux" |
| 3 | LICENSE = "GPLv2" | 3 | LICENSE = "GPLv2" |
| 4 | 4 | ||
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7 \ | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" |
| 6 | " | 6 | |
| 7 | DEPENDS = "rsync-native" | ||
| 7 | 8 | ||
| 8 | # for musl libc | 9 | # for musl libc |
| 9 | SRC_URI_libc-musl += "file://userfaultfd.patch \ | 10 | SRC_URI_libc-musl += "file://userfaultfd.patch \ |
| 10 | file://0001-bpf-test_progs.c-add-support-for-musllibc.patch \ | 11 | file://0001-bpf-test_progs.c-add-support-for-musllibc.patch \ |
| 11 | " | 12 | " |
| 12 | 13 | ||
| 14 | # now we just test bpf and vm | ||
| 15 | # we will append other kernel selftest in the future | ||
| 16 | # bpf was added in 4.10 with: https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d | ||
| 17 | # if you have older kernel than that you need to remove it from PACKAGECONFIG | ||
| 13 | PACKAGECONFIG ??= "bpf vm" | 18 | PACKAGECONFIG ??= "bpf vm" |
| 14 | 19 | ||
| 15 | PACKAGECONFIG[bpf] = ",,elfutils libcap libcap-ng rsync-native," | 20 | PACKAGECONFIG[bpf] = ",,elfutils libcap libcap-ng rsync-native," |
| @@ -23,10 +28,8 @@ do_populate_lic[depends] += "virtual/kernel:do_patch" | |||
| 23 | 28 | ||
| 24 | S = "${WORKDIR}/${BP}" | 29 | S = "${WORKDIR}/${BP}" |
| 25 | 30 | ||
| 26 | # now we just test bpf and vm | 31 | TEST_LIST = " \ |
| 27 | # we will append other kernel selftest in the future | 32 | ${@bb.utils.filter('PACKAGECONFIG', 'bpf vm', d)} \ |
| 28 | TEST_LIST = "bpf \ | ||
| 29 | vm \ | ||
| 30 | " | 33 | " |
| 31 | 34 | ||
| 32 | EXTRA_OEMAKE = '\ | 35 | EXTRA_OEMAKE = '\ |
| @@ -35,12 +38,9 @@ EXTRA_OEMAKE = '\ | |||
| 35 | CC="${CC}" \ | 38 | CC="${CC}" \ |
| 36 | AR="${AR}" \ | 39 | AR="${AR}" \ |
| 37 | LD="${LD}" \ | 40 | LD="${LD}" \ |
| 41 | DESTDIR="${D}" \ | ||
| 38 | ' | 42 | ' |
| 39 | 43 | ||
| 40 | EXTRA_OEMAKE += "\ | ||
| 41 | 'DESTDIR=${D}' \ | ||
| 42 | " | ||
| 43 | |||
| 44 | KERNEL_SELFTEST_SRC ?= "Makefile \ | 44 | KERNEL_SELFTEST_SRC ?= "Makefile \ |
| 45 | include \ | 45 | include \ |
| 46 | tools \ | 46 | tools \ |
| @@ -95,10 +95,17 @@ python copy_kselftest_source_from_kernel() { | |||
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | remove_clang_related() { | 97 | remove_clang_related() { |
| 98 | sed -i -e '/test_pkt_access/d' -e '/test_pkt_md_access/d' ${S}/tools/testing/selftests/bpf/Makefile | 98 | if ${@bb.utils.contains('PACKAGECONFIG','bpf','true','false',d)} ; then |
| 99 | test -f ${S}/tools/testing/selftests/bpf/Makefile && \ | ||
| 100 | sed -i -e '/test_pkt_access/d' -e '/test_pkt_md_access/d' ${S}/tools/testing/selftests/bpf/Makefile || \ | ||
| 101 | 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" | ||
| 102 | fi | ||
| 99 | } | 103 | } |
| 100 | 104 | ||
| 101 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 105 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 102 | 106 | ||
| 103 | INHIBIT_PACKAGE_DEBUG_SPLIT="1" | 107 | INHIBIT_PACKAGE_DEBUG_SPLIT="1" |
| 104 | FILES_${PN} += "/usr/kernel-selftest" | 108 | FILES_${PN} += "/usr/kernel-selftest" |
| 109 | |||
| 110 | # tools/testing/selftests/vm/Makefile doesn't respect LDFLAGS and tools/testing/selftests/Makefile explicitly overrides to empty | ||
| 111 | INSANE_SKIP_${PN} += "ldflags" | ||
