Commit 6b21b6ef authored by gauthier's avatar gauthier

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6241 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 64a50686
......@@ -1046,24 +1046,26 @@ set_openair_env(){
print_help(){
echo_success "Name : build_oai - install and build OAI"
echo_success "Usage: build_oai.bash -a -b -c -d -eRTAI -m -rREL8 -s -tOAISIM -wEXMIMO -x"
echo_success "-a | --doxygen : Enable doxygen for documentation (default disabled)"
echo_success "-b | --disable-s1 : Disables S1 interface for eNB (default enabled)"
echo_success "-c | --clean : Enables clean OAI build (default disabled)"
echo_success "-C | --config-file : Set the config file local path"
echo_success "-d | --debug : Enables debug mode (default disabled)"
echo_success "-e | --realtime : Sets realtime mode: RTAI, NONE (default NONE)"
echo_success "-g | --run-with-gdb : Run with gdb"
echo_success "-K | --itti-dump-file : Set the execution events trace file"
echo_success "-l | --build-target : Sets the LTE build target: ENB,EPC,HSS,NONE (default ENB)"
echo_success "-m | --build-from-makefile : Enables build from the makefile (default disabled)"
echo_success "-r | --3gpp-release : Sets the release: REL8, REL10 (default REL8)"
echo_success "-s | --check : Enables OAI testing and sanity check (default disabled)"
echo_success "-t | --enb-build-target : Sets the eNB build target: ALL, SOFTMODEM,OAISIM,UNISIM (default ALL)"
echo_success "-V | --vcd : Log vcd events"
echo_success "-w | --hardware : sets the hardware platform: EXMIMO, USRP (also installs UHD driver), ETHERNET, NONE, (default EXMIMO)"
echo_success "-x | --xforms : enables xforms (default disabled)"
echo_success "-z | --defaults : sets the default build options"
echo_success "Usage: build_oai.bash -a -b -c -d -e RTAI -m -r REL8 -s -t OAISIM -w EXMIMO -x"
echo_success "-a | --doxygen : Enable doxygen for documentation (default disabled)"
echo_success "-b | --disable-s1 : Disable S1 interface for eNB (default enabled)"
echo_success "-c | --clean : Enable clean OAI build (default disabled)"
echo_success "-C | --config-file : Set the config file local path"
echo_success "-d | --debug : Enable debug mode (default disabled)"
echo_success "-D | --disable-check-installed-software : Disable the checking of installed software (default is check)"
echo_success "-e | --realtime : Set realtime mode: RTAI, NONE (default NONE)"
echo_success "-g | --run-with-gdb : Run the executable built by this script with gdb"
echo_success "-K | --itti-dump-file : Set the execution events trace file"
echo_success "-l | --build-target : Set the LTE build target: ENB,EPC,HSS,NONE (default ENB)"
echo_success "-m | --build-from-makefile : Enable build from the makefile (default disabled)"
echo_success "-r | --3gpp-release : Set the release: REL8, REL10 (default REL8)"
echo_success "-R | --run : Run the executable built by this script"
echo_success "-s | --check : Enable OAI testing and sanity check (default disabled)"
echo_success "-t | --enb-build-target : Set the eNB build target: ALL, SOFTMODEM,OAISIM,UNISIM (default ALL)"
echo_success "-V | --vcd : Log vcd events"
echo_success "-w | --hardware : Set the hardware platform: EXMIMO, USRP (also installs UHD driver), ETHERNET, NONE, (default EXMIMO)"
echo_success "-x | --xforms : Enable xforms (default disabled)"
echo_success "-z | --defaults : Set the default build options"
}
###############################
## echo and family
......
......@@ -59,6 +59,7 @@ declare CONFIG_FILE=" "
declare CONFIG_FILE_ACCESS_OK=0
declare EXE_ARGUMENTS=" "
declare RUN_GDB=0
declare RUN=0
declare DISABLE_CHECK_INSTALLED_SOFTWARE=0
declare OAI_CLEAN=0
......@@ -150,6 +151,7 @@ fi
;;
-g | --run-with-gdb)
DEBUG=1
RUN=1
RUN_GDB=1
echo "Running with gdb"
shift;
......@@ -181,6 +183,11 @@ fi
echo "setting release to: $REL"
shift 2 ;
;;
-R | --run)
RUN=1
echo "setting run to $RUN"
shift 2 ;
;;
-s | --check)
OAI_TEST=1
echo "setting sanity check to: $OAI_TEST"
......@@ -558,7 +565,7 @@ build_epc(){
if [ $epc_compiled -eq 0 ]; then
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}
cp -f CONFIG_FILE $OPENAIR_TARGETS/bin
cp -f $CONFIG_FILE $OPENAIR_TARGETS/bin
cp -f $OPENAIRCN_DIR/objs/UTILS/CONF/s6a.conf $OPENAIR_TARGETS/bin/epc_s6a.conf
fi
}
......@@ -686,55 +693,60 @@ esac
############################################
# run
############################################
echo_info "11. Running ... To be completed"
cd $OPENAIR_TARGETS/bin
case "$BUILD_LTE" in
'ENB')
if [ $TARGET == "SOFTMODEM" ]; then
if [ $HW == "EXMIMO" ]; then
$SUDO chmod 777 $OPENAIR_TARGETS/RT/USER/init_exmimo2.sh
$SUDO $OPENAIR_TARGETS/RT/USER/init_exmimo2.sh
fi
echo "############# running ltesoftmodem #############"
if [ $RUN_GDB -eq 0 ]; then
$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
if [ $RUN -ne 0 ]; then
echo_info "11. Running ... To be completed"
cd $OPENAIR_TARGETS/bin
case "$BUILD_LTE" in
'ENB')
if [ $TARGET == "SOFTMODEM" ]; then
if [ $HW == "EXMIMO" ]; then
$SUDO chmod 777 $OPENAIR_TARGETS/RT/USER/init_exmimo2.sh
$SUDO $OPENAIR_TARGETS/RT/USER/init_exmimo2.sh
fi
echo "############# running ltesoftmodem #############"
if [ $RUN_GDB -eq 0 ]; then
$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
fi
;;
;;
'EPC')
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
;;
'EPC')
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
;;
'HSS')
echo_warning "TODO execute HSS: Experimental"
;;
'HSS')
echo_warning "TODO execute HSS: Experimental"
;;
'NONE')
;;
'NONE')
;;
*)
echo_error "Unknown option $BUILD_LTE: do not execute"
;;
esac
*)
echo_error "Unknown option $BUILD_LTE: do not execute"
;;
esac
else
echo_info "11. No run requested, end of script"
exit 0
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