Thiyagarajan Subramani | 4e62e17 | 2021-06-25 17:31:30 +0530 | [diff] [blame] | 1 | #!/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 | |
| 17 | rm -rf /opt/bcm686* |
| 18 | rm -rf /broadcom |
| 19 | tar zxf /tmp/release_rlt-1600x-w_V*.tar.gz -C / 2>&1 > /dev/null |
| 20 | |
| 21 | mkdir -p /opt/openolt && cp /tmp/watchdog/openolt_dev_mgmt_daemon_process_watchdog /opt/openolt && cp /tmp/watchdog/watchdog.config /opt/openolt |
| 22 | |
| 23 | sed -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 | |
| 26 | rm -f /tmp/release_rlt-1600x-w_V*.tar.gz |
| 27 | rm -f /run/bcm686* |
| 28 | |
| 29 | |
| 30 | mv /tmp/openolt /broadcom |
| 31 | mv /tmp/libz.so.1 /usr/local/lib |
| 32 | mv /tmp/libstdc++.so.6 /usr/local/lib |
| 33 | mv /tmp/libbal_host_api.so /usr/local/lib |
| 34 | |
| 35 | cp /tmp/logrotate.d/openolt /etc/logrotate.d |
| 36 | chmod +x /opt/openolt/openolt_dev_mgmt_daemon_process_watchdog |
| 37 | |
| 38 | cp /tmp/init.d/dev_mgmt_daemon /etc/init.d |
| 39 | chmod +x /etc/init.d/dev_mgmt_daemon |
| 40 | update-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 |
| 42 | ldconfig /broadcom |
| 43 | ln -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 |
| 45 | service dev_mgmt_daemon start |
| 46 | echo "Wait for 30 sec for BAL to be ready" |
| 47 | sleep 30 |
| 48 | |
| 49 | cp /tmp/init.d/openolt /etc/init.d |
| 50 | chmod +x /etc/init.d/openolt |
| 51 | update-rc.d openolt defaults |
| 52 | service openolt start |