public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Matteo Croce" <mcroce@linux.microsoft.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] recipes-kernel: add libbpf
Date: Mon,  8 Feb 2021 19:17:47 +0100	[thread overview]
Message-ID: <20210208181747.44789-1-mcroce@linux.microsoft.com> (raw)

From: Matteo Croce <mcroce@microsoft.com>

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>
---
 ...01-install-don-t-preserve-file-owner.patch | 29 +++++++++++++++++++
 meta/recipes-kernel/libbpf/libbpf_0.3.bb      | 25 ++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 meta/recipes-kernel/libbpf/libbpf/0001-install-don-t-preserve-file-owner.patch
 create mode 100644 meta/recipes-kernel/libbpf/libbpf_0.3.bb

diff --git a/meta/recipes-kernel/libbpf/libbpf/0001-install-don-t-preserve-file-owner.patch b/meta/recipes-kernel/libbpf/libbpf/0001-install-don-t-preserve-file-owner.patch
new file mode 100644
index 0000000000..4e65d8d80a
--- /dev/null
+++ b/meta/recipes-kernel/libbpf/libbpf/0001-install-don-t-preserve-file-owner.patch
@@ -0,0 +1,29 @@
+From 7df10d91db6f533cc0f6c09f4ae8ad92918c6160 Mon Sep 17 00:00:00 2001
+From: Matteo Croce <mcroce@microsoft.com>
+Date: Tue, 26 Jan 2021 12:41:47 +0100
+Subject: [PATCH] install: don't preserve file owner
+
+'cp -p' preserve file ownership, this may leave files owned by the
+current in user in /lib .
+
+Signed-off-by: Matteo Croce <mcroce@microsoft.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index da33613..ab66edc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -130,7 +130,7 @@ define do_s_install
+ 	$(Q)if [ ! -d '$(DESTDIR)$2' ]; then		\
+ 		$(INSTALL) -d -m 755 '$(DESTDIR)$2';	\
+ 	fi;
+-	$(Q)cp -fpR $1 '$(DESTDIR)$2'
++	$(Q)cp -fR $1 '$(DESTDIR)$2'
+ endef
+ 
+ install: all install_headers install_pkgconfig
+-- 
+2.29.2
+
diff --git a/meta/recipes-kernel/libbpf/libbpf_0.3.bb b/meta/recipes-kernel/libbpf/libbpf_0.3.bb
new file mode 100644
index 0000000000..402e57257f
--- /dev/null
+++ b/meta/recipes-kernel/libbpf/libbpf_0.3.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Library for BPF handling"
+DESCRIPTION = "Library for BPF handling"
+HOMEPAGE = "https://github.com/libbpf/libbpf"
+SECTION = "libs"
+LICENSE = "LGPLv2.1+"
+
+LIC_FILES_CHKSUM = "file://../LICENSE.LPGL-2.1;md5=b370887980db5dd40659b50909238dbd"
+
+DEPENDS = "zlib elfutils"
+
+SRC_URI = "git://github.com/libbpf/libbpf.git;protocol=https"
+SRCREV = "051a4009f94d5633a8f734ca4235f0a78ee90469"
+
+# Backported from version 0.4
+SRC_URI += "file://0001-install-don-t-preserve-file-owner.patch"
+
+S = "${WORKDIR}/git/src"
+
+inherit pkgconfig
+
+do_install() {
+	make install DESTDIR=${D} LIBDIR=${libdir}
+}
+
+BBCLASSEXTEND = "native"
-- 
2.29.2


             reply	other threads:[~2021-02-08 18:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 18:17 Matteo Croce [this message]
2021-02-08 20:13 ` [OE-core] [PATCH] recipes-kernel: add libbpf Bruce Ashfield
2021-02-08 20:24   ` Bruce Ashfield
2021-02-08 21:22   ` Matteo Croce
2021-02-08 21:34     ` Bruce Ashfield
2021-02-09 16:44       ` Khem Raj
2021-02-09 17:02         ` Matteo Croce
2021-02-18  2:31   ` Matteo Croce
2021-02-18  3:51     ` Bruce Ashfield
2021-02-18 23:04       ` Matteo Croce
2021-02-22 16:54         ` Bruce Ashfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210208181747.44789-1-mcroce@linux.microsoft.com \
    --to=mcroce@linux.microsoft.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox