* [PATCH v3] kernel-selftest: Add a recipe on kernel selftest
@ 2018-07-06 9:51 Hongzhi.Song
2018-07-07 12:14 ` Richard Purdie
0 siblings, 1 reply; 4+ messages in thread
From: Hongzhi.Song @ 2018-07-06 9:51 UTC (permalink / raw)
To: openembedded-core
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@windriver.com>
Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
---
.../kernel-selftest/kernel-selftest.bb | 94 ++++++++++++++++++++++
1 file changed, 94 insertions(+)
create mode 100644 meta/recipes-kernel/kernel-selftest/kernel-selftest.bb
diff --git a/meta/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta/recipes-kernel/kernel-selftest/kernel-selftest.bb
new file mode 100644
index 0000000..28fd178
--- /dev/null
+++ b/meta/recipes-kernel/kernel-selftest/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_perf_source_from_kernel remove_clang_related"
+python copy_perf_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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3] kernel-selftest: Add a recipe on kernel selftest
2018-07-06 9:51 [PATCH v3] kernel-selftest: Add a recipe on kernel selftest Hongzhi.Song
@ 2018-07-07 12:14 ` Richard Purdie
2018-07-08 5:36 ` Song, Hongzhi
2018-07-09 1:05 ` Dengke Du
0 siblings, 2 replies; 4+ messages in thread
From: Richard Purdie @ 2018-07-07 12:14 UTC (permalink / raw)
To: Hongzhi.Song, openembedded-core
On Fri, 2018-07-06 at 05:51 -0400, Hongzhi.Song 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@windriver.com>
> Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
> ---
> .../kernel-selftest/kernel-selftest.bb | 94
> ++++++++++++++++++++++
> 1 file changed, 94 insertions(+)
> create mode 100644 meta/recipes-kernel/kernel-selftest/kernel-
> selftest.bb
>
> diff --git a/meta/recipes-kernel/kernel-selftest/kernel-selftest.bb
> b/meta/recipes-kernel/kernel-selftest/kernel-selftest.bb
> new file mode 100644
> index 0000000..28fd178
> --- /dev/null
> +++ b/meta/recipes-kernel/kernel-selftest/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 \
> +"
This adds a DEPENDS on fuse but fuse is not in OE-Core therefore this
recipe can never build there.
+do_configure[prefuncs] += "copy_perf_source_from_kernel remove_clang_related"
+python copy_perf_source_from_kernel() {
We're copying to perf source here? The function name needs tweaking.
Cheers,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] kernel-selftest: Add a recipe on kernel selftest
2018-07-07 12:14 ` Richard Purdie
@ 2018-07-08 5:36 ` Song, Hongzhi
2018-07-09 1:05 ` Dengke Du
1 sibling, 0 replies; 4+ messages in thread
From: Song, Hongzhi @ 2018-07-08 5:36 UTC (permalink / raw)
To: Richard Purdie, openembedded-core
________________________________________
>From: Richard Purdie [richard.purdie@linuxfoundation.org]
>Sent: Saturday, July 07, 2018 20:14
>To: Song, Hongzhi; openembedded-core@lists.openembedded.org
>Subject: Re: [OE-core] [PATCH v3] kernel-selftest: Add a recipe on kernel selftest
>On Fri, 2018-07-06 at 05:51 -0400, Hongzhi.Song 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@windriver.com>
>> Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
>> ---
>> .../kernel-selftest/kernel-selftest.bb | 94
>> ++++++++++++++++++++++
>> 1 file changed, 94 insertions(+)
>> create mode 100644 meta/recipes-kernel/kernel-selftest/kernel-
>> selftest.bb
>>
>> diff --git a/meta/recipes-kernel/kernel-selftest/kernel-selftest.bb
>> b/meta/recipes-kernel/kernel-selftest/kernel-selftest.bb
>> new file mode 100644
>> index 0000000..28fd178
>> --- /dev/null
>> +++ b/meta/recipes-kernel/kernel-selftest/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 \
>> +"
> This adds a DEPENDS on fuse but fuse is not in OE-Core therefore this
> recipe can never build there.
Considering other kernel-selftest will depend more recipes probably not existing
in oe-core. So how do you think about that move the recipe to meta-oe.
Best Regards,
-- Hongzhi
> +do_configure[prefuncs] += "copy_perf_source_from_kernel remove_clang_related"
> +python copy_perf_source_from_kernel() {
> We're copying to perf source here? The function name needs tweaking.
> Cheers,
> Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] kernel-selftest: Add a recipe on kernel selftest
2018-07-07 12:14 ` Richard Purdie
2018-07-08 5:36 ` Song, Hongzhi
@ 2018-07-09 1:05 ` Dengke Du
1 sibling, 0 replies; 4+ messages in thread
From: Dengke Du @ 2018-07-09 1:05 UTC (permalink / raw)
To: Richard Purdie, Hongzhi.Song, openembedded-core
On 2018年07月07日 20:14, Richard Purdie wrote:
> On Fri, 2018-07-06 at 05:51 -0400, Hongzhi.Song 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@windriver.com>
>> Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
>> ---
>> .../kernel-selftest/kernel-selftest.bb | 94
>> ++++++++++++++++++++++
>> 1 file changed, 94 insertions(+)
>> create mode 100644 meta/recipes-kernel/kernel-selftest/kernel-
>> selftest.bb
>>
>> diff --git a/meta/recipes-kernel/kernel-selftest/kernel-selftest.bb
>> b/meta/recipes-kernel/kernel-selftest/kernel-selftest.bb
>> new file mode 100644
>> index 0000000..28fd178
>> --- /dev/null
>> +++ b/meta/recipes-kernel/kernel-selftest/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 \
>> +"
> This adds a DEPENDS on fuse but fuse is not in OE-Core therefore this
> recipe can never build there.
>
> +do_configure[prefuncs] += "copy_perf_source_from_kernel remove_clang_related"
> +python copy_perf_source_from_kernel() {
>
> We're copying to perf source here? The function name needs tweaking.
This recipe was similar to perf, using the kernel source, so based on
perf recipe, we will change it in next patches set.
>
> Cheers,
>
> Richard
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-09 1:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-06 9:51 [PATCH v3] kernel-selftest: Add a recipe on kernel selftest Hongzhi.Song
2018-07-07 12:14 ` Richard Purdie
2018-07-08 5:36 ` Song, Hongzhi
2018-07-09 1:05 ` Dengke Du
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.