diff options
Diffstat (limited to 'meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb')
-rw-r--r-- | meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb index 01f185adba..14aa5d0c0c 100644 --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb | |||
@@ -2,16 +2,19 @@ SUMMARY = "Kernel selftest for Linux" | |||
2 | DESCRIPTION = "Kernel selftest for Linux" | 2 | DESCRIPTION = "Kernel selftest for Linux" |
3 | LICENSE = "GPL-2.0-only" | 3 | LICENSE = "GPL-2.0-only" |
4 | 4 | ||
5 | LIC_FILES_CHKSUM = "file://../COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" |
6 | 6 | ||
7 | DEPENDS = "rsync-native llvm-native" | 7 | DEPENDS = "rsync-native llvm-native" |
8 | 8 | ||
9 | S = "${UNPACKDIR}" | ||
10 | |||
9 | # for musl libc | 11 | # for musl libc |
10 | SRC_URI:append:libc-musl = "\ | 12 | SRC_URI:append:libc-musl = "\ |
11 | file://userfaultfd.patch \ | 13 | file://userfaultfd.patch \ |
12 | " | 14 | " |
13 | SRC_URI += "file://run-ptest \ | 15 | SRC_URI += "file://run-ptest \ |
14 | file://COPYING \ | 16 | file://COPYING \ |
17 | file://0001-selftests-timers-Fix-clock_adjtime-for-newer-32-bit-.patch \ | ||
15 | " | 18 | " |
16 | 19 | ||
17 | # now we just test bpf and vm | 20 | # now we just test bpf and vm |
@@ -42,8 +45,6 @@ do_compile[depends] += "virtual/kernel:do_install" | |||
42 | 45 | ||
43 | inherit linux-kernel-base module-base kernel-arch ptest siteinfo | 46 | inherit linux-kernel-base module-base kernel-arch ptest siteinfo |
44 | 47 | ||
45 | S = "${WORKDIR}/${BP}" | ||
46 | |||
47 | DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map" | 48 | DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map" |
48 | 49 | ||
49 | TEST_LIST = "\ | 50 | TEST_LIST = "\ |
@@ -55,7 +56,7 @@ TEST_LIST = "\ | |||
55 | EXTRA_OEMAKE = '\ | 56 | EXTRA_OEMAKE = '\ |
56 | CROSS_COMPILE=${TARGET_PREFIX} \ | 57 | CROSS_COMPILE=${TARGET_PREFIX} \ |
57 | ARCH=${ARCH} \ | 58 | ARCH=${ARCH} \ |
58 | CC="${CC}" \ | 59 | CC="${CC} ${DEBUG_PREFIX_MAP}" \ |
59 | AR="${AR}" \ | 60 | AR="${AR}" \ |
60 | LD="${LD}" \ | 61 | LD="${LD}" \ |
61 | CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \ | 62 | CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \ |
@@ -96,33 +97,17 @@ either install it and add it to HOSTTOOLS, or add clang-native from meta-clang t | |||
96 | sed -i -e '/mrecord-mcount/d' ${S}/Makefile | 97 | sed -i -e '/mrecord-mcount/d' ${S}/Makefile |
97 | sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/Makefile | 98 | sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/Makefile |
98 | sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/scripts/Makefile.* | 99 | sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/scripts/Makefile.* |
99 | for i in ${TEST_LIST} | 100 | oe_runmake -C ${S}/tools/testing/selftests TARGETS="${TEST_LIST}" |
100 | do | ||
101 | oe_runmake -C ${S}/tools/testing/selftests/${i} | ||
102 | done | ||
103 | } | 101 | } |
104 | 102 | ||
105 | do_install() { | 103 | do_install() { |
106 | for i in ${TEST_LIST} | 104 | oe_runmake -C ${S}/tools/testing/selftests INSTALL_PATH=${D}/usr/kernel-selftest TARGETS="${TEST_LIST}" install |
107 | do | ||
108 | oe_runmake -C ${S}/tools/testing/selftests/${i} INSTALL_PATH=${D}/usr/kernel-selftest/${i} install | ||
109 | # Install kselftest-list.txt that required by kselftest runner. | ||
110 | oe_runmake -s --no-print-directory COLLECTION=${i} -C ${S}/tools/testing/selftests/${i} emit_tests \ | ||
111 | >> ${D}/usr/kernel-selftest/kselftest-list.txt | ||
112 | done | ||
113 | # Install kselftest runner. | ||
114 | install -m 0755 ${S}/tools/testing/selftests/run_kselftest.sh ${D}/usr/kernel-selftest/ | ||
115 | cp -R --no-dereference --preserve=mode,links -v ${S}/tools/testing/selftests/kselftest ${D}/usr/kernel-selftest/ | ||
116 | if [ -e ${D}/usr/kernel-selftest/bpf/test_offload.py ]; then | 105 | if [ -e ${D}/usr/kernel-selftest/bpf/test_offload.py ]; then |
117 | sed -i -e '1s,#!.*python3,#! /usr/bin/env python3,' ${D}/usr/kernel-selftest/bpf/test_offload.py | 106 | sed -i -e '1s,#!.*python3,#! /usr/bin/env python3,' ${D}/usr/kernel-selftest/bpf/test_offload.py |
118 | fi | 107 | fi |
119 | chown root:root -R ${D}/usr/kernel-selftest | 108 | chown root:root -R ${D}/usr/kernel-selftest |
120 | } | 109 | } |
121 | 110 | ||
122 | do_configure() { | ||
123 | install -D -m 0644 ${WORKDIR}/COPYING ${S}/COPYING | ||
124 | } | ||
125 | |||
126 | do_patch[prefuncs] += "copy_kselftest_source_from_kernel remove_unrelated" | 111 | do_patch[prefuncs] += "copy_kselftest_source_from_kernel remove_unrelated" |
127 | python copy_kselftest_source_from_kernel() { | 112 | python copy_kselftest_source_from_kernel() { |
128 | sources = (d.getVar("KERNEL_SELFTEST_SRC") or "").split() | 113 | sources = (d.getVar("KERNEL_SELFTEST_SRC") or "").split() |
@@ -149,15 +134,23 @@ remove_unrelated() { | |||
149 | fi | 134 | fi |
150 | } | 135 | } |
151 | 136 | ||
137 | do_configure[dirs] = "${S}" | ||
138 | |||
152 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 139 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
153 | 140 | ||
154 | INHIBIT_PACKAGE_DEBUG_SPLIT="1" | 141 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" |
155 | FILES:${PN} += "/usr/kernel-selftest" | 142 | FILES:${PN} += "/usr/kernel-selftest" |
156 | 143 | ||
157 | RDEPENDS:${PN} += "python3 perl perl-module-io-handle" | 144 | RDEPENDS:${PN} += "python3 perl perl-module-io-handle" |
158 | 145 | ||
159 | INSANE_SKIP:${PN} += "libdir" | 146 | INSANE_SKIP:${PN} += "libdir" |
160 | 147 | ||
148 | # A few of the selftests set compile flags that trip up the "ldflags" and | ||
149 | # "already-stripped" QA checks. As this is mainly a testing package and | ||
150 | # not really meant for user level execution, disable these two checks. | ||
151 | INSANE_SKIP:${PN} += "ldflags" | ||
152 | INSANE_SKIP:${PN} += "already-stripped" | ||
153 | |||
161 | SECURITY_CFLAGS = "" | 154 | SECURITY_CFLAGS = "" |
162 | COMPATIBLE_HOST:libc-musl = 'null' | 155 | COMPATIBLE_HOST:libc-musl = 'null' |
163 | 156 | ||