Install/Un-install scripts for o-du/l2 repo 01/5201/9
authorlal.harshita <harshita.lal@radisys.com>
Tue, 1 Dec 2020 08:32:21 +0000 (14:02 +0530)
committerlal.harshita <harshita.lal@radisys.com>
Wed, 16 Dec 2020 07:31:48 +0000 (13:01 +0530)
Change-Id: Ia9333ba815f4108b8e6b41ca44f8b41ef6ae4108
Signed-off-by: lal.harshita <harshita.lal@radisys.com>
o-du-high/bin/cleanup [new file with mode: 0755]
o-du-high/bin/install [new file with mode: 0755]
o-du-high/bin/uinstall [new file with mode: 0755]

diff --git a/o-du-high/bin/cleanup b/o-du-high/bin/cleanup
new file mode 100755 (executable)
index 0000000..7a47aa6
--- /dev/null
@@ -0,0 +1,63 @@
+################################################################################
+#   Copyright (c) [2020] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+# This script is used to clean-up the system environment
+#!/bin/bash
+
+echo "***** Environment Clean-up Start *****"
+
+if [ -f /etc/os-release ]; then
+   . /etc/os-release
+   OS=$ID
+fi
+
+echo "===> Uninstalling GCC"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get remove -y build-essential
+else
+   sudo yum groups mark remove -y "Development Tools"
+fi
+
+echo ""
+echo "===> Uninstalling LKSCTP"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get remove -y libsctp-dev
+else
+   sudo yum remove -y lksctp-tools-devel
+fi
+
+echo ""
+echo "===> Uninstalling PCAP"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get remove -y libpcap-dev
+else
+   sudo yum remove -y libpcap-devel
+fi
+
+echo ""
+echo "===> Uninstalling XTERM"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get remove -y xterm
+else
+   sudo yum remove -y xterm
+fi
+
+echo ""
+echo "***** Environment Clean-up Complete *****"
+
+################################################################################
+#                              End of file                                     #
+################################################################################
+
diff --git a/o-du-high/bin/install b/o-du-high/bin/install
new file mode 100755 (executable)
index 0000000..b62b9b7
--- /dev/null
@@ -0,0 +1,102 @@
+################################################################################
+#   Copyright (c) [2020] [Radisys]                                             #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+# This script is used to setup environment and install O-DU High
+#!/bin/bash
+
+if [[ $# -eq 0 ]] ; then
+    echo "ERROR : Missing input to the script"
+    echo "Required : ./install <O-DU_High_Directory_Path_To_Clone_Code>"
+    exit 1
+fi
+
+INSTALL_DIR=$PWD
+CLONE_DIR=$1
+
+echo "***** Installation Start *****"
+
+if [ -f /etc/os-release ]; then
+   . /etc/os-release
+   OS=$ID
+fi
+
+echo "===> Installing GCC"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get install -y build-essential
+else
+   sudo yum groups mark install -y “Development Tools”
+fi
+echo""
+
+echo "===> Installing LKSCTP"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get install -y libsctp-dev
+else
+   sudo yum install -y lksctp-tools-devel
+fi
+echo ""
+
+echo "===> Installing PCAP"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get install -y libpcap-dev
+else
+   sudo yum install -y libpcap-devel
+fi
+echo ""
+
+echo "===> Installing XTERM"
+if [ $OS == "ubuntu" ] ; then
+   sudo apt-get install -y xterm
+else
+   sudo yum install -y xterm
+fi
+echo ""
+
+echo "***** Installation Complete *****"
+
+echo ""
+echo "***** Cloning O-DU High *****"
+cd $CLONE_DIR
+git clone "https://gerrit.o-ran-sc.org/r/o-du/l2"
+
+echo ""
+cd $CLONE_DIR/l2/build/odu
+echo "***** Building O-DU Binary *****"
+make odu MACHINE=BIT64 MODE=FDD
+echo ""
+echo "***** Building CU Stub Binary *****"
+make cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
+echo ""
+echo "***** Building RIC Stub Binary *****"
+make ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
+
+echo ""
+echo "***** Assigning IP addresses *****"
+INTERFACE=$(ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//")
+INTERFACE="$(echo -e "${INTERFACE}" | tr -d '[:space:]')"
+ifconfig $INTERFACE:ODU "192.168.130.81"
+ifconfig $INTERFACE:CU_STUB "192.168.130.82"
+ifconfig $INTERFACE:RIC_STUB "192.168.130.80"
+
+xterm -hold -e "cd $CLONE_DIR/l2/bin/cu_stub; ./cu_stub" &
+sleep 2
+xterm -hold -e "cd $CLONE_DIR//l2/bin/ric_stub; ./ric_stub" &
+sleep 2
+xterm -hold -e "cd $CLONE_DIR//l2/bin/odu; ./odu" &
+sleep 2
+
+################################################################################
+#                              End of file                                     #
+################################################################################
diff --git a/o-du-high/bin/uinstall b/o-du-high/bin/uinstall
new file mode 100755 (executable)
index 0000000..2f151c5
--- /dev/null
@@ -0,0 +1,47 @@
+################################################################################
+#   Copyright (c) [2020] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+# This script is used to uininstall O-DU High
+#!/bin/bash
+
+if [[ $# -eq 0 ]] ; then
+    echo "ERROR : Missing input to the script"
+    echo "Required : ./uinstall <O-DU_High_Directory_Path_To_Delete_Code>"
+    exit 1
+fi
+
+CLONE_DIR=$1
+
+echo "***** Killing O-DU High binaries *****"
+pkill -9 odu
+pkill -9 cu_stub
+pkill -9 ric_stub
+
+echo "***** Remove O-DU High Directory *****"
+rm -r $CLONE_DIR
+
+echo "***** Bringing Down the Interfaces *****"
+INTERFACE=$(ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//")
+INTERFACE="$(echo -e "${INTERFACE}" | tr -d '[:space:]')"
+ifconfig $INTERFACE:ODU down
+ifconfig $INTERFACE:CU_STUB down
+ifconfig $INTERFACE:RIC_STUB down
+
+echo ""
+echo "***** Uninstallation Complete *****"
+
+################################################################################
+#                              End of file                                     #
+################################################################################