Initial commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
[Match]
|
||||
Name=usb0
|
||||
[Address]
|
||||
Address=169.254.1.2/24
|
||||
[Network]
|
||||
DHCP=false
|
||||
LinkLocalAddressing=no
|
||||
IPv6AcceptRA=no
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Enable USB Network
|
||||
After=phosphor-ipmi-host.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/sbin/usb-network.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
cd /sys/kernel/config/usb_gadget
|
||||
|
||||
if [ ! -f "g1" ]; then
|
||||
mkdir g1
|
||||
cd g1
|
||||
|
||||
echo 0x1d6b > idVendor # Linux foundation
|
||||
echo 0x0104 > idProduct # Multifunction composite gadget
|
||||
mkdir -p strings/0x409
|
||||
echo "Linux" > strings/0x409/manufacturer
|
||||
echo "Ethernet/ECM gadget" > strings/0x409/product
|
||||
|
||||
mkdir -p configs/c.1
|
||||
echo 100 > configs/c.1/MaxPower
|
||||
mkdir -p configs/c.1/strings/0x409
|
||||
echo "ECM" > configs/c.1/strings/0x409/configuration
|
||||
|
||||
mkdir -p functions/ecm.usb0
|
||||
|
||||
ln -s functions/ecm.usb0 configs/c.1
|
||||
|
||||
# Write the device info in /sys/class/udc to UDC
|
||||
echo 1e6a2000.usb > UDC
|
||||
|
||||
fi
|
||||
exit 0
|
||||
Reference in New Issue
Block a user