anchor.diff:  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,"
  
positive.code:     CC="${CC}" \
      AR="${AR}" \
      LD="${LD}" \
  '
  
  EXTRA_OEMAKE += "\
      'DESTDIR=${D}' \
  "
  
  KERNEL_SELFTEST_SRC ?= "Makefile \
                          include \
  
negative.code: }
  
  remove_clang_related() {
      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"
  