lte_ue_entrypoint.sh 1.73 KB
Newer Older
1 2
#!/bin/bash

3
set -uo pipefail
4 5

PREFIX=/opt/oai-lte-ue
6
USIM_CONFIGFILE=$PREFIX/etc/ue_usim.conf
7

8 9 10
echo "=================================="
echo "/proc/sys/kernel/core_pattern=$(cat /proc/sys/kernel/core_pattern)"

11 12
if [ ! -f $USIM_CONFIGFILE ]; then
  echo "No ue_usim.conf configuration file found: please mount at $USIM_CONFIGFILE"
13 14 15 16
  exit 255
fi

echo "=================================="
17 18
echo "== USIM Configuration file:"
cat $USIM_CONFIGFILE
19 20 21 22

#now generate USIM files
# At this point all operations will be run from $PREFIX!
cd $PREFIX
23 24 25 26 27 28 29 30 31 32 33
$PREFIX/bin/conf2uedata -c $USIM_CONFIGFILE -o $PREFIX

CONFIGFILE=$PREFIX/etc/ue.conf

if [ ! -f $CONFIGFILE ]; then
  echo "No ue.conf configuration file found"
else
  echo "=================================="
  echo "== UE Configuration file:"
  cat $CONFIGFILE
fi
34 35

# Load the USRP binaries
36 37
echo "=================================="
echo "== Load USRP binaries"
38
if [[ -v USE_B2XX ]]; then
39
    $PREFIX/bin/uhd_images_downloader.py -t b2xx
40
elif [[ -v USE_X3XX ]]; then
41
    $PREFIX/bin/uhd_images_downloader.py -t x3xx
42
elif [[ -v USE_N3XX ]]; then
43
    $PREFIX/bin/uhd_images_downloader.py -t n3xx
44 45 46 47 48 49 50 51
fi

# in case we have conf file, append
new_args=()
while [[ $# -gt 0 ]]; do
  new_args+=("$1")
  shift
done
Robert Schmidt's avatar
fixup  
Robert Schmidt committed
52
if [[ -f "$CONFIGFILE"  ]]; then
53
  new_args+=("-O")
54
  new_args+=("$CONFIGFILE")
55 56
fi

57
# enable printing of stack traces on assert
58
export OAI_GDBSTACKS=1
59

60 61 62 63 64 65 66 67 68 69 70 71 72
echo "=================================="
echo "== Starting LTE UE soft modem"
if [[ -v USE_ADDITIONAL_OPTIONS ]]; then
    echo "Additional option(s): ${USE_ADDITIONAL_OPTIONS}"
    for word in ${USE_ADDITIONAL_OPTIONS}; do
        new_args+=("$word")
    done
    echo "${new_args[@]}"
    exec "${new_args[@]}"
else
    echo "${new_args[@]}"
    exec "${new_args[@]}"
fi