Commit 3e69b6db authored by wangyongshou's avatar wangyongshou

add run upf function

parent a958c891
unix {
nodaemon
#nodaemon
log /var/log/upf/vpp/vpp.log
full-coredump
interactive
#interactive
gid vpp
cli-listen /run/vpp/cli.sock
logsize 100
......
......@@ -50,9 +50,9 @@ function pre_create(){
function config_file(){
#scripts
cp -f $current/config_upf.sh $UPFINSTALL/scripts
cp -f $current/dpdk-devbind.py $UPFINSTALL/scripts
cp -f $current/install_upf.sh $UPFINSTALL/scripts
cp -f $current/run_upf.sh $UPFINSTALL/scripts
cp -f $current/new_run_upf.sh $UPFINSTALL/scripts
#etc
cp -f $configure/template/n4_config.yaml $UPFINSTALL/etc
......@@ -61,6 +61,7 @@ function config_file(){
#tools
cp -f /sbin/ethtool $UPFINSTALL/tools
cp -f $base/plugin/interreput $UPFINSTALL/tools
}
function make_pkg(){
......@@ -216,8 +217,8 @@ function help()
echo "--pre_install Pre-installation of dependencies required by UPF"
echo "--vpp Build vpp"
echo "--n4 Build N4"
echo "--c Remove files generated by previous compilation \n"
echo "--all-dp Build n4 and vppe,make pkg"
echo "--c Remove files generated by previous compilation"
echo "--upf-dp Build n4 and vppe,make pkg"
echo "--vppe-dp Build vppe, make pkg"
echo "--vppe-rp Release vppe, make pkg"
echo "--n4-dp Build n4, make pkg"
......@@ -247,7 +248,7 @@ function main() {
vpp
shift
;;
--all-dp)
--upf-dp)
pre_create
config_file
make_n4_package
......@@ -255,13 +256,13 @@ function main() {
make_pkg
shift;
;;
--vpp-dp | --vpp-debug-pkg)
--vppe-dp | --vpp-debug-pkg)
pre_create
config_file
make_vpp_package debug
shift;
;;
--vpp-rp | --vpp-release-pkg)
--vppe-rp | --vpp-release-pkg)
pre_create
config_file
make_vpp_package release
......@@ -281,6 +282,12 @@ function main() {
clear_all
shift
;;
*)
help
exit 0
shift
;;
esac
done
exit 0
......
......@@ -10,7 +10,8 @@
current="$PWD"
base=$(dirname "$PWD")
ROOT_PATH=/opt/5gc/test
VPP_PRO="vpp"
N4_PRO="main"
function pre_install()
{
if [ ! -d $ROOT_PATH ] ; then
......@@ -68,11 +69,31 @@ function install_bupt_vppe ()
return 0
}
function close_upf()
{
pid=$(pidof $VPP_PRO)
if test -z "$pid"; then
echo "vpp $pid is not startup"
else
echo "kill vpp $pid"
kill -9 ${pid}
fi
pid=$(pidof $N4_PRO)
if test -z "$pid"; then
echo "n4 $pid is not startup"
else
echo "kill n4 $pid"
kill -9 ${pid}
fi
}
function help()
{
echo "help---"
echo "Usage: install_upf [OPTION]..."
echo "--all pkg(bupt_vppe.tar.gz, bupt_n4.tar.gz) install vppe n4"
echo "--upf pkg(bupt_vppe.tar.gz, bupt_n4.tar.gz) install vppe n4"
echo "--vppe pkg(bupt_vppe.tar.gz) install vpp"
echo "--n4 pkg(bupt_n4.tar.gz) install N4"
}
......@@ -86,22 +107,30 @@ function main() {
until [ -z "$1" ]; do
case "$1" in
--all)
--upf)
pre_install
close_upf
install_bupt_n4
install_bupt_vppe
shift
;;
--vpp)
pre_install
close_upf
install_bupt_vppe
shift
;;
--n4)
pre_install
close_upf
install_bupt_n4
shift
;;
*)
help
exit 0
;;
esac
done
exit 0
......
This diff is collapsed.
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