use board serial number from device tree
[linux-usb-otg] / mass-storage-file.sh
1 #!/bin/sh
2
3 FILE=/sys/kernel/config/usb_gadget/g1/configs/c.1/mass_storage.usb0/lun.0/file
4
5 if [ -z "$1" ] ; then
6         echo "EJECT "`cat $FILE`
7         sudo sh -c "echo '' > $FILE"
8 elif [ -e "$1" ] ; then
9         sudo sh -c "readlink -f $1 > $FILE"
10         echo "INSERT "`cat $FILE`
11 else
12         echo "Usage: $0 /path/to/disk.img"
13         exit 1
14 fi
15