Kim Kempf | 531d52d | 2017-10-02 17:10:54 -0700 | [diff] [blame] | 1 | # |
| 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 |
| 21 | set -e |
| 22 | ASFVOLT_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} |
Kim Kempf | 0fcb0ed | 2017-10-24 12:22:17 -0700 | [diff] [blame] | 29 | : ${ASFSCR_TOPDIR:=${ONL_TOPDIR}/${ASFVOLT_REPO_NAME}/scripts} |
Kim Kempf | 531d52d | 2017-10-02 17:10:54 -0700 | [diff] [blame] | 30 | : ${ASFDRVR_PKGDIR:=${ONL_TOPDIR}/asfdrvr-package-dir} |
| 31 | : ${ASFDVR_TARBALL_NAME:=asfvolt16-voltha-bal} |
Kim Kempf | e109db7 | 2017-10-05 13:12:54 -0700 | [diff] [blame] | 32 | : ${BUILD_FILENAME_TAG:=`date +%Y%m%d%H%M`} |
| 33 | : ${ASFDVR_TARBALL_FNAME:=${ASFDVR_TARBALL_NAME}-${BUILD_FILENAME_TAG}.tgz} |
Kim Kempf | 531d52d | 2017-10-02 17:10:54 -0700 | [diff] [blame] | 34 | |
| 35 | echo ONL_TOPDIR=${ONL_TOPDIR} |
| 36 | echo BALSRC_RELEASE=${BALSRC_RELEASE} |
| 37 | echo BALREL_TOPDIR=${BALREL_TOPDIR} |
| 38 | echo BALSRC_TOPDIR=${BALSRC_TOPDIR} |
Kim Kempf | 0fcb0ed | 2017-10-24 12:22:17 -0700 | [diff] [blame] | 39 | echo ASFSCR_TOPDIR=${ASFSCR_TOPDIR} |
Kim Kempf | 531d52d | 2017-10-02 17:10:54 -0700 | [diff] [blame] | 40 | echo ASFDRVR_PKGDIR=${ASFDRVR_PKGDIR} |
| 41 | echo ASFDVR_TARBALL_NAME=${ASFDVR_TARBALL_NAME} |
Kim Kempf | e109db7 | 2017-10-05 13:12:54 -0700 | [diff] [blame] | 42 | echo BUILD_FILENAME_TAG=${BUILD_FILENAME_TAG} |
| 43 | echo ASFDVR_TARBALL_FNAME=${ASFDVR_TARBALL_FNAME} |
Kim Kempf | 531d52d | 2017-10-02 17:10:54 -0700 | [diff] [blame] | 44 | |
| 45 | # Note: removes existing directories: asfvolt16-driver, grpc, protobuf |
| 46 | rm -rf ${ASFDRVR_PKGDIR} |
| 47 | |
| 48 | |
| 49 | mkdir -p ${ASFDRVR_PKGDIR} |
| 50 | cd ${ASFDRVR_PKGDIR} |
| 51 | |
Kim Kempf | e109db7 | 2017-10-05 13:12:54 -0700 | [diff] [blame] | 52 | #extract ASFvOLT16 BAL/Maple built release tarball |
Kim Kempf | 531d52d | 2017-10-02 17:10:54 -0700 | [diff] [blame] | 53 | tar zxf ${BALREL_TOPDIR}/bcm68620_release/asfvolt16/release/release_asfvolt16_V*.tar.gz |
| 54 | |
| 55 | # voltha_bal_driver and grpc/protobufs live in /broadcom dir on ASFvOLT16 target |
| 56 | cd broadcom |
| 57 | |
| 58 | # add grpc-c libs |
| 59 | cp -pR ${ONL_TOPDIR}/grpc-c/build/lib/.libs/libgrpc-c.so.0.0.0 . |
| 60 | ln -s /broadcom/libgrpc-c.so.0.0.0 libgrpc-c.so.0 |
| 61 | ln -s /broadcom/libgrpc-c.so.0.0.0 libgrpc-c.so |
| 62 | |
| 63 | # add grpc libs |
| 64 | cp -pR ${ONL_TOPDIR}/grpc/libs/opt/libgrp*.so* . |
| 65 | cp -pR ${ONL_TOPDIR}/grpc/libs/opt/libgpr*.so* . |
| 66 | |
| 67 | # add protobuf-c libs |
| 68 | cp -pR ${ONL_TOPDIR}/grpc-c/third_party/protobuf-c/protobuf-c/.libs/libprotobuf-c.so* . |
| 69 | |
| 70 | # add protobuf libs |
| 71 | cp -pR ${ONL_TOPDIR}/grpc/thirdparty/protobuf/src/.libs/libprotobuf.so* . |
| 72 | cp -pR ${ONL_TOPDIR}/grpc/thirdparty/protobuf/src/.libs/libprotobuf-lite.so* . |
| 73 | cp -pR ${ONL_TOPDIR}/grpc/thirdparty/protobuf/src/.libs/libprotoc.so* . |
| 74 | rm *.0T |
| 75 | |
| 76 | # add voltha_bal_driver |
| 77 | cp -pR ${ONL_TOPDIR}/grpc-c/build/examples/.libs/voltha_bal_driver . |
| 78 | |
Kim Kempf | 0fcb0ed | 2017-10-24 12:22:17 -0700 | [diff] [blame] | 79 | # add voltha driver startup scripts |
| 80 | cp -p ${ASFSCR_TOPDIR}/voltha_init_sh voltha_init.sh |
Kim Kempf | 7ff460c | 2017-10-27 14:21:30 -0700 | [diff] [blame] | 81 | chmod 755 voltha_init.sh |
Kim Kempf | 0fcb0ed | 2017-10-24 12:22:17 -0700 | [diff] [blame] | 82 | |
Kim Kempf | 531d52d | 2017-10-02 17:10:54 -0700 | [diff] [blame] | 83 | #extract ASFvOLT16 BAL/Maple built release tarball |
| 84 | cd .. |
| 85 | tar cvzf ${ASFDVR_TARBALL_FNAME} broadcom opt |
| 86 | |
| 87 | ls -l `pwd`/${ASFDVR_TARBALL_FNAME} |
| 88 | echo "${ASFVOLT_REPO_NAME} package build complete" |