VOL-849: Initial changes to compile with BAL 2.6

The OPENOLT_BAL_2.6.0.1.patch file is required to compile this commit.
This patch file has been uploaded to the Broadcom common CS3233745.

Change-Id: I8dbaca0f56cdf6058603371e9c30d2ce6b04df40
diff --git a/Makefile b/Makefile
index a7e7477..e23fb7e 100644
--- a/Makefile
+++ b/Makefile
@@ -25,10 +25,10 @@
 # SW-BCM68620_<VER>.zip - Broadcom BAL source and Maple SDK.
 # sdk-all-<SDK_VER>.tar.gz - Broadcom Qumran SDK.
 # ACCTON_BAL_<BAL_VER>-<ACCTON_VER>.patch - Accton/Edgecore's patch.
-BAL_MAJOR_VER = 02.04
-BAL_VER = 2.4.3.6
+BAL_MAJOR_VER = 02.06
+BAL_VER = 2.6.0.1
 SDK_VER = 6.5.7
-ACCTON_VER = 201710131639
+ACCTON_VER = 201804301043
 #
 # Version of Open Network Linux (ONL).
 ONL_KERN_VER_MAJOR = 3.7
@@ -81,6 +81,32 @@
 	sudo make -C $(GRPC_DST)/third_party/protobuf install
 	sudo ldconfig
 
+	rm -rf /tmp/protobuf
+	git clone https://github.com/google/protobuf.git /tmp/protobuf
+	cd /tmp/protobuf && git submodule update --init --recursive && ./autogen.sh && ./configure
+	make -C /tmp/protobuf
+	sudo make -C /tmp/protobuf install
+	sudo ldconfig
+
+	# libunwind (needed by glog)
+	rm -rf /tmp/libunwind-1.2
+	wget http://download.savannah.nongnu.org/releases/libunwind/libunwind-1.2.tar.gz -P /tmp
+	cd /tmp && tar -xzvf libunwind-1.2.tar.gz
+	cd /tmp/libunwind-1.2 && ./configure
+	make -C /tmp/libunwind-1.2
+	sudo make -C /tmp/libunwind-1.2 install
+
+	# cmake (needed by glog)
+	sudo apt-get remove cmake cmake-data
+	sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
+	sudo -E apt-get update
+	sudo apt-get install -y cmake
+
+        # glog
+	rm -rf /tmp/glog
+	git clone https://github.com/google/glog.git /tmp/glog
+	cd /tmp/glog && cmake -H. -Bbuild -G "Unix Makefiles" && cmake --build build && sudo cmake --build build --target install
+
 ########################################################################
 ##
 ##
@@ -90,7 +116,6 @@
 ONL_KERN_VER = $(ONL_KERN_VER_MAJOR).$(ONL_KERN_VER_MINOR)
 ONL_REPO = $(DEVICE)-onl
 ONL_DIR = $(BUILD_DIR)/$(ONL_REPO)
-.PHONY: onl
 onl:
 	if [ ! -d "$(ONL_DIR)/OpenNetworkLinux" ]; then \
 		mkdir -p $(ONL_DIR); \
@@ -116,7 +141,7 @@
 ONL_KERNDIR = $(PWD)/$(ONL_DIR)/OpenNetworkLinux/packages/base/amd64/kernels/kernel-$(ONL_KERN_VER_MAJOR)-x86-64-all/builds
 MAPLE_KERNDIR = $(BAL_DIR)/bcm68620_release/$(DEVICE)/kernels
 BCM_SDK = $(BAL_DIR)/bal_release/3rdparty/bcm-sdk
-BALLIBDIR = $(BAL_DIR)/bal_release/build/core/lib
+BALLIBDIR = $(BAL_DIR)/bal_release/build/core/src/apps/bal_api_dist_shared_lib
 BALLIBNAME = bal_api_dist
 BAL_INC = -I$(BAL_DIR)/bal_release/src/common/os_abstraction \
 	-I$(BAL_DIR)/bal_release/src/common/os_abstraction/posix \
@@ -125,30 +150,23 @@
 	-I$(BAL_DIR)/bal_release/src/core/main \
 	-I$(BAL_DIR)/bal_release/src/common/include \
 	-I$(BAL_DIR)/bal_release/src/lib/libbalapi \
