nr_ue_entrypoint.sh 1.25 KB
Newer Older
1 2
#!/bin/bash

3
set -uo pipefail
4 5

PREFIX=/opt/oai-nr-ue
6
CONFIGFILE=$PREFIX/etc/nr-ue.conf
7

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

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

16 17 18
echo "=================================="
echo "== Configuration file:"
cat $CONFIGFILE
19 20

# Load the USRP binaries
21 22
echo "=================================="
echo "== Load USRP binaries"
23
if [[ -v USE_B2XX ]]; then
24
    $PREFIX/bin/uhd_images_downloader.py -t b2xx
25
elif [[ -v USE_X3XX ]]; then
26
    $PREFIX/bin/uhd_images_downloader.py -t x3xx
27
elif [[ -v USE_N3XX ]]; then
28
    $PREFIX/bin/uhd_images_downloader.py -t n3xx
29 30 31 32 33 34 35 36 37
fi

# in case we have conf file, append
new_args=()
while [[ $# -gt 0 ]]; do
  new_args+=("$1")
  shift
done

38
# enable printing of stack traces on assert
39
export OAI_GDBSTACKS=1
40

41 42 43 44 45 46 47 48 49 50 51 52 53
echo "=================================="
echo "== Starting NR 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