From 2cba6f2e0e9b6a53fc90cddd30f668c1d5131923 Mon Sep 17 00:00:00 2001 From: Chenbo Feng Date: Mon, 23 Oct 2017 11:57:59 -0700 Subject: [PATCH] Mount eBPF file system and cgroupv2 root directory Mount the eBPF file system under /sys/fs/bpf to allow netd to pin and retrieve persistent eBPF map object from the file system. It helps the system to maintain a consistent eBPF data store when netd crashed and restart. Mount the cgroupv2 module and use the root folder of it to monitor network statistics through eBPF program attached. Test: eBPF map object show up under /sys/fs/bpf after netd start. Bug: 30950746 Change-Id: Ie475112116603798fe75a75c5a84f4bbe5b942ec --- rootdir/init.rc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rootdir/init.rc b/rootdir/init.rc index 5fa77d8d9..33be5d955 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -218,6 +218,12 @@ on init # This is needed by any process that uses socket tagging. chmod 0644 /dev/xt_qtaguid + mkdir /dev/cg2_bpf + mount cgroup2 cg2_bpf /dev/cg2_bpf + chown root root /dev/cg2_bpf + chmod 0600 /dev/cg2_bpf + mount bpf bpf /sys/fs/bpf + # Create location for fs_mgr to store abbreviated output from filesystem # checker programs. mkdir /dev/fscklogs 0770 root system