blob: b71ed01450c277e95fbf5a4ffed00864e7a2929b [file] [log] [blame]
Kim Kempf531d52d2017-10-02 17:10:54 -07001#
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16#
17
18# Run from OpenNetworkLinux top directory
19#
20#cd /aux/OpenNetworkLinux
21set -e
22ASFVOLT_REPO_NAME=asfvolt16-driver
23
24# override shell variables to match custom local build environment
25: ${ONL_TOPDIR:=`pwd`}
26: ${BALSRC_RELEASE:=bal_src_release}
27: ${BALREL_TOPDIR:=${ONL_TOPDIR}/${BALSRC_RELEASE}}
28: ${BALSRC_TOPDIR:=${ONL_TOPDIR}/${BALSRC_RELEASE}/bal_release}
29: ${ASFDRVR_PKGDIR:=${ONL_TOPDIR}/asfdrvr-package-dir}
30: ${ASFDVR_TARBALL_NAME:=asfvolt16-voltha-bal}
Kim Kempfe109db72017-10-05 13:12:54 -070031: ${BUILD_FILENAME_TAG:=`date +%Y%m%d%H%M`}
32: ${ASFDVR_TARBALL_FNAME:=${ASFDVR_TARBALL_NAME}-${BUILD_FILENAME_TAG}.tgz}
Kim Kempf531d52d2017-10-02 17:10:54 -070033
34echo ONL_TOPDIR=${ONL_TOPDIR}
35echo BALSRC_RELEASE=${BALSRC_RELEASE}
36echo BALREL_TOPDIR=${BALREL_TOPDIR}
37echo BALSRC_TOPDIR=${BALSRC_TOPDIR}
38echo ASFDRVR_PKGDIR=${ASFDRVR_PKGDIR}
39echo ASFDVR_TARBALL_NAME=${ASFDVR_TARBALL_NAME}
Kim Kempfe109db72017-10-05 13:12:54 -070040echo BUILD_FILENAME_TAG=${BUILD_FILENAME_TAG}
41echo ASFDVR_TARBALL_FNAME=${ASFDVR_TARBALL_FNAME}
Kim Kempf531d52d2017-10-02 17:10:54 -070042
43# Note: removes existing directories: asfvolt16-driver, grpc, protobuf
44rm -rf ${ASFDRVR_PKGDIR}
45
46
47mkdir -p ${ASFDRVR_PKGDIR}
48cd ${ASFDRVR_PKGDIR}
49
Kim Kempfe109db72017-10-05 13:12:54 -070050#extract ASFvOLT16 BAL/Maple built release tarball
Kim Kempf531d52d2017-10-02 17:10:54 -070051tar zxf ${BALREL_TOPDIR}/bcm68620_release/asfvolt16/release/release_asfvolt16_V*.tar.gz
52
53# voltha_bal_driver and grpc/protobufs live in /broadcom dir on ASFvOLT16 target
54cd broadcom
55
56# add grpc-c libs
57cp -pR ${ONL_TOPDIR}/grpc-c/build/lib/.libs/libgrpc-c.so.0.0.0 .
58ln -s /broadcom/libgrpc-c.so.0.0.0 libgrpc-c.so.0
59ln -s /broadcom/libgrpc-c.so.0.0.0 libgrpc-c.so
60
61# add grpc libs
62cp -pR ${ONL_TOPDIR}/grpc/libs/opt/libgrp*.so* .
63cp -pR ${ONL_TOPDIR}/grpc/libs/opt/libgpr*.so* .
64
65# add protobuf-c libs
66cp -pR ${ONL_TOPDIR}/grpc-c/third_party/protobuf-c/protobuf-c/.libs/libprotobuf-c.so* .
67
68# add protobuf libs
69cp -pR ${ONL_TOPDIR}/grpc/thirdparty/protobuf/src/.libs/libprotobuf.so* .
70cp -pR ${ONL_TOPDIR}/grpc/thirdparty/protobuf/src/.libs/libprotobuf-lite.so* .
71cp -pR ${ONL_TOPDIR}/grpc/thirdparty/protobuf/src/.libs/libprotoc.so* .
72rm *.0T
73
74# add voltha_bal_driver
75cp -pR ${ONL_TOPDIR}/grpc-c/build/examples/.libs/voltha_bal_driver .
76
77#extract ASFvOLT16 BAL/Maple built release tarball
78cd ..
79tar cvzf ${ASFDVR_TARBALL_FNAME} broadcom opt
80
81ls -l `pwd`/${ASFDVR_TARBALL_FNAME}
82echo "${ASFVOLT_REPO_NAME} package build complete"