5 # http://github.com/wismna/raspberry-pi/hackpi
9 cd /sys/kernel/config/usb_gadget/
13 OS=MS # change this to anything else to skip M$ tweaks
14 HOST="48:6f:73:74:50:43"
15 SELF0="42:61:64:55:53:42"
16 SELF1="42:61:64:55:53:43"
18 echo 0x04b3 > idVendor
19 echo 0x4010 > idProduct
21 echo 0x0100 > bcdDevice # v1.0.0
22 mkdir -p strings/0x409
23 echo "badc0deddeadbeef" > strings/0x409/serialnumber
24 echo "wismna" > strings/0x409/manufacturer
25 echo "PiZero" > strings/0x409/product
27 if [ "$OS" = "MS" ]; then
29 mkdir -p configs/c.1/strings/0x409
30 echo "0x80" > configs/c.1/bmAttributes
31 echo 250 > configs/c.1/MaxPower
32 echo "Config 1: RNDIS network" > configs/c.1/strings/0x409/configuration
34 echo "1" > os_desc/use
35 echo "0xcd" > os_desc/b_vendor_code
36 echo "MSFT100" > os_desc/qw_sign
38 mkdir -p functions/rndis.usb0
39 echo $SELF0 > functions/rndis.usb0/dev_addr
40 echo $HOST > functions/rndis.usb0/host_addr
41 echo "RNDIS" > functions/rndis.usb0/os_desc/interface.rndis/compatible_id
42 echo "5162001" > functions/rndis.usb0/os_desc/interface.rndis/sub_compatible_id
46 mkdir -p configs/c.2/strings/0x409
47 echo "Config 2: ECM network" > configs/c.2/strings/0x409/configuration
48 echo 250 > configs/c.2/MaxPower
50 mkdir -p functions/ecm.usb0
51 # first byte of address must be even
52 echo $HOST > functions/ecm.usb0/host_addr
53 echo $SELF1 > functions/ecm.usb0/dev_addr
55 # Create the CDC ACM function
56 mkdir -p functions/acm.gs0
58 # Link everything and bind the USB device
59 if [ "$OS" != "MacOs" ]; then
60 ln -s configs/c.1 os_desc
61 ln -s functions/rndis.usb0 configs/c.1
64 ln -s functions/ecm.usb0 configs/c.2
65 ln -s functions/acm.gs0 configs/c.2
67 ls /sys/class/udc > UDC