[oe] [meta-oe][PATCH] kselftest: Add a recipe on kernel selftest
Khem Raj
raj.khem at gmail.com
Tue Jul 10 04:11:55 UTC 2018
This is failing to build here
| DEBUG: Executing shell function do_compile
| NOTE: make -j 16 CROSS_COMPILE=x86_64-bec-linux- ARCH=x86
CC=x86_64-bec-linux-gcc -m64 -march=core2 -mtune=core2 -msse3
-mfpmath=sse -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat
-Wformat-security -Werror=format-security
--sysroot=/mnt/a/oe/build/tmp/work/qemux86_64-bec-linux/kernel-selftest/1.0-r0/recipe-sysroot
AR=x86_64-bec-linux-ar LD=x86_64-bec-linux-ld
--sysroot=/mnt/a/oe/build/tmp/work/qemux86_64-bec-linux/kernel-selftest/1.0-r0/recipe-sysroot
DESTDIR=/mnt/a/oe/build/tmp/work/qemux86_64-bec-linux/kernel-selftest/1.0-r0/image
-C /mnt/a/oe/build/tmp/work/qemux86_64-bec-linux/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf
| make: Entering directory
'/mnt/a/oe/build/tmp/work/qemux86_64-bec-linux/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'
| Makefile:19: *** recipe commences before first target. Stop.
| make: Leaving directory
'/mnt/a/oe/build/tmp/work/qemux86_64-bec-linux/kernel-selftest/1.0-r0/kernel-selftest-1.0/tools/testing/selftests/bpf'
| ERROR: oe_runmake failed
On Sat, Jul 7, 2018 at 11:05 PM Hongzhi.Song <hongzhi.song at windriver.com> wrote:
>
> The recipe builds the framework for kernel-selftest. Now, it just
> contains two sets of testcase, bpf and vm. We are appending others
> to the recipe.
>
> It needs some features which will be written into relevant recipe.
> But now, you should add them to conf/local.conf manually.
> KERNEL_FEATURES_append += "features/bpf/bpf.scc"
>
> Signed-off-by: Dengke Du <dengke.du at windriver.com>
> Signed-off-by: Hongzhi.Song <hongzhi.song at windriver.com>
> ---
> .../recipes-kernel/kselftest/kernel-selftest.bb | 94 ++++++++++++++++++++++
> 1 file changed, 94 insertions(+)
> create mode 100644 meta-oe/recipes-kernel/kselftest/kernel-selftest.bb
>
> diff --git a/meta-oe/recipes-kernel/kselftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kselftest/kernel-selftest.bb
> new file mode 100644
> index 0000000..6f20bd3
> --- /dev/null
> +++ b/meta-oe/recipes-kernel/kselftest/kernel-selftest.bb
> @@ -0,0 +1,94 @@
> +SUMMARY = "Kernel selftest for Linux"
> +DESCRIPTION = "Kernel selftest for Linux"
> +LICENSE = "GPLv2"
> +
> +# for bpf and vm
> +DEPENDS = " \
> + elfutils \
> + libcap \
> + libcap-ng \
> + fuse \
> + util-linux \
> + rsync-native \
> +"
> +# for vm
> +RDEPENDS_${PN} += "libgcc \
> + bash \
> +"
> +
> +do_configure[depends] += "virtual/kernel:do_shared_workdir"
> +
> +inherit linux-kernel-base kernel-arch
> +
> +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 \
> +"
> +
> +EXTRA_OEMAKE = '\
> + CROSS_COMPILE=${TARGET_PREFIX} \
> + ARCH=${ARCH} \
> + CC="${CC}" \
> + AR="${AR}" \
> + LD="${LD}" \
> +'
> +
> +EXTRA_OEMAKE += "\
> + 'DESTDIR=${D}' \
> +"
> +
> +KERNEL_SELFTEST_SRC ?= "Makefile \
> + include \
> + tools \
> + scripts \
> + arch \
> +"
> +
> +do_compile() {
> + for i in ${TEST_LIST}
> + do
> + oe_runmake -C ${S}/tools/testing/selftests/${i}
> + done
> +}
> +
> +do_install() {
> + for i in ${TEST_LIST}
> + do
> + oe_runmake -C ${S}/tools/testing/selftests/${i} INSTALL_PATH=${D}/opt/kselftest/${i} install
> + done
> +
> + chown root:root -R ${D}/opt/kselftest
> +}
> +
> +do_configure() {
> + :
> +}
> +
> +do_configure[prefuncs] += "copy_kselftest_source_from_kernel remove_clang_related"
> +python copy_kselftest_source_from_kernel() {
> + sources = (d.getVar("KERNEL_SELFTEST_SRC") or "").split()
> + src_dir = d.getVar("STAGING_KERNEL_DIR")
> + dest_dir = d.getVar("S")
> + bb.utils.mkdirhier(dest_dir)
> + for s in sources:
> + src = oe.path.join(src_dir, s)
> + dest = oe.path.join(dest_dir, s)
> + if os.path.isdir(src):
> + oe.path.copytree(src, dest)
> + else:
> + bb.utils.copyfile(src, dest)
> +}
> +
> +remove_clang_related() {
> + sed -i -e '/test_pkt_access/d' -e '/test_pkt_md_access/d' ${S}/tools/testing/selftests/bpf/Makefile
> +}
> +
> +PACKAGE_ARCH = "${MACHINE_ARCH}"
> +
> +INHIBIT_PACKAGE_DEBUG_SPLIT="1"
> +FILES_${PN} += "/opt/kselftest/"
> --
> 2.8.1
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
More information about the Openembedded-devel
mailing list