[openwrt/openwrt] base-files: mount bpffs at boot

LEDE Commits lede-commits at lists.infradead.org
Fri Jul 31 08:44:01 EDT 2020


dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/217877d046414878126e5c8013162e3b7edc774c

commit 217877d046414878126e5c8013162e3b7edc774c
Author: Tony Ambardar <itugrok at yahoo.com>
AuthorDate: Wed Jul 22 06:28:06 2020 -0700

    base-files: mount bpffs at boot
    
    Explicitly mount the BPF filesystem if available. This is used for pinning
    eBPF programs and maps, making them accessible to other eBPF programs or
    from userspace with the help of libbpf or bpftool.
    
    Signed-off-by: Tony Ambardar <itugrok at yahoo.com>
    [daniel at makrotopia.org: bumped PKG_RELEASE]
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/base-files/Makefile              | 2 +-
 package/base-files/files/etc/init.d/boot | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index d32bae8635..7e0d341705 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=224
+PKG_RELEASE:=225
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot
index 21aecde615..958a67599e 100755
--- a/package/base-files/files/etc/init.d/boot
+++ b/package/base-files/files/etc/init.d/boot
@@ -35,6 +35,7 @@ boot() {
 	touch /tmp/resolv.conf.d/resolv.conf.auto
 	ln -sf /tmp/resolv.conf.d/resolv.conf.auto /tmp/resolv.conf
 	grep -q debugfs /proc/filesystems && /bin/mount -o noatime -t debugfs debugfs /sys/kernel/debug
+	grep -q bpf /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime,mode=0700 -t bpf bpffs /sys/fs/bpf
 	[ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
 
 	/sbin/kmodloader



More information about the lede-commits mailing list