2 Star 0 Fork 17

JofDiamonds/Kmesh

forked from openEuler/Kmesh 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
kmesh_bpf_env.sh 845 Bytes
一键复制 编辑 原始数据 按行查看 历史
lec-bit 提交于 2023-12-23 20:18 . support compile online image
#!/bin/bash
ROOT_DIR=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
VERSION=$(uname -r | cut -d '.' -f 1,2)
OE_VERSION=$(uname -r | grep -o 'oe[^.]*')
# new bpf helper functions name in the kernel, if there are any new functions
# added in the future, please add them to the list.
helper_name=(
strncpy
strnstr
strnlen
_strncmp
parse_header_msg
get_msg_header_element
)
base_line=`grep -nr "FN(unspec)" $KERNEL_HEADER_LINUX_BPF | awk -F ":" {'print $1'}`
for name in ${helper_name[@]}; do
current_line=`grep -nr "FN($name)" $KERNEL_HEADER_LINUX_BPF | awk -F ":" {'print $1'}`
if [ -n "$current_line" ]; then
helper_id=`expr $current_line - $base_line`
sed -Ei "/$name/s/([0-9]+)[^0-9]*$/$helper_id;/" $ROOT_DIR/depends/include/bpf_helper_defs_ext.h
fi
done
cp $ROOT_DIR/depends/include/bpf_helper_defs_ext.h $ROOT_DIR/bpf/include/
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kwb0523/Kmesh.git
git@gitee.com:kwb0523/Kmesh.git
kwb0523
Kmesh
Kmesh
docs

搜索帮助