mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-01-01 13:58:06 +00:00
kernel-selftest: fix various issues
* respect PACKAGECONFIG when setting TEST_LIST
* call the sed in remove_clang_related only when bpf PACKAGECONFIG is
enabled and if ${S}/tools/testing/selftests/bpf/Makefile doesn't exist
then show more useful error message than:
sed: can't read kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf/Makefile: No such file or directory
because kernels older than 4.10 don't have bpf selftest which was
added in:
5aa5bd14c5
* disable ldflags QA errors, the selftests Makefile explicitly overrides
LDFLAGS to empty:
5aa5bd14c5/tools/testing/selftests/Makefile (L46)
and the vm/Makefile doesn't respect LDFLAGS anyway:
5aa5bd14c5/tools/testing/selftests/vm/Makefile (L17)
so it was causing a lot of errors:
ERROR: kernel-selftest-1.0-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/thuge-gen'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/thuge-gen'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/transhuge-stress'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/transhuge-stress'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/userfaultfd'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/userfaultfd'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-shm'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-shm'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/on-fault-limit'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/on-fault-limit'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-mmap'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/hugepage-mmap'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/compaction_test'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/compaction_test'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/mlock2-tests'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/mlock2-tests'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/map_hugetlb'
No GNU_HASH in the elf binary: 'kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/vm/map_hugetlb' [ldflags]
* fix the formatting and useless append
* add dependency on rsync-native as it's used during do_install:
| make: Entering directory 'kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/vm'
| rsync -a run_vmtests compaction_test hugepage-mmap hugepage-shm map_hugetlb mlock2-tests on-fault-limit thuge-gen transhuge-stress userfaultfd kernel-selftest/1.0-r0/image/usr/kernel-selftest/vm/
| /bin/sh: 1: rsync: not found
| ../lib.mk:24: recipe for target 'install' failed
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
This commit is contained in:
parent
408204073e
commit
c96c6a01e4
|
|
@ -2,14 +2,19 @@ SUMMARY = "Kernel selftest for Linux"
|
|||
DESCRIPTION = "Kernel selftest for Linux"
|
||||
LICENSE = "GPLv2"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7 \
|
||||
"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
|
||||
|
||||
DEPENDS = "rsync-native"
|
||||
|
||||
# for musl libc
|
||||
SRC_URI_libc-musl += "file://userfaultfd.patch \
|
||||
file://0001-bpf-test_progs.c-add-support-for-musllibc.patch \
|
||||
"
|
||||
|
||||
# now we just test bpf and vm
|
||||
# we will append other kernel selftest in the future
|
||||
# bpf was added in 4.10 with: https://github.com/torvalds/linux/commit/5aa5bd14c5f8660c64ceedf14a549781be47e53d
|
||||
# if you have older kernel than that you need to remove it from PACKAGECONFIG
|
||||
PACKAGECONFIG ??= "bpf vm"
|
||||
|
||||
PACKAGECONFIG[bpf] = ",,elfutils libcap libcap-ng rsync-native,"
|
||||
|
|
@ -23,10 +28,8 @@ do_populate_lic[depends] += "virtual/kernel:do_patch"
|
|||
|
||||
S = "${WORKDIR}/${BP}"
|
||||
|
||||
# now we just test bpf and vm
|
||||
# we will append other kernel selftest in the future
|
||||
TEST_LIST = "bpf \
|
||||
vm \
|
||||
TEST_LIST = " \
|
||||
${@bb.utils.filter('PACKAGECONFIG', 'bpf vm', d)} \
|
||||
"
|
||||
|
||||
EXTRA_OEMAKE = '\
|
||||
|
|
@ -35,12 +38,9 @@ EXTRA_OEMAKE = '\
|
|||
CC="${CC}" \
|
||||
AR="${AR}" \
|
||||
LD="${LD}" \
|
||||
DESTDIR="${D}" \
|
||||
'
|
||||
|
||||
EXTRA_OEMAKE += "\
|
||||
'DESTDIR=${D}' \
|
||||
"
|
||||
|
||||
KERNEL_SELFTEST_SRC ?= "Makefile \
|
||||
include \
|
||||
tools \
|
||||
|
|
@ -95,10 +95,17 @@ python copy_kselftest_source_from_kernel() {
|
|||
}
|
||||
|
||||
remove_clang_related() {
|
||||
sed -i -e '/test_pkt_access/d' -e '/test_pkt_md_access/d' ${S}/tools/testing/selftests/bpf/Makefile
|
||||
if ${@bb.utils.contains('PACKAGECONFIG','bpf','true','false',d)} ; then
|
||||
test -f ${S}/tools/testing/selftests/bpf/Makefile && \
|
||||
sed -i -e '/test_pkt_access/d' -e '/test_pkt_md_access/d' ${S}/tools/testing/selftests/bpf/Makefile || \
|
||||
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"
|
||||
fi
|
||||
}
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
INHIBIT_PACKAGE_DEBUG_SPLIT="1"
|
||||
FILES_${PN} += "/usr/kernel-selftest"
|
||||
|
||||
# tools/testing/selftests/vm/Makefile doesn't respect LDFLAGS and tools/testing/selftests/Makefile explicitly overrides to empty
|
||||
INSANE_SKIP_${PN} += "ldflags"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user