diff options
| author | Matteo Croce <mcroce@microsoft.com> | 2021-02-18 16:13:15 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2021-02-27 07:21:29 -0800 |
| commit | e80d14dc55f909a60d4bee810c0b9b0377bbf59e (patch) | |
| tree | cedfec259364927cac40c1be4f4c1cfa9c533151 | |
| parent | 6eecd37b8c88741ead46ba571887b064c7aea2ad (diff) | |
| download | meta-openembedded-e80d14dc55f909a60d4bee810c0b9b0377bbf59e.tar.gz | |
recipes-kernel: add libbpf
Add a recipe to build libbpf from https://github.com/libbpf/libbpf
The only patch fixes a build issue, and it's already merged upstream.
Signed-off-by: Matteo Croce <mcroce@microsoft.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-kernel/libbpf/libbpf/0001-install-don-t-preserve-file-owner.patch | 31 | ||||
| -rw-r--r-- | meta-oe/recipes-kernel/libbpf/libbpf_0.3.bb | 44 |
2 files changed, 75 insertions, 0 deletions
diff --git a/meta-oe/recipes-kernel/libbpf/libbpf/0001-install-don-t-preserve-file-owner.patch b/meta-oe/recipes-kernel/libbpf/libbpf/0001-install-don-t-preserve-file-owner.patch new file mode 100644 index 0000000000..9423141962 --- /dev/null +++ b/meta-oe/recipes-kernel/libbpf/libbpf/0001-install-don-t-preserve-file-owner.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From 7df10d91db6f533cc0f6c09f4ae8ad92918c6160 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Matteo Croce <mcroce@microsoft.com> | ||
| 3 | Date: Tue, 26 Jan 2021 12:41:47 +0100 | ||
| 4 | Subject: [PATCH] install: don't preserve file owner | ||
| 5 | |||
| 6 | 'cp -p' preserve file ownership, this may leave files owned by the | ||
| 7 | current in user in /lib . | ||
| 8 | |||
| 9 | Upstream-status: Submitted (0.4 release) [https://github.com/libbpf/libbpf/commit/767d82caab7e54238f2fc6f40ab1e4af285f2abe] | ||
| 10 | |||
| 11 | Signed-off-by: Matteo Croce <mcroce@microsoft.com> | ||
| 12 | --- | ||
| 13 | Makefile | 2 +- | ||
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/Makefile b/Makefile | ||
| 17 | index da33613..ab66edc 100644 | ||
| 18 | --- a/Makefile | ||
| 19 | +++ b/Makefile | ||
| 20 | @@ -130,7 +130,7 @@ define do_s_install | ||
| 21 | $(Q)if [ ! -d '$(DESTDIR)$2' ]; then \ | ||
| 22 | $(INSTALL) -d -m 755 '$(DESTDIR)$2'; \ | ||
| 23 | fi; | ||
| 24 | - $(Q)cp -fpR $1 '$(DESTDIR)$2' | ||
| 25 | + $(Q)cp -fR $1 '$(DESTDIR)$2' | ||
| 26 | endef | ||
| 27 | |||
| 28 | install: all install_headers install_pkgconfig | ||
| 29 | -- | ||
| 30 | 2.29.2 | ||
| 31 | |||
diff --git a/meta-oe/recipes-kernel/libbpf/libbpf_0.3.bb b/meta-oe/recipes-kernel/libbpf/libbpf_0.3.bb new file mode 100644 index 0000000000..5714ddb612 --- /dev/null +++ b/meta-oe/recipes-kernel/libbpf/libbpf_0.3.bb | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | SUMMARY = "Library for BPF handling" | ||
| 2 | DESCRIPTION = "Library for BPF handling" | ||
| 3 | HOMEPAGE = "https://github.com/libbpf/libbpf" | ||
| 4 | SECTION = "libs" | ||
| 5 | LICENSE = "LGPLv2.1+" | ||
| 6 | |||
| 7 | # There is a typo in the filename, LPGL should really be LGPL. | ||
| 8 | # Keep this until the correct name is set upstream. | ||
| 9 | LIC_FILES_CHKSUM = "file://../LICENSE.LPGL-2.1;md5=b370887980db5dd40659b50909238dbd" | ||
| 10 | |||
| 11 | DEPENDS = "zlib elfutils" | ||
| 12 | |||
| 13 | SRC_URI = "git://github.com/libbpf/libbpf.git;protocol=https" | ||
| 14 | SRCREV = "051a4009f94d5633a8f734ca4235f0a78ee90469" | ||
| 15 | |||
| 16 | # Backported from version 0.4 | ||
| 17 | SRC_URI += "file://0001-install-don-t-preserve-file-owner.patch" | ||
| 18 | |||
| 19 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 20 | COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64).*-linux" | ||
| 21 | |||
| 22 | S = "${WORKDIR}/git/src" | ||
| 23 | |||
| 24 | EXTRA_OEMAKE += "DESTDIR=${D} LIBDIR=${libdir}" | ||
| 25 | |||
| 26 | do_compile() { | ||
| 27 | if grep -q "CONFIG_BPF_SYSCALL=y" ${STAGING_KERNEL_BUILDDIR}/.config | ||
| 28 | then | ||
| 29 | oe_runmake | ||
| 30 | else | ||
| 31 | bbnote "BFP syscall is not enabled" | ||
| 32 | fi | ||
| 33 | } | ||
| 34 | |||
| 35 | do_install() { | ||
| 36 | if grep -q "CONFIG_BPF_SYSCALL=y" ${STAGING_KERNEL_BUILDDIR}/.config | ||
| 37 | then | ||
| 38 | oe_runmake install | ||
| 39 | else | ||
| 40 | bbnote "no files to install" | ||
| 41 | fi | ||
| 42 | } | ||
| 43 | |||
| 44 | BBCLASSEXTEND = "native" | ||
