Open hh opened 9 years ago
http://www.linux-usb.org/gadget/
# manufacturing assigns Ethernet addresses; company id is xx:xx:xx
setenv eth_a_host xx:xx:xx:01:23:45
setenv eth_a_gadget xx:xx:xx:67:89:ac
setenv eth_i_vendor "Great Stuff, LLC"
setenv eth_i_product "Our Cool Thing"
setenv eth_args g_ether.host_addr=\$(eth_a_host)
setenv eth_args $(eth_args) g_ether.dev_addr=\$(eth_a_gadget)
setenv eth_args $(eth_args) g_ether.iManufacturer=\$(eth_i_vendor)
setenv eth_args $(eth_args) g_ether.iProduct=\$(eth_i_product)
# you can assign USB vendor/product/version codes too...
setenv add_eth_args setenv bootargs $(eth_args) \$(bootargs)
...
setenv bootcmd run add_eth_args\;bootm
For production devices, maybe look into http://standards.ieee.org/faqs/regauth.html
Look like the smallest block of mac addresses is $550 for 4096, and then $1650/16777214
Unique hostname on boot:
https://github.com/jimmyken793/boot-scripts/commit/ebe2880a580eb3f099dc197e01617146d421e106
if [ `cat /etc/hostname` = arm ] ; then
hostname=ky-controller-$(hexdump -v -e '1/1 "%02X" ' /proc/device-tree/ocp/ethernet@4a100000/slave@4a100200/mac-address)
echo $hostname > /etc/hostname
hostname $hostname
echo -e "127.0.0.1\t$hostname" |sudo tee -a /etc/hosts
fi
I wonder if it's possible to use dhcpclient and dhcpserver on same interface.
Since it's USB (only one other host), doing both should be feasible. (in case it's our internet connection, or in case they don't know they can share and we need them to reach our 1.1.1.1 address)
(internet sharing from host to iigagdet) (iigadget supporting plug and play)