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
This commit is contained in:
@@ -56,7 +56,7 @@ check_for_root_rights() {
|
|||||||
|
|
||||||
# if [[ $EUID -ne $ROOT_EUID ]]; then
|
# if [[ $EUID -ne $ROOT_EUID ]]; then
|
||||||
if [ $USER != "root" ]; then
|
if [ $USER != "root" ]; then
|
||||||
SUDO="sudo -E "
|
SUDO="sudo -E "
|
||||||
echo "Run as a sudoers"
|
echo "Run as a sudoers"
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
@@ -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() {
|
|||||||
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() {
|
|||||||
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() {
|
||||||
|
|||||||
+95
-51
@@ -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
|
|||||||
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,25 +487,26 @@ 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
|
||||||
|
check_install_freediamter
|
||||||
if [ $OAI_CLEAN -eq 1 ]; then
|
else
|
||||||
check_install_freediamter
|
if [ ! -d /usr/local/etc/freeDiameter ]; then
|
||||||
else
|
check_install_freediamter
|
||||||
if [ ! -d /usr/local/etc/freeDiameter ]; then
|
fi
|
||||||
check_install_freediamter
|
fi
|
||||||
fi
|
else
|
||||||
|
echo_info "4. Not checking the required softwares/packages for EPC"
|
||||||
fi
|
fi
|
||||||
check_s6a_certificate
|
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# configure and compile
|
# configure and compile
|
||||||
@@ -512,10 +516,39 @@ 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
|
||||||
##########################################
|
##########################################
|
||||||
@@ -523,19 +556,11 @@ build_epc(){
|
|||||||
echo_info "6. install the binary file"
|
echo_info "6. install the binary file"
|
||||||
|
|
||||||
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(){
|
||||||
@@ -613,23 +638,23 @@ build_hss(){
|
|||||||
|
|
||||||
echo_info "3. set the top-level build target"
|
echo_info "3. set the top-level build target"
|
||||||
case "$BUILD_LTE" in
|
case "$BUILD_LTE" in
|
||||||
'ENB')
|
'ENB')
|
||||||
echo_success "build LTE eNB"
|
echo_success "build LTE eNB"
|
||||||
build_enb
|
build_enb
|
||||||
;;
|
;;
|
||||||
'EPC')
|
'EPC')
|
||||||
echo_warning "build EPC(MME and xGW): Experimental"
|
echo_warning "build EPC(MME and xGW): Experimental"
|
||||||
build_epc
|
build_epc
|
||||||
;;
|
;;
|
||||||
'HSS')
|
'HSS')
|
||||||
echo_warning "build HSS: Experimental"
|
echo_warning "build HSS: Experimental"
|
||||||
build_hss
|
build_hss
|
||||||
;;
|
;;
|
||||||
'NONE')
|
'NONE')
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo_error "Unknown option $BUILD_LTE: do not build"
|
echo_error "Unknown option $BUILD_LTE: do not build"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Additional operation
|
# Additional operation
|
||||||
@@ -637,7 +662,7 @@ esac
|
|||||||
############################################
|
############################################
|
||||||
# Generate doxygen documentation
|
# Generate doxygen documentation
|
||||||
############################################
|
############################################
|
||||||
|
|
||||||
if [ $DOXYGEN = 1 ]; then
|
if [ $DOXYGEN = 1 ]; then
|
||||||
echo_info "9. Generate doxygen documentation ..."
|
echo_info "9. Generate doxygen documentation ..."
|
||||||
doxygen $OPENAIR_TARGETS/DOCS/Doxyfile
|
doxygen $OPENAIR_TARGETS/DOCS/Doxyfile
|
||||||
@@ -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
|
else
|
||||||
touch ~/.gdb_lte_softmodem
|
$SUDO touch ~/.gdb_lte_softmodem
|
||||||
echo "file $OPENAIR_TARGETS/bin/lte-softmodem" > ~/.gdb_lte_softmodem
|
$SUDO echo "file $OPENAIR_TARGETS/bin/lte-softmodem" > ~/.gdb_lte_softmodem
|
||||||
echo "set args $EXE_ARGUMENTS" >> ~/.gdb_lte_softmodem
|
$SUDO echo "set args $EXE_ARGUMENTS" >> ~/.gdb_lte_softmodem
|
||||||
echo "run" >> ~/.gdb_lte_softmodem
|
$SUDO echo "run" >> ~/.gdb_lte_softmodem
|
||||||
gdb -nh -x ~/.gdb_lte_softmodem 2>&1
|
$SUDO gdb -nh -x ~/.gdb_lte_softmodem 2>&1
|
||||||
fi
|
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
|
||||||
|
$SUDO touch ~/.gdb_epc
|
||||||
|
$SUDO echo "file $OPENAIR_TARGETS/bin/oai_epc" > ~/.gdb_epc
|
||||||
|
$SUDO echo "set args $EXE_ARGUMENTS" >> ~/.gdb_epc
|
||||||
|
$SUDO echo "run" >> ~/.gdb_epc
|
||||||
|
$SUDO gdb -nh -x ~/.gdb_epc 2>&1
|
||||||
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user