From 3e3e04cf1f2e9c9a8252a423af05f0af1ffab9d1 Mon Sep 17 00:00:00 2001 From: "lal.harshita" Date: Tue, 1 Dec 2020 14:02:21 +0530 Subject: [PATCH] Install/Un-install scripts for o-du/l2 repo Change-Id: Ia9333ba815f4108b8e6b41ca44f8b41ef6ae4108 Signed-off-by: lal.harshita --- o-du-high/bin/cleanup | 63 ++++++++++++++++++++++++++++++ o-du-high/bin/install | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ o-du-high/bin/uinstall | 47 +++++++++++++++++++++++ 3 files changed, 212 insertions(+) create mode 100755 o-du-high/bin/cleanup create mode 100755 o-du-high/bin/install create mode 100755 o-du-high/bin/uinstall diff --git a/o-du-high/bin/cleanup b/o-du-high/bin/cleanup new file mode 100755 index 00000000..7a47aa60 --- /dev/null +++ b/o-du-high/bin/cleanup @@ -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 index 00000000..b62b9b74 --- /dev/null +++ b/o-du-high/bin/install @@ -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 " + 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 index 00000000..2f151c5a --- /dev/null +++ b/o-du-high/bin/uinstall @@ -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 " + 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 # +################################################################################ -- 2.16.6