-	-I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/utils \
 	-I$(BAL_DIR)/bal_release/src/balapiend \
 	-I$(BAL_DIR)/bal_release/src/common/dev_log \
 	-I$(BAL_DIR)/bal_release/src/common/bal_dist_utils  \
 	-I$(BAL_DIR)/bal_release/src/lib/libtopology \
-	-I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/model \
-	-I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/api \
 	-I$(BAL_DIR)/bal_release/src/lib/libcmdline \
 	-I$(BAL_DIR)/bal_release/src/lib/libutils \
+	-I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/utils \
+	-I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/model \
+	-I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/api \
 	-I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_reference/cli
+#       -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_customized/os_abstraction
+#       -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_customized/os_abstraction/posix
+#       -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/config
 CXXFLAGS += $(BAL_INC) -I $(BAL_DIR)/lib/cmdline
-.PHONY: get-$(BAL_DIR)
-get-$(BAL_DIR):
-# if [ ! -e "download/$(BAL_ZIP)" ]; then \
-#   rm -rf /tmp/broadcom-proprietary; \
-#   git clone git@github.com:shadansari/broadcom-proprietary.git /tmp/broadcom-proprietary; \
-#   mv -f /tmp/broadcom-proprietary/$(BAL_VER)/$(BAL_ZIP) ./download; \
-#   mv -f /tmp/broadcom-proprietary/$(BAL_VER)/$(SDK_ZIP) ./download; \
-#   mv -f /tmp/broadcom-proprietary/$(BAL_VER)/$(ACCTON_PATCH) ./download; \
-#   mv -f /tmp/broadcom-proprietary/$(BAL_VER)/$(OPENOLT_BAL_PATCH) ./download; \
-#   rm -rf /tmp/broadcom-proprietary; \
-# fi;
-.PHONY: bal
-bal: onl get-$(BAL_DIR)
+CXXFLAGS += -DBCMOS_MSG_QUEUE_DOMAIN_SOCKET -DBCMOS_MSG_QUEUE_UDP_SOCKET -DBCMOS_MEM_CHECK -DBCMOS_SYS_UNITTEST
+
+sdk: onl
 ifeq ("$(wildcard $(BAL_DIR))","")
 	mkdir $(BAL_DIR)
 	unzip download/$(BAL_ZIP) -d $(BAL_DIR)
@@ -166,29 +184,17 @@
 	make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) switch_sdk
 	KERNDIR=$(ONL_KERNDIR)/linux-$(ONL_KERN_VER) BOARD=$(DEVICE) ARCH=x86_64 SDKBUILD=build_bcm_user make -C $(BCM_SDK)/build-$(DEVICE)/sdk-all-$(SDK_VER)/systems/linux/user/x86-generic_64-2_6
 	make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) bal
+	echo 'auto_create_interface_tm=y' >> $(BAL_DIR)/bal_release/3rdparty/maple/cur/$(DEVICE)/board_files/broadcom/bal_config.ini
 	make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) release_board
-	ln -s -f $(PWD)/$(BAL_DIR)/bcm68620_release/asfvolt16/release/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz .
-	ln -s -f $(PWD)/$(BAL_DIR)/bal_release/build/core/lib/libbal_api_dist.so .
-	ln -s -f $(PWD)/$(BAL_DIR)/bal_release/build/core/src/apps/bal_core_dist/bal_core_dist
-	mv -f release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz $(BUILD_DIR)
-	mv -f libbal_api_dist.so $(BUILD_DIR)
-	mv -f bal_core_dist $(BUILD_DIR)
 endif
-bal-rebuild:
-	make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) maple_sdk
-	make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) switch_sdk
-	KERNDIR=$(ONL_KERNDIR)/linux-$(ONL_KERN_VER) BOARD=$(DEVICE) ARCH=x86_64 SDKBUILD=build_bcm_user make -C $(BCM_SDK)/build-$(DEVICE)/sdk-all-$(SDK_VER)/systems/linux/user/x86-generic_64-2_6
+
+bal: sdk
 	make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) bal
+	echo 'auto_create_interface_tm=y' >> $(BAL_DIR)/bal_release/3rdparty/maple/cur/asfvolt16/board_files/broadcom/bal_config.ini
 	make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) release_board
