blob: c80ba724440eba9e3859c1f8c829dfa287bf24da [file] [log] [blame]
Arthur Syu094df162022-04-21 17:50:06 +08001#!/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
18# kill CLI applications
19echo "kill running time application"
20[ -n "`pidof openolt`" ] && killall openolt
21[ -n "`pidof dev_mgmt_daemon`" ] && killall dev_mgmt_daemon
22[ -n "`pidof bcm.user`" ] && killall bcm.user
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
26rm -f /tmp/root_dev_mgmt_pid /tmp/root_dev_mgmt_init_done
27sleep 3
28# unload drivers
29echo "unload kernel drivers"
30[ -n "`lsmod | grep nltr`" ] && rmmod nltr && sleep 1
31[ -n "`lsmod | grep pcie_proxy`" ] && rmmod pcie_proxy && sleep 1
32[ -n "`lsmod | grep devmem`" ] && rmmod devmem && sleep 1
33[ -n "`lsmod | grep fld_linux`" ] && rmmod fld_linux && sleep 1
34[ -n "`lsmod | grep os_linux`" ] && rmmod os_linux && sleep 1
35[ -n "`lsmod | grep ll_pcie`" ] && rmmod ll_pcie && sleep 1
36[ -n "`lsmod | grep linux_user_bde`" ] && rmmod linux-user-bde && sleep 1
37[ -n "`lsmod | grep linux_kernel_bde`" ] && rmmod linux-kernel-bde && sleep 1
38
39rm -rf /dev/bcmolt_pcie_proxy
40rm -rf /dev/linux-uk-proxy
41rm -rf /dev/linux-user-bde
42rm -rf /dev/linux-kernel-bde
43for i in {0..1}; do
44 [ ! -f /dev/bcmolt_devmem_sram$i ] && rm -f /dev/bcmolt_devmem_sram$i
45 [ ! -f /dev/bcmolt_devmem_ddr$i ] && rm -f /dev/bcmolt_devmem_ddr$i
46 [ ! -f /dev/bcmolt_devmem_regs$i ] && rm -f /dev/bcmolt_devmem_regs$i
47done
48
49rm -rf /opt/bcm68620
50