blob: b62b9b74fe774f19d98bf144821eeaf12bdad115 [file] [log] [blame]
lal.harshita3e3e04c2020-12-01 14:02:21 +05301################################################################################
2# Copyright (c) [2020] [Radisys] #
3# #
4# Licensed under the Apache License, Version 2.0 (the "License"); #
5# you may not use this file except in compliance with the License. #
6# You may obtain a copy of the License at #
7# #
8# http://www.apache.org/licenses/LICENSE-2.0 #
9# #
10# Unless required by applicable law or agreed to in writing, software #
11# distributed under the License is distributed on an "AS IS" BASIS, #
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
13# See the License for the specific language governing permissions and #
14# limitations under the License. #
15################################################################################
16# This script is used to setup environment and install O-DU High
17#!/bin/bash
18
19if [[ $# -eq 0 ]] ; then
20 echo "ERROR : Missing input to the script"
21 echo "Required : ./install <O-DU_High_Directory_Path_To_Clone_Code>"
22 exit 1
23fi
24
25INSTALL_DIR=$PWD
26CLONE_DIR=$1
27
28echo "***** Installation Start *****"
29
30if [ -f /etc/os-release ]; then
31 . /etc/os-release
32 OS=$ID
33fi
34
35echo "===> Installing GCC"
36if [ $OS == "ubuntu" ] ; then
37 sudo apt-get install -y build-essential
38else
39 sudo yum groups mark install -y Development Tools
40fi
41echo""
42
43echo "===> Installing LKSCTP"
44if [ $OS == "ubuntu" ] ; then
45 sudo apt-get install -y libsctp-dev
46else
47 sudo yum install -y lksctp-tools-devel
48fi
49echo ""
50
51echo "===> Installing PCAP"
52if [ $OS == "ubuntu" ] ; then
53 sudo apt-get install -y libpcap-dev
54else
55 sudo yum install -y libpcap-devel
56fi
57echo ""
58
59echo "===> Installing XTERM"
60if [ $OS == "ubuntu" ] ; then
61 sudo apt-get install -y xterm
62else
63 sudo yum install -y xterm
64fi
65echo ""
66
67echo "***** Installation Complete *****"
68
69echo ""
70echo "***** Cloning O-DU High *****"
71cd $CLONE_DIR
72git clone "https://gerrit.o-ran-sc.org/r/o-du/l2"
73
74echo ""
75cd $CLONE_DIR/l2/build/odu
76echo "***** Building O-DU Binary *****"
77make odu MACHINE=BIT64 MODE=FDD
78echo ""
79echo "***** Building CU Stub Binary *****"
80make cu_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
81echo ""
82echo "***** Building RIC Stub Binary *****"
83make ric_stub NODE=TEST_STUB MACHINE=BIT64 MODE=FDD
84
85echo ""
86echo "***** Assigning IP addresses *****"
87INTERFACE=$(ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//")
88INTERFACE="$(echo -e "${INTERFACE}" | tr -d '[:space:]')"
89ifconfig $INTERFACE:ODU "192.168.130.81"
90ifconfig $INTERFACE:CU_STUB "192.168.130.82"
91ifconfig $INTERFACE:RIC_STUB "192.168.130.80"
92
93xterm -hold -e "cd $CLONE_DIR/l2/bin/cu_stub; ./cu_stub" &
94sleep 2
95xterm -hold -e "cd $CLONE_DIR//l2/bin/ric_stub; ./ric_stub" &
96sleep 2
97xterm -hold -e "cd $CLONE_DIR//l2/bin/odu; ./odu" &
98sleep 2
99
100################################################################################
101# End of file #
102################################################################################