-	ln -s -f $(PWD)/$(BAL_DIR)/bcm68620_release/asfvolt16/release/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz .
-	ln -s -f $(PWD)/$(BAL_DIR)/bal_release/build/core/lib/libbal_api_dist.so .
-	ln -s -f $(PWD)/$(BAL_DIR)/bal_release/build/core/src/apps/bal_core_dist/bal_core_dist .
-	mv -f release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz $(BUILD_DIR)
-	mv -f libbal_api_dist.so $(BUILD_DIR)
-	mv -f bal_core_dist $(BUILD_DIR)
-distclean-bal:
-	sudo rm -rf $(BAL_DIR)
-	rm -f build/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz
+
+bal-clean:
+	make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) clean_bal
 
 ########################################################################
 ##
@@ -199,7 +205,6 @@
 OPENOLT_PROTOS_DIR = ./protos
 OPENOLT_API_LIB = $(OPENOLT_PROTOS_DIR)/libopenoltapi.a
 CXXFLAGS += -I./$(OPENOLT_PROTOS_DIR) -I $(OPENOLT_PROTOS_DIR)/googleapis/gens
-.PHONY: protos
 protos:
 	make -C $(OPENOLT_PROTOS_DIR) all
 protos-clean:
@@ -216,41 +221,53 @@
 DEPS = $(SRCS:.cc=.d)
 .DEFAULT_GOAL := all
 all: $(BUILD_DIR)/openolt
-$(BUILD_DIR)/openolt: protos bal $(OBJS)
+$(BUILD_DIR)/openolt: sdk protos $(OBJS)
 	$(CXX) $(OBJS) $(LDFLAGS) $(OPENOLT_API_LIB) -o $@ -L$(BALLIBDIR) -l$(BALLIBNAME)
+	ln -sf $(PWD)/$(BAL_DIR)/bcm68620_release/$(DEVICE)/release/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz $(BUILD_DIR)/.
+	ln -sf $(PWD)/$(BAL_DIR)/bcm68620_release/$(DEVICE)/release/broadcom/libbal_api_dist.so $(BUILD_DIR)/.
+	ln -sf $(PWD)/$(BAL_DIR)/bal_release/build/core/src/apps/bal_core_dist/bal_core_dist $(BUILD_DIR)/.
 	ln -sf $(shell ldconfig -p | grep libgrpc.so.6 | tr ' ' '\n' | grep /) $(BUILD_DIR)/libgrpc.so.6
 	ln -sf $(shell ldconfig -p | grep libgrpc++.so.1 | tr ' ' '\n' | grep /) $(BUILD_DIR)/libgrpc++.so.1
 	ln -sf $(shell ldconfig -p | grep libgrpc++_reflection.so.1 | tr ' ' '\n' | grep /) $(BUILD_DIR)/libgrpc++_reflection.so.1
 
 deb:
