Upgrade BAL version to 3.4.7.5
Fix watchdog script - fetch vlan-ids from the config file before trying to reference it
Release 2.5.1

Change-Id: I5e131c7d247cca0512ff94c57343a9a89297cf5d
diff --git a/.gitreview b/.gitreview
index 84dc7a2..84a1a00 100644
--- a/.gitreview
+++ b/.gitreview
@@ -3,3 +3,4 @@
 port=29418
 project=openolt.git
 defaultremote=origin
+defaultbranch=voltha-2.5
diff --git a/README.md b/README.md
index 1196f73..2fe1330 100644
--- a/README.md
+++ b/README.md
@@ -55,13 +55,13 @@
 `/ASXvOLT16/OpenOLT_Agent/From_ONF_Distribution/` and pick the right version of
 `.deb` package required for your testing.
 
-`voltha-2.3/openolt_<OPENOLTDEVICE>-2.3.0-<Last Commit ID>.deb` is the latest version of package with support
-for BAL v3.4.3.3 .
+`voltha-2.5/openolt_<OPENOLTDEVICE>-2.5.0-<GIT Commit ID>.deb` is the latest version of package with support
+for BAL v3.4.7.5 .
 
 The pre-built debian packages have been tested on [Open Networking Linux
 (ONL)](http://opennetlinux.org/) version 4.14. The ONL Installer required for
-`voltha-2.3/openolt_<OPENOLTDEVICE>-2.3.0-<Last Commit ID>.deb` is also available at in the same path, i.e.,
-voltha-2.3/.
+`voltha-2.5/openolt_<OPENOLTDEVICE>-2.5.0-<GIT Commit ID>.deb` is also available at in the same path, i.e.,
+voltha-2.5/.
 
 ## Install OpenOLT
 
@@ -74,10 +74,10 @@
 Install the *openolt.deb* package using *dpkg*:
 
 ```shell
-dpkg -i openolt_<OPENOLTDEVICE>-2.3.0-<Last Commit ID>.deb
+dpkg -i openolt_<OPENOLTDEVICE>-2.5.0-<GIT Commit ID>.deb
 ```
 
-The ONL version required for BAL v3.4.3.3 is ONL `4.14.151-OpenNetworkLinux`. This
+The ONL version required for BAL v3.4.7.5 is ONL `4.14.151-OpenNetworkLinux`. This
 will be built as part of build procedure described `Build OpenOLT` section.
 
 ## Run OpenOLT as a Linux service
@@ -204,7 +204,7 @@
 We have created custom td-agent configuration file to handle format of involved log files using right input plugins and elasticsearch output plugin.
 
 Copy the custom config file from [here](https://github.com/opencord/openolt/tree/master/logConf) in the `~` directory of the olt.
-Then into the `/etc` folder in order for the agent to pick it up. 
+Then into the `/etc` folder in order for the agent to pick it up.
 
 ```shell
 cp td-agent.conf /etc/td-agent.conf
@@ -235,7 +235,7 @@
 
 ### Supported BAL API versions
 
-Currently, OpenOLT supports Broadcom's BAL API, version *3.4.3.3*.
+Currently, OpenOLT supports Broadcom's BAL API, version *3.4.7.5*.
 
 ### Proprietary software requirements
 
@@ -247,9 +247,9 @@
 
 The versions currently supported by the OpenOLT agent are:
 
-* `SW-BCM686OLT_3_4_3_3.tgz`
+* `SW-BCM686OLT_3_4_7_5.tgz`
 * `sdk-all-6.5.13.tar.gz`
-* `ACCTON_BAL_3.4.3.3-V202002100101.patch`
+* `ACCTON_BAL_3.4.7.5-V202008030101_rate_limiting_fixed.patch`. This is downloadable from the common CSP CS00003233745. Rename this file as `ACCTON_BAL_3.4.7.5-V202008030101.patch`
 
 > NOTE: the repository does not contain the above three source packages.  These
 > are needed to build the OpenOLT agent executable. Contact [Dave Baron at
@@ -263,23 +263,36 @@
 
 Memory: 6GB
 
-Storage: 40GB of free space.
+Storage: 50GB of free space.
 
 **Software** :
 
-1. OpenOLT agent builds on *Ubuntu 16.04 LTS*.
+1. OpenOLT agent builds on *Debian GNU/Linux 8.11 (jessie)* or *Ubuntu 16.04 LTS*
 
 2. At least 4G of ram and 4G of swap -  compilation is memory intensive
 
 3. Essential tools for building packages
 
-   `sudo apt-get install build-essential ccache`
+   `apt-get install -y git pkg-config build-essential autoconf libgflags-dev clang libc++-dev unzip libssl-dev gawk debhelper debhelper dh-systemd init-system-helpers curl cmake ccache g++-4.9 wget ca-certificates lcov docker.io`
 
 4. Install cmake version 3.5.0 or above. Download cmake-3.5.0.tar.gz and untar
    it, then in the cmake-3.5.0 directory install by running:
 
    `./bootstrap && make && make install`
 
+5. Install gRPC version v1.27.1
+
+``` shell
+cd /tmp && git clone -b v1.27.1  https://github.com/grpc/grpc /tmp/grpc
+cd /tmp/grpc && git submodule update --init
+cd /tmp/grpc/third_party/protobuf && ./autogen.sh && ./configure
+make && make install && ldconfig
+cd /tmp/grpc && make && make install && ldconfig
+rm -rf /tmp/grpc
+```
+
+Note: Make sure you are using g++-4.9 as the default g++ compiler version on your build system. The grpc libraries and openolt agent code has to be compiled with this g++ version.
+
 ### Build procedure
 
 Clone the `openolt` repository either from OpenCORD Gerrit:
@@ -292,7 +305,7 @@
 
 ```shell
 cd <dir containing Broadcom source and patch files>
-cp ACCTON_BAL_3.4.3.3-V202002100101.patch SW-BCM686OLT_3_4_3_3.tgz sdk-all-6.5.13.tar.gz <cloned openolt repo path>/agent/download
+cp ACCTON_BAL_3.4.7.5-V202008030101.patch SW-BCM686OLT_3_4_7_5.tgz sdk-all-6.5.13.tar.gz <cloned openolt repo path>/agent/download
 ```
 
 Run the configure script to generate the appropriate Makefile scaffolding for
diff --git a/VERSION b/VERSION
index 437459c..4fd0fe3 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.5.0
+2.5.1
\ No newline at end of file
diff --git a/agent/Makefile.in b/agent/Makefile.in
index 32e4c62..8faa11d 100644
--- a/agent/Makefile.in
+++ b/agent/Makefile.in
@@ -28,12 +28,12 @@
 # ACCTON_BAL_<BAL_VER>-<DEV_VER>.patch - Accton/Edgecore's patch.
 BAL_MAJOR_VER = 3
 BAL_MINOR_VER = 4
-BAL_REV_A_VER = 3
-BAL_REV_B_VER = 3
+BAL_REV_A_VER = 7
+BAL_REV_B_VER = 5
 BAL_API_VER = $(BAL_MAJOR_VER).$(BAL_MINOR_VER).$(BAL_REV_A_VER).$(BAL_REV_B_VER)
 BAL_VER = $(BAL_MAJOR_VER).$(BAL_MINOR_VER).$(BAL_REV_A_VER).$(BAL_REV_B_VER)
 SDK_VER = 6.5.13
-DEV_VER ?= 202002100101
+DEV_VER ?= 202008030101
 #
 # Version of Open Network Linux (ONL).
 ONL_KERN_VER_MAJOR = 4.14
diff --git a/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst b/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst
index 50e8d89..845ecf6 100644
--- a/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst
+++ b/agent/device/asfvolt16/mkdebian/debian/asfvolt16.postinst
@@ -17,7 +17,7 @@
 
 rm -rf /opt/bcm68620
 rm -rf /broadcom
-tar zxf /tmp/release_asfvolt16_V3.4.3.3.202002100101.tar.gz -C / 2>&1 > /dev/null
+tar zxf /tmp/release_asfvolt16_V3.4.7.5.202008030101.tar.gz -C / 2>&1 > /dev/null
 grep -q '\/opt\/bcm68620\/svk_init.sh' /etc/rc.local || sed -i -e '$i \/opt\/bcm68620\/svk_init.sh' /etc/rc.local
 rm -f /run/bcm68620
 mkdir -p /opt/openolt && cp /tmp/watchdog/openolt_dev_mgmt_daemon_process_watchdog /opt/openolt && cp /tmp/watchdog/watchdog.config /opt/openolt
diff --git a/agent/device/asfvolt16/mkdebian/debian/changelog b/agent/device/asfvolt16/mkdebian/debian/changelog
index 3409fb4..024f6b6 100644
--- a/agent/device/asfvolt16/mkdebian/debian/changelog
+++ b/agent/device/asfvolt16/mkdebian/debian/changelog
@@ -1,6 +1,6 @@
-asfvolt16 (3.4.3.3+edgecore-V202002100101) stable; urgency=high
+asfvolt16 (3.4.7.5+edgecore-V202008030101) stable; urgency=high
 
-    * Based on code from SW-BCM686OLT_3_4_3_3.tgz.
-    * Merged the Accton's fixed to ACCTON_BAL_3.4.3.3-V202002100101.patch.
+    * Based on code from SW-BCM686OLT_3_4_7_5.tgz.
+    * Merged the Accton's fixed to ACCTON_BAL_3.4.7.5-V202008030101.patch.
 
  -- Jason Huang <jasonsc_huang@edge-core.com>  Mon, 10 FEB 2020 01:01:03 +0800
diff --git a/agent/device/asfvolt16/mkdebian/debian/control b/agent/device/asfvolt16/mkdebian/debian/control
index ca4f431..abacf17 100644
--- a/agent/device/asfvolt16/mkdebian/debian/control
+++ b/agent/device/asfvolt16/mkdebian/debian/control
@@ -9,5 +9,5 @@
 Architecture: amd64
 Depends: ${shlibs:Depends}
 Description: Broadcom OLT drivers,CLI
-  ported from Broadcom SDK-3.4.3.3 package
+  ported from Broadcom SDK-3.4.7.5 package
 
diff --git a/agent/device/asfvolt16/mkdebian/debian/files b/agent/device/asfvolt16/mkdebian/debian/files
index a5d466e..8ce7e13 100644
--- a/agent/device/asfvolt16/mkdebian/debian/files
+++ b/agent/device/asfvolt16/mkdebian/debian/files
@@ -1 +1 @@
-asfvolt16_3.4.3.3+edgecore-V202002100101_amd64.deb misc optional
+asfvolt16_3.4.7.5+edgecore-V202008030101_amd64.deb misc optional
diff --git a/agent/device/asfvolt16/mkdebian/debian/rules b/agent/device/asfvolt16/mkdebian/debian/rules
index 0869afa..199bdb4 100755
--- a/agent/device/asfvolt16/mkdebian/debian/rules
+++ b/agent/device/asfvolt16/mkdebian/debian/rules
@@ -26,7 +26,7 @@
 
 override_dh_auto_install: 
 	mkdir -p $(DEB_DH_INSTALL_SOURCEDIR)/tmp
-	cp -a $(CURDIR)/debian/release_asfvolt16_V3.4.3.3.202002100101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
+	cp -a $(CURDIR)/debian/release_asfvolt16_V3.4.7.5.202008030101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libgrpc++.so.1 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libgrpc.so.6 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libstdc++.so.6 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
diff --git a/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst b/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst
index 6ce8b44..558251a 100644
--- a/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst
+++ b/agent/device/asgvolt64/mkdebian/debian/asgvolt64.postinst
@@ -17,7 +17,7 @@
 
 rm -rf /opt/bcm68620
 rm -rf /broadcom
-tar zxf /tmp/release_asgvolt64_V3.4.3.3.202002100101.tar.gz -C / 2>&1 > /dev/null
+tar zxf /tmp/release_asgvolt64_V3.4.7.5.202008030101.tar.gz -C / 2>&1 > /dev/null
 grep -q '\/opt\/bcm68620\/svk_init.sh' /etc/rc.local || sed -i -e '$i \/opt\/bcm68620\/svk_init.sh' /etc/rc.local
 rm -f /run/bcm68620
 mkdir -p /opt/openolt && cp /tmp/watchdog/openolt_dev_mgmt_daemon_process_watchdog /opt/openolt && cp /tmp/watchdog/watchdog.config /opt/openolt
diff --git a/agent/device/asgvolt64/mkdebian/debian/changelog b/agent/device/asgvolt64/mkdebian/debian/changelog
index 119bf15..dd33956 100644
--- a/agent/device/asgvolt64/mkdebian/debian/changelog
+++ b/agent/device/asgvolt64/mkdebian/debian/changelog
@@ -1,6 +1,6 @@
-asgvolt64 (3.4.3.3+edgecore-V202002100101) stable; urgency=high
+asgvolt64 (3.4.7.5+edgecore-V202008030101) stable; urgency=high
 
-    * Based on code from SW-BCM686OLT_3_4_3_3.tgz.
-    * Merged the Accton's fixed to ACCTON_BAL_3.4.3.3-V202002100101.patch.
+    * Based on code from SW-BCM686OLT_3_4_7_5.tgz.
+    * Merged the Accton's fixed to ACCTON_BAL_3.4.7.5-V202008030101.patch.
 
  -- Jason Huang <jasonsc_huang@edge-core.com>  Mon, 10 FEB 2020 01:01:03 +0800
diff --git a/agent/device/asgvolt64/mkdebian/debian/control b/agent/device/asgvolt64/mkdebian/debian/control
index 872305f..e82223e 100644
--- a/agent/device/asgvolt64/mkdebian/debian/control
+++ b/agent/device/asgvolt64/mkdebian/debian/control
@@ -9,5 +9,5 @@
 Architecture: amd64
 Depends: ${shlibs:Depends}
 Description: Broadcom OLT drivers,CLI
-  ported from Broadcom SDK-3.4.3.3 package
+  ported from Broadcom SDK-3.4.7.5 package
 
diff --git a/agent/device/asgvolt64/mkdebian/debian/files b/agent/device/asgvolt64/mkdebian/debian/files
index 6724103..436e715 100644
--- a/agent/device/asgvolt64/mkdebian/debian/files
+++ b/agent/device/asgvolt64/mkdebian/debian/files
@@ -1 +1 @@
-asgvolt64_3.4.3.3+edgecore-V202002100101_amd64.deb misc optional
+asgvolt64_3.4.7.5+edgecore-V202008030101_amd64.deb misc optional
diff --git a/agent/device/asgvolt64/mkdebian/debian/rules b/agent/device/asgvolt64/mkdebian/debian/rules
index 561c092..ad85e4b 100755
--- a/agent/device/asgvolt64/mkdebian/debian/rules
+++ b/agent/device/asgvolt64/mkdebian/debian/rules
@@ -26,7 +26,7 @@
 
 override_dh_auto_install: 
 	mkdir -p $(DEB_DH_INSTALL_SOURCEDIR)/tmp
-	cp -a $(CURDIR)/debian/release_asgvolt64_V3.4.3.3.202002100101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
+	cp -a $(CURDIR)/debian/release_asgvolt64_V3.4.7.5.202008030101.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libgrpc++.so.1 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libgrpc.so.6 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libstdc++.so.6 $(DEB_DH_INSTALL_SOURCEDIR)/tmp
diff --git a/agent/scripts/watchdog/openolt_dev_mgmt_daemon_process_watchdog b/agent/scripts/watchdog/openolt_dev_mgmt_daemon_process_watchdog
index 45d9374..0dee07b 100755
--- a/agent/scripts/watchdog/openolt_dev_mgmt_daemon_process_watchdog
+++ b/agent/scripts/watchdog/openolt_dev_mgmt_daemon_process_watchdog
@@ -113,6 +113,7 @@
 monitor_openolt_and_dev_mgmt_daemon_process() {
     LOG "start monitor openolt and dev_mgmt_daemon processes"
 
+    get_vlan_ids
     if [ "${OLT_MODEL}" = ${ASF16_MODEL} ]; then
         INBAND_IF="eth2.${ASFVOLT16_VLAN_ID_ETH2}"
     else
@@ -123,7 +124,6 @@
     # elapsed since the shell started. We can reset to 0 and the timer
     # starts from here
     SECONDS=0
-    get_vlan_ids
     while true; do
 
         DEV_MGMT_DAEMON_PID=`pidof /broadcom/dev_mgmt_daemon`
diff --git a/agent/test/Makefile b/agent/test/Makefile
index 87f03a1..0272102 100644
--- a/agent/test/Makefile
+++ b/agent/test/Makefile
@@ -64,7 +64,7 @@
 
 export CXX CXXFLAGS OPENOLT_PROTO_VER
 
-BAL_API_VER ?= bal-api-3.4.3.3
+BAL_API_VER ?= bal-api-3.4.7.5
 BAL_API_DIR=$(BAL_API_VER)
 BALLIBNAME=bcm_host_api_stubs
 BALLIBDIR=$(BAL_API_DIR)/stubs