Commit d65ecf8c authored by wangyongshou's avatar wangyongshou

integrate upf:vpp pkg

parent 6635b5ef
......@@ -9,8 +9,32 @@ configure="$base/etc"
N4SRC="$base/src/upf-n4/cmd/upf/main"
N4PATH="$base/install/n4"
UPFINSTALL="$base/install/upf"
function pre_create(){
if [ ! -d $VPPINSTALL ] ; then
sudo mkdir -p $VPPINSTALL
fi
if [ ! -d $UPFINSTALL ] ; then
sudo mkdir -p $UPFINSTALL
fi
if [ ! -d $UPFINSTALL/pkg ] ; then
sudo mkdir -p $UPFINSTALL/pkg
fi
if [ ! -d $UPFINSTALL/etc ] ; then
sudo mkdir -p $UPFINSTALL/etc
fi
if [ ! -d $UPFINSTALL/scripts ] ; then
sudo mkdir -p $UPFINSTALL/scripts
fi
}
function pre_install(){
sudo apt-get install sqlite
sudo apt-get install net-tools
......@@ -35,7 +59,7 @@ function vpp(){
}
function make_package()
function make_vpp_package()
{
PKG_NAME="buptvppe.tar.gz"
......@@ -64,29 +88,42 @@ function make_package()
return
fi
#step 2: pkg
cd $VPPPATH
sudo tar -zcvf $PKG_NAME ${BUILD_ROOT}/*.deb > /dev/null 2>&1;
sudo rm -rf $VPPINSTALL
sudo mkdir -p $VPPINSTALL
#vpp_install,tmp
mkdir -p vpp_install
mv ${BUILD_ROOT}/*.deb vpp_install
sudo tar -zcvf $PKG_NAME vpp_install/*.deb > /dev/null 2>&1;
sudo mv $VPPPATH/$PKG_NAME $VPPINSTALL
echo "vpp buptvppe.tar.gz finished!!!"
#clear
rm -rf $VPPPATH/${BUILD_ROOT}/.ccache;
if [ -f $UPFINSTALL/pkg/$PKG_NAME ] ; then
rm -f $UPFINSTALL/pkg/$PKG_NAME
fi
if [ -d $UPFINSTALL/pkg/vpp_install ] ; then
rm -rf $UPFINSTALL/pkg/vpp_install
fi
cp -f $VPPINSTALL/$PKG_NAME $UPFINSTALL/pkg
echo "vpp buptvppe.tar.gz finished!!!"
#clear
find $VPPPATH/${BUILD_ROOT}/ -name '*.c' -type f -print -exec rm -rf {} \ > /dev/null 2>&1;
find $VPPPATH/${BUILD_ROOT}/ -name '*.o' -type f -print -exec rm -rf {} \ > /dev/null 2>&1;
find $VPPPATH/${BUILD_ROOT}/ -name '*.o.cmd' -type f -print -exec rm -rf {} > /dev/null 2>&1 \;
find $VPPPATH/${BUILD_ROOT}/ -name '*.debug' -type f -print -exec rm -rf {} > /dev/null 2>&1 \;
find $VPPPATH/${BUILD_ROOT}/ -name '*.api.json' -type f -print -exec rm -rf {} > /dev/null 2>&1 \;
rm -rf $VPPPATH/${BUILD_ROOT}/.ccache;
rm -rf $VPPPATH/${BUILD_ROOT}/build-test;
rm -rf $VPPPATH/${BUILD_ROOT}/*.deb;
rm -rf $VPPPATH/${BUILD_ROOT}/build-vpp_debug-native;
rm -rf $VPPPATH/${BUILD_ROOT}/install-vpp_debug-native;
rm -rf $VPPPATH/${BUILD_ROOT}/build-vpp-native;
rm -rf $VPPPATH/${BUILD_ROOT}/install-vpp-native;
rm -rf $VPPPATH/${BUILD_ROOT}/install-vpp-native;
}
function n4(){
......@@ -148,12 +185,24 @@ function main() {
vpp
shift
;;
--dp | --debug-pkg)
make_package debug
--vpp-dp | --vpp-debug-pkg)
pre_create
make_vpp_package debug
shift;
;;
--vpp-rp | --vpp-release-pkg)
pre_create
make_vpp_package release
shift;
;;
--n4-dp | --vpp-debug-pkg)
pre_create
make_n4_package debug
shift;
;;
--rp | --release-pkg)
make_package release
--n4-rp | --vpp-release-pkg)
pre_create
make_n4_package release
shift;
;;
--n4)
......
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