Commit 3c5d6ed7 authored by Lionel Gauthier's avatar Lionel Gauthier

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5666 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 9e1181cf
......@@ -33,25 +33,52 @@
# company Eurecom
# email: lionel.gauthier@eurecom.fr
###########################################
# INPUT PARAMETER FOR THIS SCRIPT: 'rebuild', 'build' or implicit 'start'
# INPUT OF THIS SCRIPT:
# THE DIRECTORY WHERE ARE LOCATED THE CONFIGURATION FILES
#########################################
# This script start a ENB
# The MME is provided to EURECOM by external partner, and should be started by your own.
# This script start ENB
# Depending on configuration files, it can be instanciated a virtual switch
# setting or a VLAN setting for the networking between eNB and MME.
# MME+SP-GW executable have to be launched on the same host by your own (start_epc.bash) before this script is invoked.
# UE executable have to be launched on another host by your own (start_ue.bash) after this script is invoked.
#
###########################################################
# Parameters
###########################################################
declare MAKE_LTE_ACCESS_STRATUM_TARGET_RT="lte-softmodem HARD_RT=1 ENABLE_ITTI=1 USE_MME=R10 LINK_PDCP_TO_GTPV1U=1 DISABLE_XER_PRINT=1 SECU=1 RRC_MSG_PRINT=1 "
declare EMULATION_DEV_INTERFACE="eth1"
declare EMULATION_MULTICAST_GROUP=1
declare MAKE_LTE_ACCESS_STRATUM_TARGET="oaisim DEBUG=1 ENABLE_ITTI=1 USE_MME=R10 LINK_PDCP_TO_GTPV1U=1 NAS=1 Rel10=1 SECU=1 RRC_MSG_PRINT=1"
declare MAKE_LTE_ACCESS_STRATUM_TARGET_RT="lte-softmodem DEBUG=1 RTAI=1 HARD_RT=1 ENABLE_ITTI=1 USE_MME=R10 LINK_PDCP_TO_GTPV1U=1 DISABLE_XER_PRINT=1 SECU=1 RRC_MSG_PRINT=1 "
###########################################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/utils.bash
. $THIS_SCRIPT_PATH/utils.bash
. $THIS_SCRIPT_PATH/interfaces.bash
. $THIS_SCRIPT_PATH/networks.bash
###########################################################
declare -x CONFIG_FILE_DIR=./CONF
if [ $# -eq 1 ]; then
declare -x CONFIG_FILE_DIR=$1
if [ ! -d $CONFIG_FILE_DIR ]; then
echo_error "ERROR while invoking this script, as first argument to this script you have to provide the path to a directory (./CONF/VLAN.VIRTUAL.$HOSTNAME for example) containing valid epc and enb config files"
exit 1
fi
else
echo_error "ERROR while invoking this script, as first argument to this script you have to provide the path to a directory (./CONF/VLAN.VIRTUAL.$HOSTNAME for example) containing valid epc and enb config files"
exit 1
fi
#check_install_epc_software
cd $THIS_SCRIPT_PATH
EMULATION_DEV_ADDRESS=`ifconfig $EMULATION_DEV_INTERFACE | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
#######################################################
# FIND CONFIG FILE
#######################################################
......@@ -86,93 +113,38 @@ declare ENB_IPV4_NETMASK_FOR_S1U=$( echo $ENB_IPV4_ADDRESS_FOR_S1U
ENB_IPV4_ADDRESS_FOR_S1_MME=$( echo $ENB_IPV4_ADDRESS_FOR_S1_MME | cut -f1 -d '/')
ENB_IPV4_ADDRESS_FOR_S1U=$( echo $ENB_IPV4_ADDRESS_FOR_S1U | cut -f1 -d '/')
is_openvswitch_interface $ENB_INTERFACE_NAME_FOR_S1_MME \
$ENB_INTERFACE_NAME_FOR_S1U
if [ $? -eq 1 ]; then
echo_success "Found open-vswitch network configuration"
else
is_vlan_interface $ENB_INTERFACE_NAME_FOR_S1_MME \
$ENB_INTERFACE_NAME_FOR_S1U
if [ $? -eq 1 ]; then
echo_success "Found VLAN network configuration"
clean_enb_vlan_network
build_enb_vlan_network
test_enb_vlan_network
else
is_real_interface $ENB_INTERFACE_NAME_FOR_S1_MME \
$ENB_INTERFACE_NAME_FOR_S1U
if [ $? -eq 1 ]; then
echo_success "Found standart network configuration"
else
echo_error "Cannot find open-vswitch network configuration or VLAN network configuration or standard network configuration"
exit 1
fi
fi
fi
clean() {
cd $OPENAIR_TARGETS/ARCH/EXMIMO/DRIVER/eurecom && make clean || exit 1
cd $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT && make clean || exit 1
make --directory=$OPENAIR_TARGETS/RTAI/USER clean || exit 1
find $OPENAIR_TARGETS/RTAI/USER -name *.a -delete
find $OPENAIR_TARGETS/RTAI/USER -name *.d -delete
find $OPENAIR_TARGETS/RTAI/USER -name *.o -delete
find $OPENAIR_TARGETS/RTAI/USER -name *.ko -delete
}
build() {
cd $OPENAIR_TARGETS/ARCH/EXMIMO/DRIVER/eurecom && make -j`grep -c ^processor /proc/cpuinfo ` || exit 1
cd $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT && make -j`grep -c ^processor /proc/cpuinfo ` || exit 1
make --directory=$OPENAIR_TARGETS/RTAI/USER $MAKE_LTE_ACCESS_STRATUM_TARGET_RT -j`grep -c ^processor /proc/cpuinfo ` || exit 1
make --directory=$OPENAIR_TARGETS/RTAI/USER $MAKE_LTE_ACCESS_STRATUM_TARGET_RT || exit 1
}
##################################################
# process script parameters
##################################################
for arg in "$@"
do
case "$arg" in
rebuild) clean;build
;;
rebuildonly) clean;build; exit 0
;;
build) build
;;
buildonly) build; exit 0
;;
*)
;;
esac
done
##################################################
# LAUNCH eNB
# LAUNCH eNB executable
##################################################
pkill oaisim
pkill tshark
if [ ! -d $THIS_SCRIPT_PATH/OUTPUT ]; then
mkdir -m 777 -p $THIS_SCRIPT_PATH/OUTPUT
if [ ! -d $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME ]; then
mkdir -m 777 -p $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME
fi
if [ x$hard_real_time != "xyes" ]; then
ITTI_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/itti_enb_ue.$HOSTNAME.log
#rotate_log_file $ITTI_LOG_FILE
STDOUT_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/stdout_enb_ue.$HOSTNAME.log
#rotate_log_file $STDOUT_LOG_FILE
#rotate_log_file $STDOUT_LOG_FILE.filtered
ITTI_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/itti_enb_rf.$HOSTNAME.log
rotate_log_file $ITTI_LOG_FILE
PCAP_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/tshark_enb_ue.$HOSTNAME.pcap
#rotate_log_file $PCAP_LOG_FILE
else
ITTI_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/itti_enb_rf.$HOSTNAME.log
#rotate_log_file $ITTI_LOG_FILE
STDOUT_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/stdout_enb_rf.$HOSTNAME.log
rotate_log_file $STDOUT_LOG_FILE
rotate_log_file $STDOUT_LOG_FILE.filtered
STDOUT_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/stdout_enb_rf.$HOSTNAME.log
#rotate_log_file $STDOUT_LOG_FILE
#rotate_log_file $STDOUT_LOG_FILE.filtered
PCAP_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/tshark_enb_rf.$HOSTNAME.pcap
rotate_log_file $PCAP_LOG_FILE
PCAP_LOG_FILE=$THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/tshark_enb_rf.$HOSTNAME.pcap
#rotate_log_file $PCAP_LOG_FILE
fi
cd $THIS_SCRIPT_PATH
......@@ -184,13 +156,25 @@ else
fi
echo_warning "HARD REAL TIME MODE"
PATH=$PATH:/usr/realtime/bin
if [ x$hard_real_time != "xyes" ]; then
echo_warning "USER MODE"
make --directory=$OPENAIR_TARGETS/SIMU/USER $MAKE_LTE_ACCESS_STRATUM_TARGET -j`grep -c ^processor /proc/cpuinfo ` || exit 1
bash_exec "ip route add 239.0.0.160/28 dev $EMULATION_DEV_INTERFACE"
gdb --args $OPENAIR_TARGETS/SIMU/USER/oaisim -a -l9 -u0 -b1 -M0 -p2 -g$EMULATION_MULTICAST_GROUP -D $EMULATION_DEV_ADDRESS -K $ITTI_LOG_FILE --enb-conf $CONFIG_FILE_ENB 2>&1 | tee $STDOUT_LOG_FILE
cd $THIS_SCRIPT_PATH
else
echo_warning "HARD REAL TIME MODE"
PATH=$PATH:/usr/realtime/bin
#make --directory=$OPENAIR_TARGETS/RT/USER drivers || exit 1
# 2 lines below replace the line above
cd $OPENAIR_TARGETS/ARCH/EXMIMO/DRIVER/eurecom && make clean && make || exit 1
cd $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT && make clean && make || exit 1
cd $THIS_SCRIPT_PATH
make --directory=$OPENAIR_TARGETS/RT/USER $MAKE_LTE_ACCESS_STRATUM_TARGET_RT -j`grep -c ^processor /proc/cpuinfo ` || exit 1
if [ ! -f /tmp/init_rt_done.tmp ]; then
if [ ! -f /tmp/init_rt_done.tmp ]; then
echo_warning "STARTING REAL TIME (RTAI)"
insmod /usr/realtime/modules/rtai_hal.ko > /dev/null 2>&1
insmod /usr/realtime/modules/rtai_sched.ko > /dev/null 2>&1
......@@ -199,21 +183,21 @@ if [ ! -f /tmp/init_rt_done.tmp ]; then
insmod /usr/realtime/modules/rtai_mbx.ko > /dev/null 2>&1
touch /tmp/init_rt_done.tmp
chmod 666 /tmp/init_rt_done.tmp
else
else
echo_warning "REAL TIME FOUND STARTED (RTAI)"
fi
cd $OPENAIR_TARGETS/RT/USER
bash ./init_exmimo2.sh
echo_warning "STARTING SOFTMODEM..."
#cat /dev/rtf62 > $STDOUT_LOG_FILE &
gdb --args ./lte-softmodem -K $ITTI_LOG_FILE -V -O $CONFIG_FILE_ENB 2>&1
cd $THIS_SCRIPT_PATH
fi
cd $OPENAIR_TARGETS/RTAI/USER
bash ./init_exmimo2.sh
echo_warning "STARTING SOFTMODEM..."
#cat /dev/rtf62 > $STDOUT_LOG_FILE &
./lte-softmodem -K $ITTI_LOG_FILE -O $CONFIG_FILE_ENB --ulsch-max-errors=20 2>&1
cd $THIS_SCRIPT_PATH
sync
pkill tshark
pkill cat
sync
#cat $STDOUT_LOG_FILE | grep -v '[PHY]' | grep -v '[MAC]' | grep -v '[EMU]' | \
# grep -v '[OCM]' | grep -v '[OMG]' | \
# grep -v 'RLC not configured' | grep -v 'check if serving becomes' | \
# grep -v 'mac_rrc_data_req' | grep -v 'BCCH request =>' > $STDOUT_LOG_FILE.filtered
cat $STDOUT_LOG_FILE | grep -v '[PHY]' | grep -v '[MAC]' | grep -v '[EMU]' | \
grep -v '[OCM]' | grep -v '[OMG]' | \
grep -v 'RLC not configured' | grep -v 'check if serving becomes' | \
grep -v 'mac_rrc_data_req' | grep -v 'BCCH request =>' > $STDOUT_LOG_FILE.filtered
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