Commit 4f24af56 authored by thomasl's avatar thomasl

small fixes

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6826 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 9e0d42a0
......@@ -455,14 +455,6 @@ compile_hss() {
return 1
}
TDB() {
if [ $2 = "USRP" ]; then
echo_info " 8.2 [USRP] "
fi
install_nas_tools() {
cd $1
if [ ! -f .ue.nvram ]; then
......@@ -474,16 +466,7 @@ install_nas_tools() {
echo_success "generate .usim.nvram"
./usim_data --gen
fi
./ue_data --print
./usim_data --print
}
install_nasmesh(){
echo_success "LOAD NASMESH IP DRIVER FOR UE AND eNB"
(cd $OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL && make clean && make)
(cd $OPENAIR2_DIR && make clean && make nasmesh_netlink_address_fix.ko)
$SUDO rmmod nasmesh
$SUDO insmod $OPENAIR2_DIR/NAS/DRIVER/MESH/nasmesh.ko
}
##################################
......@@ -497,31 +480,26 @@ install_nasmesh(){
# arg 5 is database name (oai_db)
create_hss_database(){
EXPECTED_ARGS=5
E_BADARGS=65
MYSQL=`which mysql`
rv=0
if [ $# -ne $EXPECTED_ARGS ]
then
echo_fatal "Usage: $0 dbuser dbpass hssuser hsspass databasename"
rv=1
echo_error "Usage: $0 dbuser dbpass hssuser hsspass databasename"
return 1
fi
# removed %
#Q1="GRANT ALL PRIVILEGES ON *.* TO '$3'@'%' IDENTIFIED BY '$4' WITH GRANT OPTION;"
Q1="GRANT ALL PRIVILEGES ON *.* TO '$3'@'localhost' IDENTIFIED BY '$4' WITH GRANT OPTION;"
Q2="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}"
$MYSQL -u $1 --password=$2 -e "$SQL"
mysql -u $1 --password=$2 -e "${Q1}${Q2}"
if [ $? -ne 0 ]; then
echo_error "$3 permissions failed"
echo_error "$3 permissions creation failed"
echo_error "verify root password for mysql is linux: mysql -u root --password=linux"
echo_error "if not, reset it to "linux" with sudo dpkg-reconfigure mysql-server-5.5"
return 1
else
echo_success "$3 permissions succeeded"
echo_success "$3 permissions creation succeeded"
fi
Q1="CREATE DATABASE IF NOT EXISTS ${BTICK}$5${BTICK};"
SQL="${Q1}"
$MYSQL -u $3 --password=$4 -e "$SQL"
Q3="CREATE DATABASE IF NOT EXISTS $5;"
mysql -u $3 --password=$4 -e "${Q3}"
if [ $? -ne 0 ]; then
echo_error "$5 creation failed"
return 1
......@@ -529,18 +507,13 @@ create_hss_database(){
echo_success "$5 creation succeeded"
fi
# test if tables have been created
mysql -u $3 --password=$4 -e "desc $5.users" > /dev/null 2>&1
if [ $? -eq 1 ]; then
$MYSQL -u $3 --password=$4 $5 < $OPENAIRCN_DIR/OPENAIRHSS/db/oai_db.sql
mysql -u $3 --password=$4 $5 < $OPENAIRCN_DIR/OPENAIRHSS/db/oai_db.sql
if [ $? -ne 0 ]; then
echo_error "$5 tables creation failed"
return 1
else
echo_success "$5 tables creation succeeded"
fi
fi
return 0
}
......
......@@ -35,6 +35,7 @@
################################
# include helper functions
################################
ORIGIN_PATH=$PWD
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/build_helper.bash
......@@ -219,10 +220,10 @@ if [ "$UE" = 1 ] ; then
CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko
compilations \
lte_build_oai usim_data \
usim_data $dbin/usim_data.$REL
usim_data $dbin/usim_data
compilations \
lte_build_oai ue_data \
ue_data $dbin/ue_data.$REL
ue_data $dbin/ue_data
fi
if [ "$SIMUS_PHY" = "1" ] ; then
......@@ -308,21 +309,26 @@ if [ "$INSTALL_SYSTEM_FILES" = "1" ] ;then
echo_info "Copying iptables libraries into system directory: /lib/xtables"
$SUDO ln -s $dbin/libxt_GTPURH_lib.so /lib/xtables/libxt_GTPURH.so
$SUDO ln -s $dbin/libxt_GTPUAH_lib.so /lib/xtables/libxt_GTPUAH.so
fi
# Install config file
###################
if [ "$CONFIG_FILE" != "" ] ; then
# may be relative path
if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then
CONFIG_FILE=$(dirname $(readlink -f $0))/$CONFIG_FILE
fi
if [ -s $CONFIG_FILE ]; then
echo_info "Copy config file in $dbin"
cp $CONFIG_FILE $dbin
else
echo_error "config file not found" fi
fi
dconf=$DIR/conf
mkdir -p $dconf
cp $ORIGIN_PATH/$CONFIG_FILE $dconf || echo_fatal "config file $ORIGIN_PATH/$CONFIG_FILE not found"
# generate USIM data
install_nas_tools $dbin $dconf
# Do HSS
# bash doesn't like space char around = char
sed -e 's/ *= */=/' $OPENAIRCN_DIR/OPENAIRHSS/conf/hss.local.conf > $dconf/hss.local.conf
source $dconf/hss.local.conf
create_hss_database root linux "$MYSQL_user" "$MYSQL_pass" "$MYSQL_db"
fi
# Auto-tests
......@@ -342,32 +348,7 @@ exit 0
# configure and compile
##########################################
echo_info "5. configure and compile epc"
if [ $CONFIG_FILE_ACCESS_OK -eq 0 ]; then
echo_error "You have to provide a EPC config file"
exit 1
else
# Perform some coherency checks
# check HSS_HOSTNAME REALM
fi
######################################
# Check certificates #
######################################
TEMP_FILE=`tempfile`
cat $OPENAIRCN_DIR/OPENAIRHSS/conf/hss_fd.conf | grep -w "Identity" | tr -d " " | tr -d ";" > $TEMP_FILE
cat $OPENAIRCN_DIR/OPENAIRHSS/conf/hss.conf | grep -w "MYSQL_user" | tr -d " " | tr -d ";" >> $TEMP_FILE
cat $OPENAIRCN_DIR/OPENAIRHSS/conf/hss.conf | grep -w "MYSQL_pass" | tr -d " " | tr -d ";" >> $TEMP_FILE
cat $OPENAIRCN_DIR/OPENAIRHSS/conf/hss.conf | grep -w "MYSQL_db" | tr -d " " | tr -d ";" >> $TEMP_FILE
source $TEMP_FILE
rm -f $TEMP_FILE
if [ x"$Identity" == "x" ]; then
echo_error "Your config file do not contain a host identity for S6A configuration"
exit 1
fi
HSS_REALM=$(echo $Identity | sed 's/.*\.//')
HSS_HOSTNAME=${Identity%.$HSS_REALM}
NEW_HOSTNAME=`hostname -s`
......@@ -495,5 +476,3 @@ 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