blob: 7555191059dd9f1897414289c1f196d4714bc0d3 [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}
Girish Gowdru9ebd8b22018-09-26 03:21:03 -070027: ${BALREL_TOPDIR:=${BROADCOM_DOWNLOAD_DIR}/${BALSRC_RELEASE}}
28: ${BALSRC_TOPDIR:=${EDGECORE_DOWNLOAD_DIR}/${BALSRC_RELEASE}/bal_release}
29: ${ASFSCR_TOPDIR:=${EDGECORE_DOWNLOAD_DIR}/${ASFVOLT_REPO_NAME}/scripts}
30: ${ASFDRVR_PKGDIR:=${EDGECORE_DOWNLOAD_DIR}/asfdrvr-package-dir}
Kim Kempf531d52d2017-10-02 17:10:54 -070031: ${ASFDVR_TARBALL_NAME:=asfvolt16-voltha-bal}
Kim Kempfe109db72017-10-05 13:12:54 -070032: ${BUILD_FILENAME_TAG:=`date +%Y%m%d%H%M`}
33: ${ASFDVR_TARBALL_FNAME:=${ASFDVR_TARBALL_NAME}-${BUILD_FILENAME_TAG}.tgz}
Kim Kempf531d52d2017-10-02 17:10:54 -070034
35echo ONL_TOPDIR=${ONL_TOPDIR}
36echo BALSRC_RELEASE=${BALSRC_RELEASE}
37echo BALREL_TOPDIR=${BALREL_TOPDIR}
38echo BALSRC_TOPDIR=${BALSRC_TOPDIR}
Kim Kempf0fcb0ed2017-10-24 12:22:17 -070039echo ASFSCR_TOPDIR=${ASFSCR_TOPDIR}
Kim Kempf531d52d2017-10-02 17:10:54 -070040echo ASFDRVR_PKGDIR=${ASFDRVR_PKGDIR}
41echo ASFDVR_TARBALL_NAME=${ASFDVR_TARBALL_NAME}
Kim Kempfe109db72017-10-05 13:12:54 -070042echo BUILD_FILENAME_TAG=${BUILD_FILENAME_TAG}
43echo ASFDVR_TARBALL_FNAME=${ASFDVR_TARBALL_FNAME}
Kim Kempf531d52d2017-10-02 17:10:54 -070044
Girish Gowdru9ebd8b22018-09-26 03:21:03 -070045# Note: removes existing directories: asfvolt16-driver
46cd ${EDGECORE_DOWNLOAD_DIR}
Kim Kempf531d52d2017-10-02 17:10:54 -070047rm -rf ${ASFDRVR_PKGDIR}
48
49
50mkdir -p ${ASFDRVR_PKGDIR}
51cd ${ASFDRVR_PKGDIR}
52
Kim Kempfe109db72017-10-05 13:12:54 -070053#extract ASFvOLT16 BAL/Maple built release tarball
Kim Kempf531d52d2017-10-02 17:10:54 -070054tar zxf ${BALREL_TOPDIR}/bcm68620_release/asfvolt16/release/release_asfvolt16_V*.tar.gz
55
56# voltha_bal_driver and grpc/protobufs live in /broadcom dir on ASFvOLT16 target
57cd broadcom
58
59# add grpc-c libs
Girish Gowdru9ebd8b22018-09-26 03:21:03 -070060cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc-c/build/lib/.libs/libgrpc-c.so.0.0.0 .
Kim Kempf531d52d2017-10-02 17:10:54 -070061ln -s /broadcom/libgrpc-c.so.0.0.0 libgrpc-c.so.0
62ln -s /broadcom/libgrpc-c.so.0.0.0 libgrpc-c.so
63
64# add grpc libs
Girish Gowdru9ebd8b22018-09-26 03:21:03 -070065cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc/libs/opt/libgrp*.so* .
66cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc/libs/opt/libgpr*.so* .
Kim Kempf531d52d2017-10-02 17:10:54 -070067
68# add protobuf-c libs
Girish Gowdru9ebd8b22018-09-26 03:21:03 -070069cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc-c/third_party/protobuf-c/protobuf-c/.libs/libprotobuf-c.so* .
Kim Kempf531d52d2017-10-02 17:10:54 -070070
71# add protobuf libs
Girish Gowdru9ebd8b22018-09-26 03:21:03 -070072cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc/thirdparty/protobuf/src/.libs/libprotobuf.so* .
73cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc/thirdparty/protobuf/src/.libs/libprotobuf-lite.so* .
74cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc/thirdparty/protobuf/src/.libs/libprotoc.so* .
Kim Kempf531d52d2017-10-02 17:10:54 -070075rm *.0T
76
77# add voltha_bal_driver
Girish Gowdru9ebd8b22018-09-26 03:21:03 -070078cp -pR ${EDGECORE_DOWNLOAD_DIR}/grpc-c/build/examples/.libs/voltha_bal_driver .
Kim Kempf531d52d2017-10-02 17:10:54 -070079
Kim Kempf0fcb0ed2017-10-24 12:22:17 -070080# add voltha driver startup scripts
81cp -p ${ASFSCR_TOPDIR}/voltha_init_sh voltha_init.sh
Kim Kempf7ff460c2017-10-27 14:21:30 -070082chmod 755 voltha_init.sh
Kim Kempf0fcb0ed2017-10-24 12:22:17 -070083
Kim Kempf531d52d2017-10-02 17:10:54 -070084#extract ASFvOLT16 BAL/Maple built release tarball
85cd ..
86tar cvzf ${ASFDVR_TARBALL_FNAME} broadcom opt
87
88ls -l `pwd`/${ASFDVR_TARBALL_FNAME}
89echo "${ASFVOLT_REPO_NAME} package build complete"