Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
wangjie
OpenXG-RAN
Commits
021ca70b
Commit
021ca70b
authored
Nov 06, 2014
by
Navid Nikaein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@5980
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
35bd7f34
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
107 additions
and
78 deletions
+107
-78
targets/build_helper.bash
targets/build_helper.bash
+81
-58
targets/build_oai.bash
targets/build_oai.bash
+26
-20
No files found.
targets/build_helper.bash
View file @
021ca70b
...
...
@@ -45,6 +45,7 @@ USER=`whoami`
BUILD_FROM_MAKEFILE
=
0
SUDO
=
''
PW
=
''
UBUNTU_REL
=
`
lsb_release
-r
|
cut
-f2
`
set_build_from_makefile
(){
BUILD_FROM_MAKEFILE
=
$1
...
...
@@ -127,25 +128,27 @@ make_certs(){
echo
"creating the certificate"
user
=
$(
whoami
)
HOSTNAME
=
$(
hostname
)
HOSTNAME
=
$(
hostname
-f
)
echo
"Creating certificate for user '
$HOSTNAME
'"
# CA self certificate
openssl req
-new
-batch
-x509
-days
3650
-nodes
-newkey
rsa:1024
-out
cacert.pem
-keyout
cakey.pem
-subj
/CN
=
eur/C
=
FR/ST
=
PACA/L
=
Aix/O
=
Eurecom/OU
=
CM
openssl genrsa
-out
user.key.pem 1024
openssl req
-new
-batch
-out
user.csr.pem
-key
user.key.pem
-subj
/CN
=
$HOSTNAME
.eur/C
=
FR/ST
=
PACA/L
=
Aix/O
=
Eurecom/OU
=
CM
openssl ca
-cert
cacert.pem
-keyfile
cakey.pem
-in
user.csr.pem
-out
user.cert.pem
-outdir
.
-batch
# openssl genrsa -out user.key.pem 1024
openssl genrsa
-out
hss.key.pem 1024
#openssl req -new -batch -out user.csr.pem -key user.key.pem -subj /CN=$HOSTNAME.eur/C=FR/ST=PACA/L=Aix/O=Eurecom/OU=CM
openssl req
-new
-batch
-out
hss.csr.pem
-key
hss.key.pem
-subj
/CN
=
hss.eur/C
=
FR/ST
=
PACA/L
=
Aix/O
=
Eurecom/OU
=
CM
openssl ca
-cert
cacert.pem
-keyfile
cakey.pem
-in
hss.csr.pem
-out
hss.cert.pem
-outdir
.
-batch
if
[
!
-d
/usr/local/etc/freeDiameter
]
;
then
echo
"Creating non existing directory: /usr/local/etc/freeDiameter/"
$SUDO
mkdir
/usr/local/etc/freeDiameter/
fi
echo
"Copying
cakey.pem user.key.pem cacert
.pem to /usr/local/etc/freeDiameter/"
$SUDO
cp
user.key.pem user.cert.pem cacert
.pem /usr/local/etc/freeDiameter/
mv
user.key.pem user.cert.pem cacert
.pem bin/
echo
"Copying
*
.pem to /usr/local/etc/freeDiameter/"
$SUDO
cp
*
.pem /usr/local/etc/freeDiameter/
mv
*
.pem bin/
# openssl genrsa -out ubuntu.key.pem 1024
# openssl req -new -batch -x509 -out ubuntu.csr.pem -key ubuntu.key.pem -subj /CN=ubuntu.localdomain/C=FR/ST=BdR/L=Aix/O=fD/OU=Tests
...
...
@@ -155,6 +158,8 @@ make_certs(){
check_install_freediamter
(){
if
[
$UBUNTU_REL
=
"12.04"
]
;
then
if
[
!
-d
/usr/local/src/
]
;
then
echo
"/usr/local/src/ doesn't exist please create one"
exit
-1
...
...
@@ -194,6 +199,7 @@ check_install_freediamter(){
$SUDO
make check
$SUDO
make
install
cd
../
fi
echo
"Downloading gnutls archive"
...
...
@@ -245,17 +251,19 @@ check_install_freediamter(){
$SUDO
make
test
$SUDO
sudo
make
install
make_certs
#
make_certs
}
check_s6a_certificate
()
{
cnt
=
0
if
[
-d
/usr/local/etc/freeDiameter
]
;
then
if
[
-f
/usr/local/etc/freeDiameter/user.cert.pem
]
;
then
full_hostname
=
`
cat
/usr/local/etc/freeDiameter/user.cert.pem |
grep
"Subject"
|
grep
"CN"
|
cut
-d
'='
-f6
`
if
[
$full_hostname
=
`
hostname
`
.eur
]
;
then
if
[
-f
/usr/local/etc/freeDiameter/hss.cert.pem
]
;
then
full_hostname
=
`
cat
/usr/local/etc/freeDiameter/hss.cert.pem |
grep
"Subject"
|
grep
"CN"
|
cut
-d
'='
-f6
`
# if [ $full_hostname = `hostname`.eur ]; then
if
[
$full_hostname
=
hss.eur
]
;
then
echo_success
"S6A: Found valid certificate in /usr/local/etc/freeDiameter"
return
1
return
0
fi
fi
fi
...
...
@@ -263,7 +271,10 @@ check_s6a_certificate() {
echo_warning
"S6A: generatting new certificate in /usr/local/etc/freeDiameter..."
cd
$OPENAIRCN_DIR
/S6A/freediameter
make_certs
if
[
$cnt
=
0
]
;
then
cnt
=
1
check_s6a_certificate
fi
return
1
}
...
...
@@ -350,6 +361,10 @@ check_install_oai_software() {
check_install_hss_software
()
{
if
[
!
-f
./.lock_oaibuild
]
;
then
$SUDO
apt-get update
if
[
$UBUNTU_REL
=
"12.04"
]
;
then
test_uninstall_package nettle-dev
test_uninstall_package nettle-bin
fi
test_install_package autoconf
test_install_package automake
test_install_package bison
...
...
@@ -372,7 +387,7 @@ check_install_hss_software() {
test_install_package libsctp1
test_install_package libsctp-dev
test_install_package libxml2-dev
test_install_package linux-headers-
`
uname
-r
`
#
test_install_package linux-headers-`uname -r`
test_install_package make
test_install_package mysql-client-core-5.5
test_install_package mysql-server-core-5.5
...
...
@@ -384,8 +399,8 @@ check_install_hss_software() {
test_install_package sshfs
test_install_package swig
test_install_package unzip
test_install_package nettle-bin
test_install_package nettle-dev
#
test_install_package nettle-bin
#
test_install_package nettle-dev
test_install_package valgrind
if
[
$OAI_INSTALLED
=
1
]
;
then
...
...
@@ -393,7 +408,7 @@ check_install_hss_software() {
fi
else
echo_info
"
skip the package installations
"
echo_info
"
All the required packages installed: skip
"
fi
}
...
...
@@ -402,6 +417,10 @@ check_install_epc_software() {
if
[
!
-f
./.lock_oaibuild
]
;
then
$SUDO
apt-get update
if
[
$UBUNTU_REL
=
"12.04"
]
;
then
test_uninstall_package nettle-dev
test_uninstall_package nettle-bin
fi
test_install_package autoconf
test_install_package automake
test_install_package bison
...
...
@@ -467,7 +486,7 @@ check_install_epc_software() {
fi
else
echo_info
"
skip the package installations
"
echo_info
"
All the required packages installed: skip
"
fi
}
...
...
@@ -501,6 +520,10 @@ check_install_asn1c(){
compile_hss
()
{
cd
$OPENAIRCN_DIR
/OPENAIRHSS
OBJ_DIR
=
`
find
.
-maxdepth
1
-type
d
-iname
obj
*
`
if
[
$1
=
1
]
;
then
echo_info
"build a clean EPC"
bash_exec
"rm -rf obj"
fi
if
[
!
-n
"
$OBJ_DIR
"
]
;
then
OBJ_DIR
=
"objs"
bash_exec
"mkdir -m 777 ./
$OBJ_DIR
"
...
...
targets/build_oai.bash
View file @
021ca70b
...
...
@@ -415,7 +415,7 @@ build_epc(){
######################################
# CHECK MISC SOFTWARES AND LIBS #
######################################
echo_info
"4.check the required packages for HSS"
echo_info
"4.
check the required packages for HSS"
check_install_epc_software
...
...
@@ -472,7 +472,8 @@ build_hss(){
######################################
# CHECK MISC SOFTWARES AND LIBS #
######################################
echo_info
"4.check the required packages for HSS"
echo_info
"4. check the required packages for HSS"
hss_certificate_generated
=
1
;
check_install_hss_software
...
...
@@ -483,13 +484,16 @@ build_hss(){
check_install_freediamter
fi
fi
check_s6a_certificate
$(
make_certs
>>
bin/install_log.txt 2>&1
)
output
=
$(
check_s6a_certificate
>>
bin/install_log.txt 2>&1
)
hss_certificate_generated
=
$?
######################################
# compile HSS #
######################################
echo_info
"5.compile HSS"
echo_info
"5.
compile HSS"
output
=
$(
compile_hss
>>
bin/install_log.txt 2>&1
)
output
=
$(
compile_hss
$OAI_CLEAN
>>
bin/install_log.txt 2>&1
)
hss_compiled
=
$?
check_for_hss_executable
echo_info
"finished hss target: check the installation log file bin/install_log.txt"
...
...
@@ -497,31 +501,33 @@ build_hss(){
######################################
# fill the HSS DB
######################################
echo_info
"6.create HSS database (for EURECOM SIM CARDS)"
echo_info
"6.
create HSS database (for EURECOM SIM CARDS)"
hss_db_created
=
1
output
=
$(
create_hss_database
)
USER
=
"hssadmin"
PW
=
""
output
=
$(
create_hss_database
$USER
$PW
)
hss_db_created
=
$?
if
[
$hss_db_created
=
0
]
;
then
echo_warning
"hss DB not created"
fi
######################################
# install hss
######################################
echo_info
"
6
. install the binary file"
echo_info
"
7
. install the binary file"
if
[
$hss_compiled
=
0
]
;
then
if
[
$hss_db_created
=
0
]
;
then
echo_success
"target hss built, DB created and installed in the bin directory"
echo
"target hss built, DB created, and installed in the bin directory"
>>
bin/
${
oai_build_date
}
else
echo_warning
"hss DB not created"
fi
cp
-f
$OPENAIRCN_DIR
/OPENAIRHSS/conf/hss.conf
$OPENAIR_TARGETS
/bin
cp
-rf
$OPENAIRCN_DIR
/OPENAIRHSS/conf
$OPENAIR_TARGETS
/bin
$SUDO
cp
$OPENAIR_TARGETS
/bin/conf/hss_fd.local.conf /etc/openair-hss
fi
######################################
# LAUNCH HSS #
######################################
echo_info
"7. run hss"
bin/openair-hss
-c
bin/hss.conf
echo_info
"8. run hss in bin/: ./openair-hss -c conf/hss.local.conf"
cd
bin
./openair-hss
-c
conf/hss.local.conf
}
...
...
@@ -530,7 +536,7 @@ build_hss(){
# set the build
############################################
echo_info
"set the top-level build target"
echo_info
"
3.
set the top-level build target"
case
"
$BUILD_LTE
"
in
'ENB'
)
echo_success
"build LTE eNB"
...
...
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