Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
config-amarisoft
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
config-amarisoft
Commits
c86a1fa0
Commit
c86a1fa0
authored
Sep 08, 2023
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add install-amarisoft.sh script
parent
74de04ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
128 additions
and
0 deletions
+128
-0
install-amarisoft.sh
install-amarisoft.sh
+128
-0
No files found.
install-amarisoft.sh
0 → 100755
View file @
c86a1fa0
#!/bin/bash
set
-e
set
-x
usage
()
{
cat
<<
ENDUSAGE
Usage:
$0
[-h] 2021_AMARISOFT_TAR_PATH AMARISOFT_TAR_PATH
-h Show help
ENDUSAGE
1>&2
}
while
getopts
"h"
opt
;
do
case
"
${
opt
}
"
in
h
)
usage
exit
1
;;
*
)
usage
exit
1
;;
esac
done
shift
$((
OPTIND-1
))
if
[
"$#"
-ne
2
]
;
then
usage
;
exit
fi
ORS_NUMBER
=
"
$(
hostname
|sed
's/ors\([0-9]*\)/\1/g'
)
"
BAND
=
"
$(
/opt/amarisoft/get-sdr-info
-b
)
"
OLD_AMARISOFT_TAR
=
"
$(
realpath
$1
)
"
AMARISOFT_TAR
=
"
$(
realpath
$2
)
"
# Cleanup for client
echo
"Cleaning up"
# Install standard ORS configurations
echo
"Installing standard ORS configurations"
cd
$HOME
if
!
stat
config-amarisoft
||
!
file
-d
config-amarisoft
;
then
git clone https://lab.nexedi.com/nexedi/config-amarisoft
else
cd
config-amarisoft
git stash
git fetch origin
&&
git reset
--hard
origin/master
git stash pop
||
true
fi
VERSION
=
"
$(
echo
"
$(
basename
$AMARISOFT_TAR
)
"
|
sed
-n
's/amarisoft\.\([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\)\.tar\.gz/\1/gp'
)
"
OLD_VERSION
=
"
$(
echo
"
$(
basename
$OLD_AMARISOFT_TAR
)
"
|
sed
-n
's/amarisoft\.\(2021-[0-9]\{2\}-[0-9]\{2\}\)\.tar\.gz/\1/gp'
)
"
if
[
-z
"
$VERSION
"
]
;
then
echo
"Couldn't parse version from amarisoft tar filename"
echo
"Following format is expected: amarisoft.XXXX-XX-XX.tar.gz"
usage
;
exit
fi
if
[
-z
"
$OLD_VERSION
"
]
;
then
echo
"Couldn't parse version from 2021 amarisoft tar filename"
echo
"Following format is expected: amarisoft.2021-XX-XX.tar.gz"
usage
;
exit
fi
if
grep
-q
started
$(
find /srv/slapgrid
-type
f
-name
"*requested_state*"
||
true
)
;
then
echo
"Please stop all slapos services before installing root access"
exit
fi
if
ps aux |
grep
-v
grep
|
grep
-q
"lteenb
\|
ltemme"
;
then
echo
"Please stop all amarisoft processes before installing root access"
exit
fi
lsmod |
grep
-q
sdr
&&
{
rmmod sdr
||
echo
"Can't remove sdr module, please disable lte and reboot"
;
exit
;
}
||
true
OLD_TRX
=
"
$HOME
/trx_sdr-linux-
$OLD_VERSION
"
if
!
stat
$OLD_TRX
;
then
cd
$HOME
tar
-xvf
$OLD_AMARISOFT_TAR
cd
$OLD_VERSION
tar
-xvf
trx_sdr-linux-
$OLD_VERSION
.tar.gz
mv
trx_sdr-linux-
$OLD_VERSION
$OLD_TRX
rm
-rf
$OLD_VERSION
fi
cd
$OLD_TRX
/kernel
&&
make clean
&&
make
&&
./init.sh
$OLD_TRX
/sdr_util version |
grep
-q
"FPGA revision: 0-09-51"
&&
{
echo
"Please update your FPGA before continuing, exiting..."
;
rm
-rf
$OLD_TRX
;
exit
;
}
cd
$HOME
tar
-xvf
$AMARISOFT_TAR
cd
$VERSION
./install.sh
--default
rm
-rf
$OLD_AMARISOFT_TAR
rm
-rf
$AMARISOFT_TAR
RRH_CHECK
=
"/root/trx_sdr/rrh_check.sh"
!
grep
-q
ORS_PATCH
$RRH_CHECK
&&
sed
-i
'/echo "Initialize SDR kernel module"/a \ (cd /root/trx_sdr-linux-'
"
$OLD_VERSION
"
'/kernel && make clean && make && ./init.sh && rmmod sdr) # ORS_PATCH'
$RRH_CHECK
cd
$HOME
/config-amarisoft/mme/ors-config
echo
"ue_db: [{"
>
ue_db-ims.cfg
for
i
in
{
1..5
}
;
do
cat
>>
ue_db-ims.cfg
<<
EOF
sim_algo: "milenage",
imsi: "001010000000
${
ORS_NUMBER
}
$i
",
opc: "000102030405060708090A0B0C0D0E0F",
amf: 0x9001,
sqn: "000000000000",
K: "00112233445566778899AABBCCDDEEFF",
impu: "impu
${
ORS_NUMBER
}
$i
",
impi: "impi
${
ORS_NUMBER
}
$i
@amarisoft.com",
EOF
if
[
"
$i
"
-ne
5
]
;
then
echo
"}, {"
>>
ue_db-ims.cfg
fi
done
echo
"}]"
>>
ue_db-ims.cfg
cd
$HOME
/enb/config
ln
-sf
/
$HOME
/config-amarisoft/enb/ors-config/sib23.asn sib23.asn
if
[
"
$BAND
"
=
"B39"
]
;
then
ln
-sf
/
$HOME
/config-amarisoft/enb/ors-config/enb.
$BAND
.cfg enb.cfg
else
ln
-sf
/
$HOME
/config-amarisoft/enb/ors-config/gnb.
$BAND
.cfg enb.cfg
fi
cd
$HOME
/mme/config
ln
-sf
/
$HOME
/config-amarisoft/mme/ors-config/mme-ims.cfg mme.cfg
mv
ue_db-ims.cfg ue_db-ims.default.cfg
ln
-sf
/
$HOME
/config-amarisoft/mme/ors-config/ue_db
*
ue_db-ims.cfg
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment