2 # This file is part of mtetherd
4 # Copyright (c) 2010 Gregor Riepl <onitake@gmail.com>
6 # Based on osso-usb-mass-storage-enable.sh and osso-usb-mass-storage-disable.sh,
7 # Copyright (C) 2004-2009 Nokia Corporation. All rights reserved.
8 # Contact: Kimmo Hämäläinen <kimmo.hamalainen@nokia.com>
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License
12 # version 2 as published by the Free Software Foundation.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 /sbin/lsmod | grep g_nokia > /dev/null
28 logger "$0: removing g_nokia"
30 initctl emit G_NOKIA_REMOVE
32 PNATD_PID=`pidof pnatd`
36 logger "$0: pnatd is not running"
38 OBEXD_PID=`pidof obexd`
42 logger "$0: obexd is not running"
44 SYNCD_PID=`pidof syncd`
48 logger "$0: syncd is not running"
54 logger "$0: failed to rmmod g_nokia!"
59 /sbin/lsmod | grep g_file_storage > /dev/null
61 logger "$0: removing g_file_storage"
63 GADGETPATH='/sys/devices/platform/musb_hdrc/gadget'
68 echo "" > $GADGETPATH/$LUN0/file
69 echo "" > $GADGETPATH/$LUN1/file
71 /sbin/rmmod g_file_storage
73 logger "$0: failed to rmmod g_file_storage!"
78 /sbin/lsmod | grep g_ether > /dev/null
80 /sbin/modprobe g_ether
85 logger "$0: failed to install g_ether"