Commit 465800ae authored by wangyongshou's avatar wangyongshou

add config_upf

parent d2ac6c9a
......@@ -33,6 +33,18 @@ function pre_create(){
if [ ! -d $UPFINSTALL/scripts ] ; then
sudo mkdir -p $UPFINSTALL/scripts
fi
if [ ! -d $UPFINSTALL/tools ] ; then
sudo mkdir -p $UPFINSTALL/tools
cp -f /sbin/ethtool $UPFINSTALL/tools
fi
}
function config_file(){
cp $configure/template/* $UPFINSTALL/etc
}
function pre_install(){
......@@ -212,6 +224,7 @@ function main() {
;;
--all-dp)
pre_create
config_file
make_n4_package
make_vpp_package debug
shift;
......@@ -227,6 +240,7 @@ function main() {
shift;
;;
--n4-dp | --vpp-debug-pkg)
config_file
pre_create
make_n4_package
shift;
......
#!/bin/bash
#vpp config
UPF_N3_NAME=""
UPF_N6_NAME=""
UPF_N3_IP=""
UPF_N6_IP=""
UPF_N3_PCI=""
UPF_N6_PCI=""
UPF_N3_GW=""
UPF_N6_GW=""
UPF_CPU=""
#u4 config
UPF_N4_SMF=""
UPF_N4_UPF=""
UPF_N4_LOGSIZE=""
UPF_INTER_IP=""
UPF_INTER_PCI=""
function get_inter_ip(){
INTER_NAME=$1
#RES=$(echo "ifconfig $INTER_NAME |grep inet| sed -n '1p'|awk '{print $2}'")
UPF_INTER_IP=$(echo `ifconfig ${INTER_NAME} | grep inet | sed -n '1p' | awk '{print $2}'`)
}
function get_inter_pci() {
INTER_NAME=$1
UPF_INTER_PCI=$(echo `ethtool -i ${INTER_NAME} | grep "bus-info" | awk '{print $2}'`)
#UPF_INTER_PCI=$(echo ` ./dpdk-devbind.py --status | grep "if=${INTER_NAME}" | awk '{print $1}'`)
}
function generate_instance(){
echo "generate_instance"
#sed s/@N3_GW@/${N3_GW_IP}/ ./startup_debug.conf > /dev/null 2>&1;
}
#read upf.txt
function read_config() {
while read line
do
eval "$line"
done < upf.txt
echo "vpp config"
UPF_N3_NAME=$vpp_n3_name
echo "vpp_n3_name:$UPF_N3_NAME"
UPF_N6_NAME=$vpp_n6_name
echo "vpp_n6_name:$UPF_N6_NAME"
UPF_N3_IP=$vpp_n3_ip
echo "UPF_N3_IP:$UPF_N3_IP"
UPF_N6_IP=$vpp_n6_ip
echo "UPF_N6_IP:$UPF_N6_IP"
UPF_N3_GW=$vpp_n3_gw
echo "vpp_n6_gw:$UPF_N3_GW"
UPF_N6_GW=$vpp_n6_gw
echo "vpp_n6_gw:$UPF_N6_GW"
UPF_CPU=$vpp_cpu
echo "vpp_cpu:$UPF_CPU"
get_inter_pci $UPF_N3_NAME
UPF_N3_PCI=$UPF_INTER_PCI
echo "UPF_N3_PCI:$UPF_N3_PCI"
UPF_INTER_PCI=""
get_inter_pci $UPF_N6_NAME
UPF_N6_PCI=$UPF_INTER_PCI
echo "UPF_N6_PCI:$UPF_N6_PCI"
echo ""
echo "n4 config"
UPF_N4_SMF=$n4_smf
echo "n4_smf:$UPF_N4_SMF"
UPF_N4_UPF=$n4_upf
echo "n4_upf:$UPF_N4_UPF"
UPF_N4_LOGSIZE=$n4_logSize
echo "n4_logSize:$UPF_N4_LOGSIZE"
}
function main() {
read_config
generate_instance
}
main "$@"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment