base-files: mount bpffs at boot
authorTony Ambardar <itugrok@yahoo.com>
Wed, 22 Jul 2020 13:28:06 +0000 (06:28 -0700)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 31 Jul 2020 12:43:03 +0000 (13:43 +0100)
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@yahoo.com>
[daniel@makrotopia.org: bumped PKG_RELEASE]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/base-files/Makefile
package/base-files/files/etc/init.d/boot

index d32bae8635e2722aeb594e36233e3b631d9cdd6a..7e0d341705f674302574cd9370ef7982b2887351 100644 (file)
@@ -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/
index 21aecde615db7874d5faa76f17bdf0c771c2044e..958a67599e82b536a4e402e71e1563991392136f 100755 (executable)
@@ -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