-	rm -f *.deb
-	cp $(BUILD_DIR)/*.tar.gz mkdebian/debian/release_asfvolt16.tar.gz
+	cp $(BUILD_DIR)/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz mkdebian/debian
 	cp $(BUILD_DIR)/openolt mkdebian/debian
 	cp $(BUILD_DIR)/libgrpc.so.6 mkdebian/debian
 	cp $(BUILD_DIR)/libgrpc++.so.1 mkdebian/debian
 	cp $(BUILD_DIR)/libgrpc++_reflection.so.1 mkdebian/debian
-	cd mkdebian && ./build_asfvolt16_deb.sh
+	cd mkdebian && ./build_$(DEVICE)_deb.sh
 	mv *.deb $(BUILD_DIR)/openolt.deb
+	make deb-cleanup
 
 src/%.o: %.cpp
 	$(CXX) -MMD -c $< -o $@
 
-deb-clean:
-	rm -f $(BUILD_DIR)/*.deb
-	rm -f mkdebian/debian/asfvolt16.debhelper.log
-	rm -f mkdebian/debian/asfvolt16.postinst.debhelper
-	rm -f mkdebian/debian/asfvolt16.postrm.debhelper
-	rm -rf mkdebian/debian/asfvolt16/
+deb-cleanup:
+	rm -f mkdebian/debian/$(DEVICE).debhelper.log
+	rm -f mkdebian/debian/$(DEVICE).postinst.debhelper
+	rm -f mkdebian/debian/$(DEVICE).postrm.debhelper
+	rm -f mkdebian/debian/$(DEVICE).substvars
+	rm -rf mkdebian/debian/$(DEVICE)/
 	rm -f mkdebian/debian/libgrpc++.so.1
 	rm -f mkdebian/debian/libgrpc++_reflection.so.1
 	rm -f mkdebian/debian/libgrpc.so.6
 	rm -f mkdebian/debian/openolt
-	rm -f mkdebian/debian/release_asfvolt16.tar.gz
+	rm -f mkdebian/debian/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz
 	rm -rf mkdebian/debian/tmp/
+	rm -f $(DEVICE)_$(BAL_VER)+edgecore-V$(ACCTON_VER)_amd64.changes
 
-clean: protos-clean
+clean: protos-clean deb-cleanup
 	rm -f $(OBJS) $(DEPS)
+	rm -rf protos/googleapis
 	rm -f $(BUILD_DIR)/libgrpc.so.6 $(BUILD_DIR)/libgrpc++.so.1 $(BUILD_DIR)/libgrpc++_reflection.so.1
+	rm -f $(BUILD_DIR)/libbal_api_dist.so
+	rm -f $(BUILD_DIR)/openolt
+	rm -f $(BUILD_DIR)/bal_core_dist
+	rm -f $(BUILD_DIR)/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz
+	rm -f $(BUILD_DIR)/openolt.deb
 
 distclean:
 	rm -rf $(BUILD_DIR)
+
+.PHONY: onl sdk bal protos prereq
diff --git a/README.md b/README.md
index b60e40c..71511af 100644
--- a/README.md
+++ b/README.md
@@ -131,10 +131,10 @@
 
 The versions currently supported by the OpenOLT driver are:
 
-* SW-BCM68620_2_4_3_6.zip
+* SW-BCM68620_2_6_0_1.zip
 * sdk-all-6.5.7.tar.gz
-* ACCTON_BAL_2.4.3.6-V201710131639.patch
-* OPENOLT_BAL_2.4.3.6.patch
+* ACCTON_BAL_2.6.0.1-V201804301043.patch
+* OPENOLT_BAL_2.6.0.1.patch
 
 > NOTE: the repository does not contain the above four source packages.  These
 > are needed to build the OpenOLT driver executable. Contact
diff --git a/mkdebian/debian/asfvolt16.postinst b/mkdebian/debian/asfvolt16.postinst
index f4a7f56..c19fb79 100644
--- a/mkdebian/debian/asfvolt16.postinst
+++ b/mkdebian/debian/asfvolt16.postinst
@@ -1,21 +1,13 @@
 #!/bin/bash
 
-# Extract BAL driver
-tar zxf /tmp/release_asfvolt16.tar.gz -C / 2>&1 > /dev/null
-
-# Copy OpenOLT folder
+rm -rf /opt/bcm68620
+rm -rf /broadcom
+tar zxf /tmp/release_asfvolt16_V02.06.201804301043.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
 mv /tmp/openolt /broadcom
-
-# Copy libraries
 mv /tmp/libgrpc++_reflection.so.1 /usr/local/lib
 mv /tmp/libgrpc++.so.1 /usr/local/lib
 mv /tmp/libgrpc.so.6 /usr/local/lib
 mv /broadcom/libbal_api_dist.so /usr/local/lib
-
-# Init file
-#mv /tmp/voltha_init.sh /broadcom
-grep -q '\/opt\/bcm68620\/svk_init.sh' /etc/rc.local || sed -i -e '$i \/opt\/bcm68620\/svk_init.sh' /etc/rc.local
-
-source /root/.bashrc
-cd /broadcom && /sbin/ldconfig
-/opt\/bcm68620\/svk_init.sh
+/opt/bcm68620/svk_init.sh
diff --git a/mkdebian/debian/asfvolt16.postrm b/mkdebian/debian/asfvolt16.postrm
index 4c2469f..64bde5b 100644
--- a/mkdebian/debian/asfvolt16.postrm
+++ b/mkdebian/debian/asfvolt16.postrm
@@ -1,15 +1,10 @@
 #!/bin/bash
 
 rm -rf /opt/bcm68620
-rm -rf /run/bcm68620
-
 rm -rf /broadcom
-
+sed -i '\/opt\/bcm68620\/svk_init.sh/d' /etc/rc.local
+rm -rf /run/bcm68620
 rm -rf /usr/local/lib/libgrpc++_reflection.so.1
 rm -rf /usr/local/lib/libgrpc++.so.1
 rm -rf /usr/local/lib/libgrpc.so.6
 rm -rf /usr/local/lib/libbal_api_dist.so
-
-# Remove init scripts
-sed -i '\/opt\/bcm68620\/svk_init.sh/d' /etc/rc.local
-# sed -i '\/broadcom\/voltha_init.sh/d' /etc/rc.local
diff --git a/mkdebian/debian/asfvolt16.preinst b/mkdebian/debian/asfvolt16.preinst
index 3ff3ca5..6660aaa 100644
--- a/mkdebian/debian/asfvolt16.preinst
+++ b/mkdebian/debian/asfvolt16.preinst
@@ -2,7 +2,10 @@
 
 # kill CLI applications
 echo "kill running time application"
+[ -n "`pidof bcm_user_appl`" ] && killall bcm_user_appl
+[ -n "`pidof bcm.user`" ] && killall bcm.user
 [ -n "`pidof bal_core_dist`" ] && killall bal_core_dist 
+[ -n "`pidof voltha_bal_driver`" ] && killall voltha_bal_driver
 [ -n "`pidof openolt`" ] && killall openolt
 
 # unload drivers
@@ -10,6 +13,8 @@
 [ -n "`lsmod | grep bcm_coop_dba_linux`" ] && rmmod bcm_coop_dba_linux && sleep 1
 [ -n "`lsmod | grep bcm_dev_ctrl_linux`" ] &&  rmmod bcm_dev_ctrl_linux && sleep 1
 [ -n "`lsmod | grep i2c_devs`" ] && rmmod i2c_devs && sleep 1
+[ -n "`lsmod | grep trmux`" ] && rmmod trmux && sleep 1
+[ -n "`lsmod | grep fld`" ] && rmmod fld && sleep 1
 [ -n "`lsmod | grep os_linux`" ] && rmmod os_linux && sleep 1
 [ -n "`lsmod | grep ll_pcie`" ] && rmmod ll_pcie && sleep 1
 [ -n "`lsmod | grep linux_user_bde`" ] && rmmod linux-user-bde && sleep 1
diff --git a/mkdebian/debian/changelog b/mkdebian/debian/changelog
index 286153c..3969177 100644
--- a/mkdebian/debian/changelog
+++ b/mkdebian/debian/changelog
@@ -1,8 +1,10 @@
-asfvolt16 (2.4.3.6+accton1.1-0) stable; urgency=high

-

-    * Added Pre-emphasis adjustment on the Qumran

-    * Added Qumran LED function

-    * Patch file name: ACCTON_BAL_2.4.6.10-V201711151812.patch

-

- -- Jason Huang <jasonsc_huang@edge-core.com>  Thu, 15 Nov 2017 18:12:32 +0800

-

+asfvolt16 (2.6.0.1+edgecore-V201804301043) stable; urgency=high
+
+    * Based on code from SW-BCM68620_2_6_0_1.zip.
+    * Merged the Accton's fixed done in ACCTON_BAL_2.4.7.12-V201712061142.patch.
+    * To increase the stack size to 2M to avoid segment fault while init bcm.user code.
+    * To modify the BALAPI_OPER_TIMEOUT from 5 to 10 seconds to avoid timeout warning message.
+    * Patch file name: ACCTON_BAL_2.6.0.1-V201804301043.patch
+
+ -- Jason Huang <jasonsc_huang@edge-core.com>  Thu, 31 May 2018 10:36:32 +0800
+
diff --git a/mkdebian/debian/control b/mkdebian/debian/control
index dd12b49..c68f14e 100644
--- a/mkdebian/debian/control
+++ b/mkdebian/debian/control
@@ -8,6 +8,6 @@
 Package: asfvolt16
 Architecture: amd64
 Depends: ${shlibs:Depends}
-Description: Broadcom OLT drivers and CLI
-  ported from Broadcom SDK-2.4.3.6 package
+Description: Broadcom OLT drivers,CLI
+  ported from Broadcom SDK-2.6.0.1 package
 
diff --git a/mkdebian/debian/files b/mkdebian/debian/files
index 33ff7dc..4061fba 100644
--- a/mkdebian/debian/files
+++ b/mkdebian/debian/files
@@ -1 +1 @@
-asfvolt16_2.4.3.6+accton1.1-0_amd64.deb misc optional
+asfvolt16_2.6.0.1+edgecore-V201804301043_amd64.deb misc optional
diff --git a/mkdebian/debian/rules b/mkdebian/debian/rules
index b2906d4..c785567 100755
--- a/mkdebian/debian/rules
+++ b/mkdebian/debian/rules
@@ -26,14 +26,14 @@
 
 override_dh_auto_install: 
 	mkdir -p $(DEB_DH_INSTALL_SOURCEDIR)/tmp
-	cp -a $(CURDIR)/debian/release_asfvolt16.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
+	cp -a $(CURDIR)/debian/release_asfvolt16_V02.06.201804301043.tar.gz $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 	cp -a $(CURDIR)/debian/libgrpc++_reflection.so.1 $(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/openolt $(DEB_DH_INSTALL_SOURCEDIR)/tmp
 
-override_dh_shlibdeps:
-	dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info -l$(ONLP_LIB_PATH):$(OFDPA_LIB_PATH)
+#override_dh_shlibdeps:
+#	dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info -l$(ONLP_LIB_PATH):$(OFDPA_LIB_PATH)
 
 # avoid auto strip for debug ofagentapp.dbg
 #
@@ -69,4 +69,3 @@
 	@echo ONLP_LIB_PATH=$(ONLP_LIB_PATH)
 #	@echo OFDPA_LIB_PATH=$(OFDPA_LIB_PATH)
 #	@echo OFDPA_BIN_PATH=$(OFDPA_BIN_PATH)
-
diff --git a/src/core.cc b/src/core.cc
index b5fe90d..c77048c 100644
--- a/src/core.cc
+++ b/src/core.cc
@@ -92,9 +92,14 @@
     memcpy(serial_num.vendor_specific, vendor_specific, 4);
     BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, serial_number, serial_num);
 
+#if 0
+    // Commenting out as this is causing issues with onu activation
+    // with BAL 2.6 (Broadcom CS5248819).
+
     // FIXME - Use a default (all zeros) registration id.
     memset(registration_id.arr, 0, sizeof(registration_id.arr));
     BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, registration_id, registration_id);
+#endif
 
     BCMBAL_CFG_PROP_SET(&sub_term_obj, subscriber_terminal, admin_state, BCMBAL_STATE_UP);
 
diff --git a/src/indications.cc b/src/indications.cc
index 7346772..3f49fcb 100644
--- a/src/indications.cc
+++ b/src/indications.cc
@@ -39,8 +39,8 @@
     openolt::OltIndication* olt_ind = new openolt::OltIndication;
     Status status;
 
-    bcmbal_access_terminal_ind *acc_term_ind = (bcmbal_access_terminal_ind *)obj;
-    if (acc_term_ind->data.oper_status == BCMBAL_STATUS_UP) {
+    bcmbal_access_terminal_oper_status_change *acc_term_ind = (bcmbal_access_terminal_oper_status_change *)obj;
+    if (acc_term_ind->data.new_oper_status == BCMBAL_STATUS_UP) {
         olt_ind->set_oper_state("up");
         start_collecting_statistics();
     } else {
@@ -51,6 +51,7 @@
     std::cout << "olt indication, oper_state:" << ind.olt_ind().oper_state() << std::endl;
     oltIndQ.push(ind);
 
+#define MAX_SUPPORTED_INTF 16
     // Enable all PON interfaces.
     for (int i = 0; i < MAX_SUPPORTED_INTF; i++) {
         status = EnablePonIf_(i);
@@ -87,10 +88,10 @@
     openolt::IntfIndication* intf_ind = new openolt::IntfIndication;
 
     std::cout << "intf indication, intf_id:"
-              << ((bcmbal_interface_ind *)obj)->key.intf_id << std::endl;
+              << ((bcmbal_interface_oper_status_change *)obj)->key.intf_id << std::endl;
 
-    intf_ind->set_intf_id(((bcmbal_interface_ind *)obj)->key.intf_id);
-    if (((bcmbal_interface_ind *)obj)->data.oper_status == BCMBAL_STATUS_UP) {
+    intf_ind->set_intf_id(((bcmbal_interface_oper_status_change *)obj)->key.intf_id);
+    if (((bcmbal_interface_oper_status_change *)obj)->data.new_oper_status == BCMBAL_STATUS_UP) {
         intf_ind->set_oper_state("up");
     } else {
         intf_ind->set_oper_state("down");
@@ -211,29 +212,22 @@
 bcmos_errno OnuIndication(bcmbal_obj *obj) {
     openolt::Indication ind;
     openolt::OnuIndication* onu_ind = new openolt::OnuIndication;
-    openolt::SerialNumber* serial_number = new openolt::SerialNumber;
 
     bcmbal_subscriber_terminal_key *key =
-        &(((bcmbal_subscriber_terminal_ind*)obj)->key);
+        &(((bcmbal_subscriber_terminal_oper_status_change*)obj)->key);
 
-    bcmbal_subscriber_terminal_ind_data *data =
-        &(((bcmbal_subscriber_terminal_ind*)obj)->data);
-
-    bcmbal_serial_number *in_serial_number = &(data->serial_number);
+    bcmbal_subscriber_terminal_oper_status_change_data *data =
+        &(((bcmbal_subscriber_terminal_oper_status_change*)obj)->data);
 
     std::cout << "onu indication, intf_id:"
          << key->intf_id
-         << " serial_number:"
-         << serial_number_to_str(in_serial_number)
-         << " oper_state:" << data->oper_status
-         << " admin_state:" << data->admin_state << std::endl;
+         << " oper_state:" << data->new_oper_status
+         << " admin_state:" << data->admin_state
+         << " onu_id:" << key->sub_term_id << std::endl;
 
     onu_ind->set_intf_id(key->intf_id);
     onu_ind->set_onu_id(key->sub_term_id);
-    serial_number->set_vendor_id(reinterpret_cast<const char *>(in_serial_number->vendor_id), 4);
-    serial_number->set_vendor_specific(reinterpret_cast<const char *>(in_serial_number->vendor_specific), 8);
-    onu_ind->set_allocated_serial_number(serial_number);
-    if (data->oper_status == BCMBAL_STATE_UP) {
+    if (data->new_oper_status == BCMBAL_STATE_UP) {
         onu_ind->set_oper_state("up");
     } else {
         onu_ind->set_oper_state("down");
@@ -378,7 +372,7 @@
 
     /* OLT device indication */
     cb_cfg.obj_type = BCMBAL_OBJ_ID_ACCESS_TERMINAL;
