blob: 96de4ca289dbbad71ccfe5efd23625ac631e600c [file] [log] [blame]
Thiyagarajan Subramani4e62e172021-06-25 17:31:30 +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
19tar zxf /tmp/release_rlt-1600g-w_V*.tar.gz -C / 2>&1 > /dev/null
20
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
26rm -f /tmp/release_rlt-1600g-w_V*.tar.gz
27rm -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