Remove USE_VOLUMED_CONF: all configuration files have to be mounted

This commit is contained in:
Dhanuja Elizabeth Thomas
2023-03-15 17:55:45 +01:00
committed by Robert Schmidt
parent fd4c9227ff
commit 0f0ce9fb02
45 changed files with 58 additions and 188 deletions

View File

@@ -5,14 +5,6 @@ set -uo pipefail
PREFIX=/opt/oai-enb
CONFIGFILE=$PREFIX/etc/enb.conf
if [[ -v USE_VOLUMED_CONF ]]; then
cp $PREFIX/etc/mounted.conf $PREFIX/etc/enb.conf
else
echo "ERROR: No configuration file provided."
echo "Please set USE_VOLUMED_CONF and mount a configuration file at $PREFIX/etc/mounted.conf"
exit 1
fi
if [ ! -f $CONFIGFILE ]; then
echo "No configuration file found: please mount at $CONFIGFILE"
exit 255

View File

@@ -5,14 +5,6 @@ set -uo pipefail
PREFIX=/opt/oai-gnb-aw2s
CONFIGFILE=$PREFIX/etc/gnb.conf
if [[ -v USE_VOLUMED_CONF ]]; then
cp $PREFIX/etc/mounted.conf $PREFIX/etc/gnb.conf
else
echo "ERROR: No configuration file provided."
echo "Please set USE_VOLUMED_CONF and mount a configuration file at $PREFIX/etc/mounted.conf"
exit 1
fi
if [ ! -f $CONFIGFILE ]; then
echo "No configuration file found: please mount at $CONFIGFILE"
exit 255

View File

@@ -5,11 +5,6 @@ set -uo pipefail
PREFIX=/opt/oai-gnb
CONFIGFILE=$PREFIX/etc/gnb.conf
if [[ -v USE_VOLUMED_CONF ]]; then
cp $PREFIX/etc/mounted.conf $PREFIX/etc/gnb.conf
else
echo "Using default configuration"
fi
if [ ! -f $CONFIGFILE ]; then
echo "No configuration file found: please mount at $CONFIGFILE"

View File

@@ -5,15 +5,6 @@ set -uo pipefail
PREFIX=/opt/oai-lte-ru
CONFIGFILE=$PREFIX/etc/rru.conf
# Based another env var, pick one template to use
if [[ -v USE_VOLUMED_CONF ]]; then
cp $PREFIX/etc/rru.fdd.conf $PREFIX/etc/rru.conf
else
echo "ERROR: No configuration file provided."
echo "Please set USE_VOLUMED_CONF and mount a configuration file at $PREFIX/etc/mounted.conf"
exit 1
fi
if [ ! -f $CONFIGFILE ]; then
echo "No configuration file found: please mount at $CONFIGFILE"
exit 255

View File

@@ -14,38 +14,6 @@ echo "=================================="
echo "== Configuration file:"
cat $CONFIGFILE
# Based another env var, pick one template to use
if [[ -v USE_NFAPI ]]; then cp $PREFIX/etc/ue.nfapi.conf $PREFIX/etc/ue.conf; fi
# Only this template will be manipulated and the USIM one!
CONFIG_FILES=`ls $PREFIX/etc/ue.conf $PREFIX/etc/ue_usim.conf || true`
for c in ${CONFIG_FILES}; do
# grep variable names (format: ${VAR}) from template to be rendered
VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
# create sed expressions for substituting each occurrence of ${VAR}
# with the value of the environment variable "VAR"
EXPRESSIONS=""
for v in ${VARS}; do
NEW_VAR=`echo $v | sed -e "s#@##g"`
if [[ "${!NEW_VAR}x" == "x" ]]; then
echo "Error: Environment variable '${NEW_VAR}' is not set." \
"Config file '$(basename $c)' requires all of $VARS."
exit 1
fi
EXPRESSIONS="${EXPRESSIONS};s|${v}|${!NEW_VAR}|g"
done
EXPRESSIONS="${EXPRESSIONS#';'}"
# render template and inline replace config file
sed -i "${EXPRESSIONS}" ${c}
echo "=================================="
echo "== Configuration file: ${c}"
cat ${c}
done
#now generate USIM files
# At this point all operations will be run from $PREFIX!
cd $PREFIX
@@ -68,7 +36,8 @@ while [[ $# -gt 0 ]]; do
new_args+=("$1")
shift
done
if [[ -v USE_NFAPI ]]; then
FILE=$PREFIX/etc/ue.conf
if [[ -f "$FILE" ]]; then
new_args+=("-O")
new_args+=("$PREFIX/etc/ue.conf")
fi

View File

@@ -5,12 +5,6 @@ set -uo pipefail
PREFIX=/opt/oai-nr-ue
CONFIGFILE=$PREFIX/etc/nr-ue.conf
if [[ -v USE_VOLUMED_CONF ]]; then
cp $PREFIX/etc/mounted.conf $PREFIX/etc/nr-ue.conf
else
echo "Using default configuration"
fi
if [ ! -f $CONFIGFILE ]; then
echo "No configuration file found: please mount at $CONFIGFILE"
exit 255