Merge branch 'develop' into develop-nr
This commit is contained in:
@@ -32,8 +32,8 @@ OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g")
|
||||
OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g")
|
||||
case "$OS_DISTRO" in
|
||||
fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE="cmake" ;;
|
||||
rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
|
||||
centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
|
||||
rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum --skip-broken"; CMAKE="cmake3" ;;
|
||||
centos) OS_BASEDISTRO="fedora"; INSTALLER="yum --skip-broken"; CMAKE="cmake3" ;;
|
||||
debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
|
||||
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
|
||||
esac
|
||||
@@ -102,6 +102,7 @@ check_supported_distribution() {
|
||||
"ubuntu14.04") return 0 ;;
|
||||
"fedora24") return 0 ;;
|
||||
"rhel7") return 0 ;;
|
||||
"rhel7.6") return 0 ;;
|
||||
"centos7") return 0 ;;
|
||||
esac
|
||||
return 1
|
||||
@@ -252,7 +253,7 @@ install_usrp_uhd_driver_from_source(){
|
||||
rm -rf /tmp/uhd
|
||||
git clone https://github.com/EttusResearch/uhd.git
|
||||
cd uhd
|
||||
git checkout tags/release_003_010_001_001
|
||||
git checkout tags/v3.13.0.2
|
||||
mkdir -p host/build
|
||||
cd host/build
|
||||
$CMAKE ../
|
||||
@@ -310,10 +311,20 @@ install_usrp_uhd_driver() {
|
||||
# On newer kernels, it fails to install
|
||||
$SUDO apt-get -y install uhd-host
|
||||
fi
|
||||
# quick workaround for RHE7.6
|
||||
local distribution=$(get_distribution_release)
|
||||
if [ -z $1 ]; then
|
||||
$SUDO uhd_images_downloader
|
||||
if [[ "$distribution" == "rhel7.6" ]]; then
|
||||
$SUDO /usr/local/bin/uhd_images_downloader
|
||||
else
|
||||
$SUDO uhd_images_downloader
|
||||
fi
|
||||
else
|
||||
$SUDO uhd_images_downloader -i $1
|
||||
if [[ "$distribution" == "rhel7.6" ]]; then
|
||||
$SUDO /usr/local/bin/uhd_images_downloader -i $1
|
||||
else
|
||||
$SUDO uhd_images_downloader -i $1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -372,13 +383,81 @@ check_install_lmssdr_driver(){
|
||||
else
|
||||
echo_error "lmssdr support implies installing lmssdr drivers and tools" \
|
||||
" from sources. check:"
|
||||
echo_info "https://open-cells.com/index.php/2017/05/10/limesdr-installation/"
|
||||
echo_info "https://wiki.myriadrf.org/Lime_Suite"
|
||||
echo_fatal "Cannot compile lmssdr device"
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
|
||||
install_soapy_from_source(){
|
||||
soapy_install_log=$OPENAIR_DIR/cmake_targets/log/soapy_install_log.txt
|
||||
echo_info "\nInstalling Soapy EcoSystem from source. The log file for Soapy installation is here: $soapy_install_log "
|
||||
(
|
||||
cd /tmp
|
||||
echo "Downloading SoapySDR"
|
||||
rm -rf /tmp/soapysdr
|
||||
git clone -b soapy-sdr-0.7.0 --single-branch https://github.com/pothosware/SoapySDR.git
|
||||
cd SoapySDR
|
||||
#git checkout tags/release_003_010_001_001
|
||||
mkdir -p build
|
||||
cd build
|
||||
$CMAKE ../
|
||||
echo "Compiling SoapySDR"
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
cd /tmp
|
||||
echo "Downloading SoapyRemote"
|
||||
rm -rf /tmp/soapyremote
|
||||
git clone -b soapy-remote-0.5.0 --single-branch https://github.com/pothosware/SoapyRemote.git
|
||||
cd SoapyRemote
|
||||
#git checkout tags/release_003_010_001_001
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake ../
|
||||
echo "Compiling SoapyRemote"
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& $soapy_install_log
|
||||
}
|
||||
|
||||
install_soapy_iris_from_source(){
|
||||
iris_install_log=$OPENAIR_DIR/cmake_targets/log/iris_install_log.txt
|
||||
echo_info "\nInstalling Iris driver from source. The log file for Iris driver installation is here: $iris_install_log "
|
||||
(
|
||||
cd /tmp
|
||||
echo "Downloading SoapyIris"
|
||||
rm -rf /tmp/sklk-soapyiris
|
||||
git clone -b soapy-iris-2018.08.0.1 --single-branch https://github.com/skylarkwireless/sklk-soapyiris.git
|
||||
cd sklk-soapyiris
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake ../
|
||||
echo "Compiling SoapyIris"
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& $iris_install_log
|
||||
}
|
||||
|
||||
check_install_soapy () {
|
||||
#if [[ "$OS_DISTRO" == "ubuntu" ]]; then
|
||||
#first we remove old installation
|
||||
$SUDO apt-get remove -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote || true
|
||||
#$SUDO add-apt-repository -y ppa:myriadrf/drivers
|
||||
#$SUDO apt-get update
|
||||
#$SUDO apt-get install -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote
|
||||
|
||||
#elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
|
||||
# $SUDO $INSTALLER -y install software-properties-common python3-software-properties python-software-properties subversion git python3 python-numpy python3-numpy cmake swig python-dev
|
||||
install_soapy_from_source
|
||||
#fi
|
||||
install_soapy_iris_from_source
|
||||
|
||||
}
|
||||
|
||||
check_install_additional_tools (){
|
||||
$SUDO $INSTALLER update -y
|
||||
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
|
||||
@@ -560,8 +639,6 @@ check_install_oai_software() {
|
||||
libidn2-0-dev \
|
||||
libidn11-dev \
|
||||
libmysqlclient-dev \
|
||||
liboctave-dev \
|
||||
libpgm-dev \
|
||||
libpython2.7-dev \
|
||||
libsctp1 \
|
||||
libsctp-dev \
|
||||
@@ -572,7 +649,6 @@ check_install_oai_software() {
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
mscgen \
|
||||
octave \
|
||||
octave-signal \
|
||||
openssh-client \
|
||||
openssh-server \
|
||||
@@ -584,7 +660,8 @@ check_install_oai_software() {
|
||||
pydb \
|
||||
libyaml-dev \
|
||||
wget \
|
||||
libxpm-dev
|
||||
libxpm-dev \
|
||||
libboost-all-dev
|
||||
|
||||
$SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET"
|
||||
|
||||
@@ -632,8 +709,6 @@ check_install_oai_software() {
|
||||
libidn2-devel \
|
||||
libidn-devel \
|
||||
mariadb-devel \
|
||||
octave-devel \
|
||||
openpgm-devel \
|
||||
lksctp-tools \
|
||||
lksctp-tools-devel \
|
||||
openssl-devel \
|
||||
@@ -643,8 +718,6 @@ check_install_oai_software() {
|
||||
libxml2 \
|
||||
libxml2-devel \
|
||||
libxslt-devel \
|
||||
octave \
|
||||
octave-signal \
|
||||
openssh-clients \
|
||||
openssh-server \
|
||||
openssl \
|
||||
@@ -667,7 +740,7 @@ check_install_oai_software() {
|
||||
libyaml-devel
|
||||
fi
|
||||
|
||||
install_asn1c_from_source
|
||||
install_asn1c_from_source $1
|
||||
$SUDO rm -fr /opt/ssh
|
||||
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh
|
||||
}
|
||||
|
||||
Executable → Regular
@@ -23,7 +23,7 @@ reset_color="$(tput sgr0)"
|
||||
function error()
|
||||
{
|
||||
echo -e "$red_color"ERROR: "$@""$reset_color"
|
||||
exit 1
|
||||
# exit 1
|
||||
}
|
||||
|
||||
function check_sha1()
|
||||
@@ -56,11 +56,11 @@ function patch_file()
|
||||
|
||||
echo -e "$green_color""patch file $file with $OPENAIR_DIR/cmake_targets/tools/$patch""$reset_color"
|
||||
|
||||
patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed"
|
||||
fi
|
||||
# patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch"
|
||||
# if [ $? -ne 0 ]
|
||||
# then
|
||||
# error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed"
|
||||
# fi
|
||||
}
|
||||
|
||||
function apply_patches()
|
||||
@@ -161,6 +161,22 @@ function patch_s1ap()
|
||||
esac
|
||||
}
|
||||
|
||||
function patch_f1ap()
|
||||
{
|
||||
local directory="$1"
|
||||
local version="$2"
|
||||
|
||||
case "$version" in
|
||||
R15 )
|
||||
#nothing to do anymore (fixes went to asn1c)
|
||||
;;
|
||||
* )
|
||||
error unknwon/unhandled F1AP version \'"$version"\'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
function main()
|
||||
{
|
||||
if [ $# -ne 3 ]
|
||||
@@ -191,6 +207,9 @@ function main()
|
||||
S1AP )
|
||||
patch_s1ap "$directory" "$version"
|
||||
;;
|
||||
F1AP )
|
||||
patch_f1ap "$directory" "$version"
|
||||
;;
|
||||
* )
|
||||
error unknown module "$module"
|
||||
;;
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
|
||||
function main()
|
||||
{
|
||||
mkdir -p $1
|
||||
cd $1
|
||||
PROTOCOL_DIR=$1
|
||||
mkdir -p ${PROTOCOL_DIR}
|
||||
cd ${PROTOCOL_DIR}
|
||||
|
||||
# Because use $* also include directory, so we need shift
|
||||
shift
|
||||
|
||||
local module="$2"
|
||||
@@ -12,15 +15,15 @@ local module="$2"
|
||||
#(there may be a better way...)
|
||||
if [ $# -eq 2 ]; then
|
||||
|
||||
#asn1c does not work well with extension groups, we need the following fix:
|
||||
# replace [[ by '<name> SEQUENCE {'
|
||||
# and ]] by '} OPTIONAL'
|
||||
#<name> is ext<N> with N starting from 1 and incremented at each new [[ ]] just
|
||||
#following another [[ ]]
|
||||
#
|
||||
#this is what the following C program does
|
||||
#asn1c does not work well with extension groups, we need the following fix:
|
||||
# replace [[ by '<name> SEQUENCE {'
|
||||
# and ]] by '} OPTIONAL'
|
||||
#<name> is ext<N> with N starting from 1 and incremented at each new [[ ]] just
|
||||
#following another [[ ]]
|
||||
#
|
||||
#this is what the following C program does
|
||||
|
||||
echo generate asnfix.c
|
||||
echo generate asnfix.c
|
||||
|
||||
cat << EOF > asnfix.c
|
||||
/* transforms:
|
||||
@@ -87,19 +90,19 @@ int main(void)
|
||||
}
|
||||
EOF
|
||||
|
||||
echo compile asnfix.c
|
||||
echo compile asnfix.c
|
||||
|
||||
gcc -Wall -o asnfix asnfix.c
|
||||
gcc -Wall -o asnfix asnfix.c
|
||||
|
||||
echo run asnfix on $1
|
||||
echo run asnfix on $1
|
||||
|
||||
./asnfix < $1 > fixed_grammar.asn
|
||||
./asnfix < $1 > fixed_grammar.asn
|
||||
|
||||
rm -f asnfix asnfix.c
|
||||
rm -f asnfix asnfix.c
|
||||
|
||||
echo done with asnfix
|
||||
echo done with asnfix
|
||||
|
||||
echo running asn1c
|
||||
echo running asn1c
|
||||
|
||||
case "$module" in
|
||||
RRC )
|
||||
@@ -120,11 +123,14 @@ case "$module" in
|
||||
esac
|
||||
|
||||
|
||||
rm -f fixed_grammar.asn
|
||||
|
||||
rm -f fixed_grammar.asn
|
||||
|
||||
echo asn1c done
|
||||
echo asn1c done
|
||||
|
||||
elif echo ${PROTOCOL_DIR} | grep -q "F1AP"; then
|
||||
|
||||
asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample
|
||||
|
||||
else
|
||||
|
||||
case "$module" in
|
||||
|
||||
@@ -52,20 +52,20 @@ load_module ../../targets/bin/ue_ip.ko
|
||||
|
||||
if [ "$1" = "UE" ]; then
|
||||
echo "bring up $LTEIF interface for UE"
|
||||
ifconfig $LTEIF up
|
||||
sudo ifconfig $LTEIF up
|
||||
fi
|
||||
|
||||
ip route flush cache
|
||||
sudo ip route flush cache
|
||||
sleep 1
|
||||
sysctl -w net.ipv4.conf.all.log_martians=1
|
||||
sudo sysctl -w net.ipv4.conf.all.log_martians=1
|
||||
echo "Disabling reverse path filtering"
|
||||
sysctl -w net.ipv4.conf.all.rp_filter=0
|
||||
ip route flush cache
|
||||
sudo sysctl -w net.ipv4.conf.all.rp_filter=0
|
||||
sudo ip route flush cache
|
||||
|
||||
# Check table 200 lte in /etc/iproute2/rt_tables
|
||||
fgrep lte /etc/iproute2/rt_tables > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "200 lte " >> /etc/iproute2/rt_tables
|
||||
fi
|
||||
ip rule add fwmark 1 table lte
|
||||
ip route add default dev $LTEIF table lte
|
||||
sudo ip rule add fwmark 1 table lte
|
||||
sudo ip route add default dev $LTEIF table lte
|
||||
|
||||
@@ -3,13 +3,13 @@ GENERATED_FULL_DIR=$1
|
||||
shift
|
||||
ASN1_SOURCE_DIR=$1
|
||||
shift
|
||||
export ASN1C_PREFIX=$1
|
||||
export ASN1C_PREFIX=$1
|
||||
shift
|
||||
options=$*
|
||||
done_flag="$GENERATED_FULL_DIR"/done
|
||||
if [ "$done_flag" -ot $ASN1_SOURCE_DIR ] ; then
|
||||
if [ "$done_flag" -ot $ASN1_SOURCE_DIR ] ; then
|
||||
rm -f "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.c "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.h
|
||||
mkdir -p "$GENERATED_FULL_DIR"
|
||||
asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example $options -D $GENERATED_FULL_DIR $ASN1_SOURCE_DIR |& egrep -v "^Copied|^Compiled" | sort -u
|
||||
fi
|
||||
touch $done_flag
|
||||
touch $done_flag
|
||||
Regular → Executable
Reference in New Issue
Block a user