Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Zack Williams | 477ba09 | 2018-10-17 10:50:06 -0700 | [diff] [blame] | 3 | # Copyright 2018-present Open Networking Foundation |
| 4 | # |
| 5 | # This program is free software: you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation, either version 3 of the License, or |
| 8 | # (at your option) any later version. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
Jason Huang | fd78f66 | 2019-06-05 20:25:01 +0800 | [diff] [blame^] | 18 | DEVMEM_MAJOR=`cat /sys/module/devmem/parameters/bcmolt_devmem_chrdev_major` |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 19 | # kill CLI applications |
| 20 | echo "kill running time application" |
Jason Huang | fd78f66 | 2019-06-05 20:25:01 +0800 | [diff] [blame^] | 21 | [ -n "`pidof dev_mgmt_daemon`" ] && killall dev_mgmt_daemon |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 22 | [ -n "`pidof bcm.user`" ] && killall bcm.user |
Jason Huang | fd78f66 | 2019-06-05 20:25:01 +0800 | [diff] [blame^] | 23 | [ -n "`pidof dev_mgmt_attach`" ] && killall dev_mgmt_attach |
| 24 | [ -n "`pidof embedded_console`" ] && killall embedded_console |
| 25 | [ -n "`pidof example_user_appl`" ] && killall example_user_appl |
Shad Ansari | 9fb007d | 2018-05-14 18:31:38 +0000 | [diff] [blame] | 26 | [ -n "`pidof openolt`" ] && killall openolt |
Jason Huang | fd78f66 | 2019-06-05 20:25:01 +0800 | [diff] [blame^] | 27 | rm -f /tmp/root_dev_mgmt_pid /tmp/root_dev_mgmt_init_done |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 28 | |
| 29 | # unload drivers |
| 30 | echo "unload kernel drivers" |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 31 | [ -n "`lsmod | grep i2c_devs`" ] && rmmod i2c_devs && sleep 1 |
Jason Huang | fd78f66 | 2019-06-05 20:25:01 +0800 | [diff] [blame^] | 32 | [ -n "`lsmod | grep nltr`" ] && rmmod nltr && sleep 1 |
| 33 | [ -n "`lsmod | grep pcie_proxy`" ] && rmmod pcie_proxy && sleep 1 |
| 34 | [ -n "`lsmod | grep devmem`" ] && rmmod devmem && sleep 1 |
| 35 | [ -n "`lsmod | grep fld_linux`" ] && rmmod fld_linux && sleep 1 |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 36 | [ -n "`lsmod | grep os_linux`" ] && rmmod os_linux && sleep 1 |
| 37 | [ -n "`lsmod | grep ll_pcie`" ] && rmmod ll_pcie && sleep 1 |
| 38 | [ -n "`lsmod | grep linux_user_bde`" ] && rmmod linux-user-bde && sleep 1 |
| 39 | [ -n "`lsmod | grep linux_kernel_bde`" ] && rmmod linux-kernel-bde && sleep 1 |
| 40 | rm -rf /dev/maple_i2c |
Jason Huang | fd78f66 | 2019-06-05 20:25:01 +0800 | [diff] [blame^] | 41 | rm -rf /dev/bcmolt_pcie_proxy |
| 42 | rm -rf /dev/linux-uk-proxy |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 43 | rm -rf /dev/linux-user-bde |
| 44 | rm -rf /dev/linux-kernel-bde |
Jason Huang | fd78f66 | 2019-06-05 20:25:01 +0800 | [diff] [blame^] | 45 | rm -rf /dev/coop_dba_example |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 46 | rm -rf /dev/coop_dba |
Jason Huang | fd78f66 | 2019-06-05 20:25:01 +0800 | [diff] [blame^] | 47 | for i in {0..7}; do |
| 48 | MAJOR=$(($DEVMEM_MAJOR + $i)) |
| 49 | [ ! -f /dev/bcmolt_devmem_sram$i ] && rm -f /dev/bcmolt_devmem_sram$i |
| 50 | [ ! -f /dev/bcmolt_devmem_ddr$i ] && rm -f /dev/bcmolt_devmem_ddr$i |
| 51 | [ ! -f /dev/bcmolt_devmem_regs$i ] && rm -f /dev/bcmolt_devmem_regs$i |
| 52 | done |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 53 | |
Shad Ansari | 9fb007d | 2018-05-14 18:31:38 +0000 | [diff] [blame] | 54 | rm -rf /opt/bcm68620 |
| 55 | rm -rf /run/bcm68620 |
| 56 | |
| 57 | rm -rf /broadcom |
| 58 | |
Shad Ansari | 9fb007d | 2018-05-14 18:31:38 +0000 | [diff] [blame] | 59 | rm -rf /usr/local/lib/libgrpc++.so.1 |
Jason Huang | fd78f66 | 2019-06-05 20:25:01 +0800 | [diff] [blame^] | 60 | rm -rf /usr/local/lib/libgrpc.so.6 |
| 61 | rm -rf /usr/local/lib/libbal_host_api.so |
| 62 | rm -rf /usr/local/lib/libstdc++.so.6 |
Shad Ansari | f1e0bc8 | 2018-05-21 17:51:45 +0000 | [diff] [blame] | 63 | |