blob: 25b782f0c79edce306c613264d8d4c6f977eae2c [file] [log] [blame]
Thiyagarajan Subramani3e8bfd92021-04-26 15:07:14 +05301#!/bin/bash
2
3#Copyright 2018-present Open Networking Foundation
4#
5#Licensed under the Apache License, Version 2.0 (the "License");
6#you may not use this file except in compliance with the License.
7#You may obtain a copy of the License at
8#
9#http://www.apache.org/licenses/LICENSE-2.0
10#
11#Unless required by applicable law or agreed to in writing, software
12#distributed under the License is distributed on an "AS IS" BASIS,
13#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14#See the License for the specific language governing permissions and
15#limitations under the License.
16
17rm -rf /opt/bcm686*
18rm -rf /broadcom
Thiyagarajan Subramania2c2c5a2021-05-18 14:47:52 +053019tar zxf /tmp/release_rlt-3200g-w_V*.tar.gz -C / 2>&1 > /dev/null
Thiyagarajan Subramani3e8bfd92021-04-26 15:07:14 +053020
21mkdir -p /opt/openolt && cp /tmp/watchdog/openolt_dev_mgmt_daemon_process_watchdog /opt/openolt && cp /tmp/watchdog/watchdog.config /opt/openolt
22
23sed -i -e '$i rm -rf \/tmp\/bcm68650_svk_init\/' /etc/rc.local
24[ -f /opt/openolt/openolt_dev_mgmt_daemon_process_watchdog ] && grep -q '\/opt\/openolt\/openolt_dev_mgmt_daemon_process_watchdog' /etc/rc.local || sed -i -e '$i nohup bash \/opt\/openolt\/openolt_dev_mgmt_daemon_process_watchdog &' /etc/rc.local
25
Thiyagarajan Subramania2c2c5a2021-05-18 14:47:52 +053026rm -f /tmp/release_rlt-3200g-w_V*.tar.gz
Thiyagarajan Subramani3e8bfd92021-04-26 15:07:14 +053027rm -f /run/bcm686*
28
29
30mv /tmp/openolt /broadcom
31mv /tmp/libz.so.1 /usr/local/lib
32mv /tmp/libstdc++.so.6 /usr/local/lib
33mv /tmp/libbal_host_api.so /usr/local/lib
34
35cp /tmp/logrotate.d/openolt /etc/logrotate.d
36chmod +x /opt/openolt/openolt_dev_mgmt_daemon_process_watchdog
37
38cp /tmp/init.d/dev_mgmt_daemon /etc/init.d
39chmod +x /etc/init.d/dev_mgmt_daemon
40update-rc.d dev_mgmt_daemon defaults
41[ "A`cat ~/.bashrc| grep LD_LIBRARY_PATH`" = "A" ] && echo "export LD_LIBRARY_PATH=/broadcom:\$LD_LIBRARY_PATH" >> ~/.bashrc; . ~/.bashrc
42ldconfig /broadcom
43ln -s /broadcom/libbal_core_real.*.so /broadcom/libbal_core.so
44#cd /broadcom/ && export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/broadcom && ./dev_mgmt_daemon -d -pcie
45service dev_mgmt_daemon start
46echo "Wait for 30 sec for BAL to be ready"
47sleep 30
48
49cp /tmp/init.d/openolt /etc/init.d
50chmod +x /etc/init.d/openolt
51update-rc.d openolt defaults
52service openolt start