blob: 3ad05115684c1bb591c470311f51b28f2f710111 [file] [log] [blame]
Harald Weltee6b963c2019-05-15 21:20:29 +02001#!/bin/bash
2
3GADGET_NAME=osmo-ccid
4
5GADGET_CONFIGFS=/sys/kernel/config/usb_gadget
6
7set -e
8set -x
9
10gadgetdir="$GADGET_CONFIGFS/$GADGET_NAME"
11
12# unmount the endpoints from the filesystem
13umount /dev/ffs-ccid
14
15# detach from USB gadget/bus
16echo "" > "$gadgetdir/UDC" || true
17
18# remove function from config
19rm "$gadgetdir/configs/c.1/ffs.usb0"
20
21# remove strings in config
22rmdir "$gadgetdir/configs/c.1/strings/0x409"
23
24# remove config
25rmdir "$gadgetdir/configs/c.1"
26
27# remove function
28rmdir "$gadgetdir/functions/ffs.usb0"
29
30# remove strings in gadget
31rmdir "$gadgetdir/strings/0x409"
32
33rmdir $gadgetdir