Commit 081b0783 authored by Navid Nikaein's avatar Navid Nikaein

* additional updates for the OAI build script


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5793 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 3f5c1910
...@@ -7,7 +7,7 @@ build_rtai: ...@@ -7,7 +7,7 @@ build_rtai:
./build_oai.bash -c -b -eRTAI -tSOFTMODEM -m ./build_oai.bash -c -b -eRTAI -tSOFTMODEM -m
build_usrp_rtai: build_usrp_rtai:
./build_oai.bash -c -b -eRTAI -tSOFTMODEM -hUSRP -m ./build_oai.bash -c -b -eRTAI -tSOFTMODEM -wUSRP -m
help: help:
......
...@@ -72,7 +72,7 @@ test_install_package() { ...@@ -72,7 +72,7 @@ test_install_package() {
} || { } || {
echo "$1 is not installed." echo "$1 is not installed."
OAI_INSTALLED=0 OAI_INSTALLED=0
$SUDO apt-get install --assume-yes $1 $SUDO apt-get install --force-yes $1
} }
fi fi
} }
...@@ -668,13 +668,13 @@ install_ltesoftmodem() { ...@@ -668,13 +668,13 @@ install_ltesoftmodem() {
if [ $1 = "RTAI" ]; then if [ $1 = "RTAI" ]; then
if [ ! -f /tmp/init_rt_done.tmp ]; then if [ ! -f /tmp/init_rt_done.tmp ]; then
echo_info " 8.1 Insert RTAI modules" echo_info " 8.1 Insert RTAI modules"
insmod /usr/realtime/modules/rtai_hal.ko > /dev/null 2>&1 $SUDO$ insmod /usr/realtime/modules/rtai_hal.ko > /dev/null 2>&1
insmod /usr/realtime/modules/rtai_sched.ko > /dev/null 2>&1 $SUDO$ insmod /usr/realtime/modules/rtai_sched.ko > /dev/null 2>&1
insmod /usr/realtime/modules/rtai_sem.ko > /dev/null 2>&1 $SUDO$ insmod /usr/realtime/modules/rtai_sem.ko > /dev/null 2>&1
insmod /usr/realtime/modules/rtai_fifos.ko > /dev/null 2>&1 $SUDO$ insmod /usr/realtime/modules/rtai_fifos.ko > /dev/null 2>&1
insmod /usr/realtime/modules/rtai_mbx.ko > /dev/null 2>&1 $SUDO$ insmod /usr/realtime/modules/rtai_mbx.ko > /dev/null 2>&1
touch /tmp/init_rt_done.tmp $SUDO$ touch /tmp/init_rt_done.tmp
chmod 666 /tmp/init_rt_done.tmp $SUDO$ chmod 666 /tmp/init_rt_done.tmp
else else
echo_warning " 8.1 RTAI modules already inserted" echo_warning " 8.1 RTAI modules already inserted"
fi fi
...@@ -689,7 +689,7 @@ install_ltesoftmodem() { ...@@ -689,7 +689,7 @@ install_ltesoftmodem() {
for i in `seq 0 64`; do for i in `seq 0 64`; do
have_rtfX=`ls /dev/ |grep -c rtf$i`; have_rtfX=`ls /dev/ |grep -c rtf$i`;
if [ "$have_rtfX" -eq 0 ] ; then if [ "$have_rtfX" -eq 0 ] ; then
mknod -m 666 /dev/rtf$i c 150 $i; $SUDO$ mknod -m 666 /dev/rtf$i c 150 $i;
fi; fi;
done done
echo_info " 8.3 [EXMIMO] Build lte-softmodemdrivers" echo_info " 8.3 [EXMIMO] Build lte-softmodemdrivers"
...@@ -741,6 +741,26 @@ set_openair_env(){ ...@@ -741,6 +741,26 @@ set_openair_env(){
fi fi
} }
########################################
### print help
######################################
print_help(){
echo_success "Name : build_oai - install and build OAI"
echo_success "Usage: build_oai.bash -b -c -d -eRTAI -m -rREL8 -s -tOAISIM -wEXMIMO -x"
echo_success "-b : enables S1 interface for eNB (default enabled)"
echo_success "-c : enables clean OAI build (default disabled)"
echo_success "-d : enables debug mode (default disabled)"
echo_success "-e : sets realtime mode: RTAI, RT_PREEMPT, RT_DISABLED (default RTAI)"
echo_success "-m : enables build from the makefile (default disabled)"
echo_success "-r : sets the release: REL8, REL10 (default REL8)"
echo_success "-s : enables OAI sanity check (default disabled)"
echo_success "-t : sets the build target: ALL, SOFTMODEM,OAISIM,UNISIM (default ALL)"
echo_success "-w : sets the hardware platform: EXMIMO, USRP, NONE, (default EXMIMO)"
echo_success "-x : enables xforms (default disabled)"
echo_success "-z : sets the default build options"
}
############################### ###############################
## echo and family ## echo and family
############################### ###############################
......
...@@ -53,7 +53,6 @@ REL="REL8" # REL8, REL10 ...@@ -53,7 +53,6 @@ REL="REL8" # REL8, REL10
RT="RTAI" # RTAI, RT_PREMPT or RT_DISABLED RT="RTAI" # RTAI, RT_PREMPT or RT_DISABLED
DEBUG=0 DEBUG=0
ENB_CONFIG_FILE=$OPENAIR_TARGETS/"PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.conf"
OAI_TEST=0 OAI_TEST=0
XFORMS=0 XFORMS=0
...@@ -83,7 +82,7 @@ fi ...@@ -83,7 +82,7 @@ fi
# echo "i is : $i" # echo "i is : $i"
# case $i in # case $i in
while getopts "bcdmsxze:f:h:r:t:" OPTION; do while getopts "bcdmsxzhe:w:r:t:" OPTION; do
case "$OPTION" in case "$OPTION" in
b) b)
ENB_S1=1 ENB_S1=1
...@@ -102,18 +101,14 @@ while getopts "bcdmsxze:f:h:r:t:" OPTION; do ...@@ -102,18 +101,14 @@ while getopts "bcdmsxze:f:h:r:t:" OPTION; do
RT="$OPTARG" RT="$OPTARG"
echo "setting realtime flag to: $RT" echo "setting realtime flag to: $RT"
;; ;;
f)
ENB_CONFIG_FILE="$OPTARG"
echo "setting enb config file path to: $ENB_CONFIG_FILE"
;;
h) h)
HW="$OPTARG" #"${i#*=}" print_help
echo "setting hardware to: $HW" exit -1
;; ;;
m) m)
BUILD_FROM_MAKEFILE=1 BUILD_FROM_MAKEFILE=1
set_build_from_makefile $BUILD_FROM_MAKEFILE set_build_from_makefile $BUILD_FROM_MAKEFILE
echo "setting build from make to: $BUILD_FROM_MAKEFILE" echo "setting a flag to build from makefile to: $BUILD_FROM_MAKEFILE"
;; ;;
r) r)
REL="$OPTARG" REL="$OPTARG"
...@@ -127,6 +122,10 @@ while getopts "bcdmsxze:f:h:r:t:" OPTION; do ...@@ -127,6 +122,10 @@ while getopts "bcdmsxze:f:h:r:t:" OPTION; do
TARGET="$OPTARG" TARGET="$OPTARG"
echo "setting target to: $TARGET" echo "setting target to: $TARGET"
;; ;;
w)
HW="$OPTARG" #"${i#*=}"
echo "setting hardware to: $HW"
;;
x) x)
XFORMS=1 XFORMS=1
echo "setting xforms to: $XFORMS" echo "setting xforms to: $XFORMS"
...@@ -178,10 +177,8 @@ touch bin/${oai_build_date} ...@@ -178,10 +177,8 @@ touch bin/${oai_build_date}
echo_info "2. Process the parameters" echo_info "2. Process the parameters"
echo_info "User-defined Parameters : HW=$HW, TARGET=$TARGET, ENB_S1=$ENB_S1, REL=$REL, RT=$RT, DEBUG=$DEBUG XFORMS=$XFORMS" echo_info "User-defined Parameters : HW=$HW, TARGET=$TARGET, ENB_S1=$ENB_S1, REL=$REL, RT=$RT, DEBUG=$DEBUG XFORMS=$XFORMS"
echo_info "ENB_CONFIG_FILE: $ENB_CONFIG_FILE"
echo "User-defined Parameters : HW=$HW, TARGET=$TARGET, ENB_S1=$ENB_S1, REL=$REL, RT=$RT, DEBUG=$DEBUG XFORMS=$XFORMS" >> bin/${oai_build_date} echo "User-defined Parameters : HW=$HW, TARGET=$TARGET, ENB_S1=$ENB_S1, REL=$REL, RT=$RT, DEBUG=$DEBUG XFORMS=$XFORMS" >> bin/${oai_build_date}
echo "ENB_CONFIG_FILE: $ENB_CONFIG_FILE" >> bin/${oai_build_date}
############################################ ############################################
...@@ -211,12 +208,12 @@ else ...@@ -211,12 +208,12 @@ else
OAISIM_DIRECTIVES="$OAISIM_DIRECTIVES Rel10=1 " OAISIM_DIRECTIVES="$OAISIM_DIRECTIVES Rel10=1 "
fi fi
if [ $RT = "RTAI" ]; then if [ $RT = "RTAI" ]; then
if [ -f /usr/realtime/modules ]; then if [ ! -f /usr/realtime/modules/rtai_hal.ko ]; then
SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES HARD_RT=1 "
else
echo_warning "RTAI doesn't seem to be installed" echo_warning "RTAI doesn't seem to be installed"
RT="RT_PREMPT" RT="RT_PREMPT"
SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES RTAI=0 " SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES RTAI=0 "
else
SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES HARD_RT=1 "
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