summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-kernel
diff options
context:
space:
mode:
authorRyan Eatmon <reatmon@ti.com>2024-10-11 09:24:16 -0500
committerArmin Kuster <akuster808@gmail.com>2024-10-15 16:58:29 -0400
commit304585159f81df8def6ec195e4e701a157445dae (patch)
tree3dcd3c3bf191cc7ed4ea52b99fff61080bb95155 /meta-oe/recipes-kernel
parent92db140f5f29d5803d11fa6176fe4d4a6df0d4e0 (diff)
downloadmeta-openembedded-304585159f81df8def6ec195e4e701a157445dae.tar.gz
kernel-selftest: Update to allow for turning on all tests
In testing adding in more kernel-selftests there were a number of issues that arose that require changes that are more appropriate for the main recipe and not a bbappend. 1) Stop looping over TEST_LIST ourselves and use the TARGETS="" provided by the kernel-sefltest Makefiles. This correctly sets up various variables that the selftest Makefiles all need. Also, do_install becomes cleaner because the main Makefile already installs the list of tests and the top level script. 2) Add DEBUG_PREFIX_MAP to the CC setting to avoid some "buildpaths" QA errors. 3) Add two INSANE_SKIPS for "already-stripped" and "ldflags". Some of the selftest Makefiles are adding flags to their compiles that basically break the above checks. Since these compiles are not really meant as user level tools and instead testing, it should be ok to just always set INSANE_SKIP for these two. Signed-off-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-kernel')
-rw-r--r--meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb26
1 files changed, 10 insertions, 16 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..a070ceab55 100644
--- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
+++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
@@ -55,7 +55,7 @@ TEST_LIST = "\
55EXTRA_OEMAKE = '\ 55EXTRA_OEMAKE = '\
56 CROSS_COMPILE=${TARGET_PREFIX} \ 56 CROSS_COMPILE=${TARGET_PREFIX} \
57 ARCH=${ARCH} \ 57 ARCH=${ARCH} \
58 CC="${CC}" \ 58 CC="${CC} ${DEBUG_PREFIX_MAP}" \
59 AR="${AR}" \ 59 AR="${AR}" \
60 LD="${LD}" \ 60 LD="${LD}" \
61 CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \ 61 CLANG="clang -fno-stack-protector -target ${TARGET_ARCH} ${TOOLCHAIN_OPTIONS} -isystem ${S} -D__WORDSIZE=\'64\' -Wno-error=unused-command-line-argument" \
@@ -96,25 +96,13 @@ 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 96 sed -i -e '/mrecord-mcount/d' ${S}/Makefile
97 sed -i -e '/Wno-alloc-size-larger-than/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}/scripts/Makefile.* 98 sed -i -e '/Wno-alloc-size-larger-than/d' ${S}/scripts/Makefile.*
99 for i in ${TEST_LIST} 99 oe_runmake -C ${S}/tools/testing/selftests TARGETS="${TEST_LIST}"
100 do
101 oe_runmake -C ${S}/tools/testing/selftests/${i}
102 done
103} 100}
104 101
105do_install() { 102do_install() {
106 for i in ${TEST_LIST} 103 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 104 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 105 sed -i -e '1s,#!.*python3,#! /usr/bin/env python3,' ${D}/usr/kernel-selftest/bpf/test_offload.py
118 fi 106 fi
119 chown root:root -R ${D}/usr/kernel-selftest 107 chown root:root -R ${D}/usr/kernel-selftest
120} 108}
@@ -158,6 +146,12 @@ RDEPENDS:${PN} += "python3 perl perl-module-io-handle"
158 146
159INSANE_SKIP:${PN} += "libdir" 147INSANE_SKIP:${PN} += "libdir"
160 148
149# A few of the selftests set compile flags that trip up the "ldflags" and
150# "already-stripped" QA checks. As this is mainly a testing package and
151# not really meant for user level execution, disable these two checks.
152INSANE_SKIP:${PN} += "ldflags"
153INSANE_SKIP:${PN} += "already-stripped"
154
161SECURITY_CFLAGS = "" 155SECURITY_CFLAGS = ""
162COMPATIBLE_HOST:libc-musl = 'null' 156COMPATIBLE_HOST:libc-musl = 'null'
163 157