[oe] [meta-oe][PATCH v3 1/1] kernel-selftest: add support for musllibc and perfect the recipe

Khem Raj raj.khem at gmail.com
Mon Jul 23 20:36:39 UTC 2018


please squash it into prior commit and send
a single commit.
On Mon, Jul 23, 2018 at 3:08 AM Hongzhi.Song <hongzhi.song at windriver.com> wrote:
>
> 1. Add support for musllibc
> 2. Use PACKAGECONFIG to add dependency
>
> Signed-off-by: Hongzhi.Song <hongzhi.song at windriver.com>
> ---
>  .../kernel-selftest/kernel-selftest.bb             | 30 ++++++++--------------
>  ...bpf-test_progs.c-add-support-for-musllibc.patch | 25 ++++++++++++++++++
>  2 files changed, 35 insertions(+), 20 deletions(-)
>  create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-bpf-test_progs.c-add-support-for-musllibc.patch
>
> diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
> index 2c23b26b5..71e3bf9b0 100644
> --- a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
> +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb
> @@ -5,27 +5,17 @@ LICENSE = "GPLv2"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7 \
>  "
>
> -# vm
> -SRC_URI += "file://COPYING \
> -"
> +# for musl libc
>  SRC_URI_libc-musl += "file://userfaultfd.patch \
> +                      file://0001-bpf-test_progs.c-add-support-for-musllibc.patch \
>  "
>
> -# for bpf and vm
> -DEPENDS = " \
> -    elfutils \
> -    libcap \
> -    libcap-ng \
> -    fuse \
> -    util-linux \
> -    rsync-native \
> -"
> -# for vm
> -RDEPENDS_${PN} += "libgcc \
> -                   bash \
> -"
> +PACKAGECONFIG ??= "bpf vm"
> +
> +PACKAGECONFIG[bpf] = ",,elfutils libcap libcap-ng rsync-native,"
> +PACKAGECONFIG[vm] = ",,,libgcc bash"
>
> -do_configure[depends] += "virtual/kernel:do_shared_workdir"
> +do_patch[depends] += "virtual/kernel:do_shared_workdir"
>
>  inherit linux-kernel-base kernel-arch
>
> @@ -69,10 +59,10 @@ do_compile() {
>  do_install() {
>      for i in ${TEST_LIST}
>      do
> -        oe_runmake -C ${S}/tools/testing/selftests/${i} INSTALL_PATH=${D}/opt/kselftest/${i} install
> +        oe_runmake -C ${S}/tools/testing/selftests/${i} INSTALL_PATH=${D}/usr/kernel-selftest/${i} install
>      done
>
> -    chown root:root  -R ${D}/opt/kselftest
> +    chown root:root  -R ${D}/usr/kernel-selftest
>  }
>
>  do_configure() {
> @@ -101,4 +91,4 @@ remove_clang_related() {
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
>
>  INHIBIT_PACKAGE_DEBUG_SPLIT="1"
> -FILES_${PN} += "/opt/kselftest/"
> +FILES_${PN} += "/usr/kernel-selftest"
> diff --git a/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-bpf-test_progs.c-add-support-for-musllibc.patch b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-bpf-test_progs.c-add-support-for-musllibc.patch
> new file mode 100644
> index 000000000..5f2542681
> --- /dev/null
> +++ b/meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-bpf-test_progs.c-add-support-for-musllibc.patch
> @@ -0,0 +1,25 @@
> +From a2e6b8fde28b743b69990a4e16c296e099631ed4 Mon Sep 17 00:00:00 2001
> +From: "Hongzhi.Song" <hongzhi.song at windriver.com>
> +Date: Mon, 23 Jul 2018 00:56:19 -0700
> +Subject: [PATCH] bpf: test_progs.c add support for musllibc
> +
> +Signed-off-by: Hongzhi.Song <hongzhi.song at windriver.com>
> +---
> + tools/testing/selftests/bpf/test_progs.c | 1 +
> + 1 file changed, 1 insertion(+)
> +
> +diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
> +index 11ee25c..21b27b7 100644
> +--- a/tools/testing/selftests/bpf/test_progs.c
> ++++ b/tools/testing/selftests/bpf/test_progs.c
> +@@ -4,6 +4,7 @@
> +  * modify it under the terms of version 2 of the GNU General Public
> +  * License as published by the Free Software Foundation.
> +  */
> ++#define __always_inline __inline __attribute__ ((__always_inline__))
> + #include <stdio.h>
> + #include <unistd.h>
> + #include <errno.h>
> +--
> +2.11.0
> +
> --
> 2.11.0
>



More information about the Openembedded-devel mailing list