udev usb0 control
freerunner at newkirk.us
Sat Oct 18 12:06:21 CEST 2008
OK, the only way I've been able to find to automatically bring usb0 up and
down with USB insertion, WHILE IN DEVICE MODE, is to trigger off
subsystem=="power_supply". (with frameworkd, will be able to trigger via
dbus signal /org/freesmartphone/Device/Input
(dbus.String(u'USB'), dbus.String(u'released') - but will just udev method
work for all current FR images?) It seems that udev doesn't register a
subsystem net event for unplug when the FR is in device mode.
Does anyone have a better idea?
I've got it bringing usb0 down on unplug, and on plug-in it tries to bring
usb0 back up, waits 5 secs, sees if the peer is reachable, and brings usb0
back down if not. Sub-optimal, IMHO, but it's working.
More information about the community