Commit 5e4d7475 authored by Lionel Gauthier's avatar Lionel Gauthier

Still under construction may have bugs for eNB and EPC

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6232 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 99b8898b
...@@ -305,6 +305,32 @@ check_install_freediamter(){ ...@@ -305,6 +305,32 @@ check_install_freediamter(){
} }
check_epc_s6a_certificate() {
cnt=0
if [ -d /usr/local/etc/freeDiameter ]
then
if [ -f /usr/local/etc/freeDiameter/user.cert.pem ]
then
full_hostname=`cat /usr/local/etc/freeDiameter/user.cert.pem | grep "Subject" | grep "CN" | cut -d '=' -f6`
if [ a$full_hostname == a`hostname`.${1:-'eur'} ]
then
echo_success "EPC S6A: Found valid certificate in /usr/local/etc/freeDiameter"
return 1
fi
fi
fi
echo_error "EPC S6A: Did not find valid certificate in /usr/local/etc/freeDiameter"
echo_warning "EPC S6A: generatting new certificate in /usr/local/etc/freeDiameter..."
cd $OPENAIRCN_DIR/S6A/freediameter
./make_certs.sh ${1:-'eur'}
if [ $cnt = 0 ] ; then
cnt=1
check_epc_s6a_certificate ${1:-'eur'}
fi
return 1
}
check_s6a_certificate() { check_s6a_certificate() {
cnt=0 cnt=0
if [ -d /usr/local/etc/freeDiameter ]; then if [ -d /usr/local/etc/freeDiameter ]; then
...@@ -661,12 +687,17 @@ compile_epc() { ...@@ -661,12 +687,17 @@ compile_epc() {
if [ ! -n "m4" ]; then if [ ! -n "m4" ]; then
mkdir -m 777 m4 mkdir -m 777 m4
fi fi
bash_exec "autoreconf -i -f"
echo_success "Invoking autogen" echo_success "Invoking autogen"
bash_exec "libtoolize" bash_exec "libtoolize"
bash_exec "./autogen.sh" bash_exec "./autogen.sh"
cd ./$OBJ_DIR cd ./$OBJ_DIR
echo_success "Invoking configure" echo_success "Invoking configure"
../configure --enable-standalone-epc --enable-raw-socket-for-sgi LDFLAGS=-L/usr/local/lib if [ $DEBUG -ne 0 ]; then
../configure --enable-debug --enable-standalone-epc --enable-gtp1u-in-kernel LDFLAGS=-L/usr/local/lib
else
../configure --enable-standalone-epc --enable-gtp1u-in-kernel LDFLAGS=-L/usr/local/lib
fi
else else
cd ./$OBJ_DIR cd ./$OBJ_DIR
fi fi
...@@ -682,12 +713,32 @@ compile_epc() { ...@@ -682,12 +713,32 @@ compile_epc() {
return 1 return 1
else else
cp -f ./OAI_EPC/oai_epc $OPENAIR_TARGETS/bin cp -f ./OAI_EPC/oai_epc $OPENAIR_TARGETS/bin
return 0
fi fi
else else
echo_error "Configure failed, exiting" echo_error "Configure failed, exiting"
return 1 return 1
fi fi
cd $OPENAIRCN_DIR/GTPV1-U/GTPUAH;
make
if [ $? -ne 0 ]; then
echo_error "Build GTPUAH module failed, exiting"
return 1
else
cp -f ./Bin/libxt_*.so /lib/xtables
cp -f ./Bin/*.ko $OPENAIR_TARGETS/bin
fi
cd $OPENAIRCN_DIR/GTPV1-U/GTPURH;
make
if [ $? -ne 0 ]; then
echo_error "Build GTPURH module failed, exiting"
return 1
else
cp -f ./Bin/libxt_*.so /lib/xtables
cp -f ./Bin/*.ko $OPENAIR_TARGETS/bin
fi
return 0
} }
compile_exmimo2_driver() { compile_exmimo2_driver() {
......
...@@ -56,6 +56,7 @@ declare REL="REL8" # REL8, REL10 ...@@ -56,6 +56,7 @@ declare REL="REL8" # REL8, REL10
declare RT="NONE" # RTAI, RT_PREMPT or RT_DISABLED, NONE declare RT="NONE" # RTAI, RT_PREMPT or RT_DISABLED, NONE
declare DEBUG=0 declare DEBUG=0
declare CONFIG_FILE=" " declare CONFIG_FILE=" "
declare CONFIG_FILE_ACCESS_OK=0
declare EXE_ARGUMENTS=" " declare EXE_ARGUMENTS=" "
declare RUN_GDB=0 declare RUN_GDB=0
declare DISABLE_CHECK_INSTALLED_SOFTWARE=0 declare DISABLE_CHECK_INSTALLED_SOFTWARE=0
...@@ -118,10 +119,12 @@ fi ...@@ -118,10 +119,12 @@ fi
if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then
CONFIG_FILE=$(dirname $(readlink -f $0))/$CONFIG_FILE CONFIG_FILE=$(dirname $(readlink -f $0))/$CONFIG_FILE
echo "setting config file to: $CONFIG_FILE" echo "setting config file to: $CONFIG_FILE"
CONFIG_FILE_ACCESS_OK=1
else else
# may be absolute path # may be absolute path
if [ -f $CONFIG_FILE ]; then if [ -f $CONFIG_FILE ]; then
echo "setting config file to: $CONFIG_FILE" echo "setting config file to: $CONFIG_FILE"
CONFIG_FILE_ACCESS_OK=1
else else
echo "config file not found" echo "config file not found"
exit 1 exit 1
...@@ -484,17 +487,16 @@ build_epc(){ ...@@ -484,17 +487,16 @@ build_epc(){
epc_compiled=1 epc_compiled=1
echo_info "Note: this scripts works only for Ubuntu 12.04" echo_info "Note: this scripts tested only on Ubuntu 12.04 x64, 14.04 x64"
###################################### ######################################
# CHECK MISC SOFTWARES AND LIBS # # CHECK MISC SOFTWARES AND LIBS #
###################################### ######################################
echo_info "4. check the required packages for HSS" if [ $DISABLE_CHECK_INSTALLED_SOFTWARE -eq 0 ]; then
echo_info "4. Checking the the required softwares/packages for EPC..."
check_install_epc_software check_install_epc_software
check_install_asn1c check_install_asn1c
if [ $OAI_CLEAN -eq 1 ]; then if [ $OAI_CLEAN -eq 1 ]; then
check_install_freediamter check_install_freediamter
else else
...@@ -502,7 +504,9 @@ build_epc(){ ...@@ -502,7 +504,9 @@ build_epc(){
check_install_freediamter check_install_freediamter
fi fi
fi fi
check_s6a_certificate else
echo_info "4. Not checking the required softwares/packages for EPC"
fi
########################################### ###########################################
# configure and compile # configure and compile
...@@ -512,9 +516,38 @@ build_epc(){ ...@@ -512,9 +516,38 @@ build_epc(){
output=$(compile_epc $OAI_CLEAN >> bin/install_log.txt 2>&1 ) output=$(compile_epc $OAI_CLEAN >> bin/install_log.txt 2>&1 )
epc_compiled=$? epc_compiled=$?
if [ $epc_compiled -ne 0 ]; then
echo_error "EPC compilation failed : check the installation log file bin/install_log.txt"
exit 1
fi
check_for_epc_executable check_for_epc_executable
echo_info "finished epc target: check the installation log file bin/install_log.txt" echo_info "finished epc target: check the installation log file bin/install_log.txt"
if [ $CONFIG_FILE_ACCESS_OK -eq 0 ]; then
echo_error "You have to provide a EPC config file"
exit 1
fi
rm -f /tmp/source.txt
VARIABLES=" S6A_CONF\|\
REALM"
VARIABLES=$(echo $VARIABLES | sed -e 's/\\r//g')
VARIABLES=$(echo $VARIABLES | tr -d ' ')
cat $CONFIG_FILE | grep -w "$VARIABLES"| tr -d " " | tr -d ";" > /tmp/source.txt
source /tmp/source.txt
if [ x"$REALM" == "x" ]; then
echo_error "Your config file do not contain a REALM for S6A configuration"
exit 1
fi
if [ x"$S6A_CONF" != "x./epc_s6a.conf" ]; then
echo_error "Your config file do not contain the good path for the S6A config file,"
echo_error "accordingly to what is done in this script, it should be set to epc_s6a.conf"
exit 1
fi
check_epc_s6a_certificate $REALM
########################################### ###########################################
# install the binary in bin # install the binary in bin
...@@ -525,17 +558,9 @@ build_epc(){ ...@@ -525,17 +558,9 @@ build_epc(){
if [ $epc_compiled -eq 0 ]; then if [ $epc_compiled -eq 0 ]; then
echo_success "target epc built and installed in the bin directory" echo_success "target epc built and installed in the bin directory"
echo "target epc built and installed in the bin directory" >> bin/${oai_build_date} echo "target epc built and installed in the bin directory" >> bin/${oai_build_date}
cp -f $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/epc.generic.conf $OPENAIR_TARGETS/bin cp -f CONFIG_FILE $OPENAIR_TARGETS/bin
cp -f $OPENAIRCN_DIR/objs/UTILS/CONF/s6a.conf $OPENAIR_TARGETS/bin cp -f $OPENAIRCN_DIR/objs/UTILS/CONF/s6a.conf $OPENAIR_TARGETS/bin/epc_s6a.conf
fi fi
######################################
# run
######################################
echo_info "7. run EPC (check the bin/epc.generic.conf params)"
cd bin/
$SUDO ./oai_epc -c ./epc.generic.conf -K /tmp/itti.log
} }
build_hss(){ build_hss(){
...@@ -661,23 +686,42 @@ esac ...@@ -661,23 +686,42 @@ esac
############################################ ############################################
# run # run
############################################ ############################################
echo_info "11. Running ... To be done" echo_info "11. Running ... To be completed"
cd $OPENAIR_TARGETS/bin
if [ $BUILD_LTE == "ENB" ]; then if [ $BUILD_LTE == "ENB" ]; then
if [ $TARGET == "SOFTMODEM" ]; then if [ $TARGET == "SOFTMODEM" ]; then
if [ $HW == "EXMIMO" ]; then if [ $HW == "EXMIMO" ]; then
chmod 777 $OPENAIR_TARGETS/RT/USER/init_exmimo2.sh $SUDO chmod 777 $OPENAIR_TARGETS/RT/USER/init_exmimo2.sh
$OPENAIR_TARGETS/RT/USER/init_exmimo2.sh $SUDO $OPENAIR_TARGETS/RT/USER/init_exmimo2.sh
fi fi
echo "############# running ltesoftmodem #############" echo "############# running ltesoftmodem #############"
if [ $RUN_GDB -eq 0 ]; then if [ $RUN_GDB -eq 0 ]; then
exec $OPENAIR_TARGETS/bin/lte-softmodem `echo $EXE_ARGUMENTS` $SUDO exec $OPENAIR_TARGETS/bin/lte-softmodem `echo $EXE_ARGUMENTS`
else
$SUDO touch ~/.gdb_lte_softmodem
$SUDO echo "file $OPENAIR_TARGETS/bin/lte-softmodem" > ~/.gdb_lte_softmodem
$SUDO echo "set args $EXE_ARGUMENTS" >> ~/.gdb_lte_softmodem
$SUDO echo "run" >> ~/.gdb_lte_softmodem
$SUDO gdb -nh -x ~/.gdb_lte_softmodem 2>&1
fi
fi
else
if [ $BUILD_LTE == "EPC" ]; then
echo "############# running epc #############"
if [ $RUN_GDB -eq 0 ]; then
$SUDO exec $OPENAIR_TARGETS/bin/oai_epc `echo $EXE_ARGUMENTS`
else else
touch ~/.gdb_lte_softmodem $SUDO touch ~/.gdb_epc
echo "file $OPENAIR_TARGETS/bin/lte-softmodem" > ~/.gdb_lte_softmodem $SUDO echo "file $OPENAIR_TARGETS/bin/oai_epc" > ~/.gdb_epc
echo "set args $EXE_ARGUMENTS" >> ~/.gdb_lte_softmodem $SUDO echo "set args $EXE_ARGUMENTS" >> ~/.gdb_epc
echo "run" >> ~/.gdb_lte_softmodem $SUDO echo "run" >> ~/.gdb_epc
gdb -nh -x ~/.gdb_lte_softmodem 2>&1 $SUDO gdb -nh -x ~/.gdb_epc 2>&1
fi fi
echo_info "7. run EPC (check the bin/epc.generic.conf params)"
cd bin/
$SUDO ./oai_epc -c ./epc.generic.conf -K /tmp/itti.log
fi fi
fi fi
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