-    ind_subgroup = bcmbal_access_terminal_auto_id_ind;
+    ind_subgroup = bcmbal_access_terminal_auto_id_oper_status_change;
     cb_cfg.p_subgroup = &ind_subgroup;
     cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)OltIndication;
     if (BCM_ERR_OK != bcmbal_subscribe_ind(DEFAULT_ATERM_ID, &cb_cfg)) {
@@ -396,7 +390,7 @@
 
     /* Interface indication */
     cb_cfg.obj_type = BCMBAL_OBJ_ID_INTERFACE;
-    ind_subgroup = bcmbal_interface_auto_id_ind;
+    ind_subgroup = bcmbal_interface_auto_id_oper_status_change;
     cb_cfg.p_subgroup = &ind_subgroup;
     cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)IfIndication;
     if (BCM_ERR_OK != bcmbal_subscribe_ind(DEFAULT_ATERM_ID, &cb_cfg)) {
@@ -441,7 +435,7 @@
 
     /* onu indication */
     cb_cfg.obj_type = BCMBAL_OBJ_ID_SUBSCRIBER_TERMINAL;
-    ind_subgroup = bcmbal_subscriber_terminal_auto_id_ind;
+    ind_subgroup = bcmbal_subscriber_terminal_auto_id_oper_status_change;
     cb_cfg.p_subgroup = &ind_subgroup;
     cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)OnuIndication;
     if (BCM_ERR_OK != bcmbal_subscribe_ind(DEFAULT_ATERM_ID, &cb_cfg)) {
@@ -473,6 +467,7 @@
     if (BCM_ERR_OK != bcmbal_subscribe_ind(DEFAULT_ATERM_ID, &cb_cfg)) {
         return Status(grpc::StatusCode::INTERNAL, "Flow operational state change indication subscribe failed");
     }
+#if 0
     /* Flow Indication */
     cb_cfg.obj_type = BCMBAL_OBJ_ID_FLOW;
     ind_subgroup = bcmbal_flow_auto_id_ind;
@@ -490,16 +485,18 @@
     if (BCM_ERR_OK != bcmbal_subscribe_ind(DEFAULT_ATERM_ID, &cb_cfg)) {
         return Status(grpc::StatusCode::INTERNAL, "Traffic mgmt queue indication subscribe failed");
     }
+#endif
 
     /* TM sched indication */
     cb_cfg.obj_type = BCMBAL_OBJ_ID_TM_SCHED;
-    ind_subgroup = bcmbal_tm_sched_auto_id_ind;
+    ind_subgroup = bcmbal_tm_sched_auto_id_oper_status_change;
     cb_cfg.p_subgroup = &ind_subgroup;
     cb_cfg.ind_cb_hdlr = (f_bcmbal_ind_handler)TmSchedIndication;
     if (BCM_ERR_OK != bcmbal_subscribe_ind(DEFAULT_ATERM_ID, &cb_cfg)) {
         return Status(grpc::StatusCode::INTERNAL, "Traffic mgmt queue indication subscribe failed");
     }
 
+#if 0
     /* Multicast group indication */
     cb_cfg.obj_type = BCMBAL_OBJ_ID_GROUP;
     ind_subgroup = bcmbal_group_auto_id_ind;
@@ -508,6 +505,7 @@
     if (BCM_ERR_OK != bcmbal_subscribe_ind(DEFAULT_ATERM_ID, &cb_cfg)) {
         return Status(grpc::StatusCode::INTERNAL, "Multicast group indication subscribe failed");
     }
+#endif
 
     subscribed = true;
 
diff --git a/src/main.cc b/src/main.cc
index 7d02bbc..3c05489 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -28,10 +28,12 @@
 
 int main(int argc, char** argv) {
 
+/*
     if (argc < 5) {
         std::cout << "Missing arguments" << std::endl;
         exit(1);
     }
+*/
 
     bcmbal_init(argc, argv, NULL);
 
diff --git a/src/stats_collection.cc b/src/stats_collection.cc
index de11c72..5ec33bc 100644
--- a/src/stats_collection.cc
+++ b/src/stats_collection.cc
@@ -60,6 +60,7 @@
     return port_stats;
 }
 
+#if 0
 openolt::FlowStatistics* get_default_flow_statistics() {
     openolt::FlowStatistics* flow_stats = new openolt::FlowStatistics;
     flow_stats->set_flow_id(-1);
@@ -70,6 +71,7 @@
 
     return flow_stats;
 }
+#endif
 
 openolt::PortStatistics* collectPortStatistics(int intf_id, bcmbal_intf_type intf_type) {
 
@@ -119,6 +121,7 @@
 
 }
 
+#if 0
 openolt::FlowStatistics* collectFlowStatistics(bcmbal_flow_id flow_id, bcmbal_flow_type flow_type) {
 
     bcmos_errno err;
@@ -156,6 +159,7 @@
 
     return flow_stats;
 }
+#endif
 
 
 void* stats_collection(void* x) {
diff --git a/src/stats_collection.h b/src/stats_collection.h
index b76d335..6f892b7 100644
--- a/src/stats_collection.h
+++ b/src/stats_collection.h
@@ -12,8 +12,10 @@
 void stop_collecting_statistics();
 openolt::PortStatistics* get_default_port_statistics();
 openolt::PortStatistics* collectPortStatistics(int intf_id, bcmbal_intf_type intf_type);
+#if 0
 openolt::FlowStatistics* get_default_flow_statistics();
 openolt::FlowStatistics* collectFlowStatistics(bcmbal_flow_id flow_id, bcmbal_flow_type flow_type);
+#endif
 void* stats_collection(void* x);
 void register_new_flow(bcmbal_flow_key key);