[OM2008] USB events -> scripts?
freerunner at newkirk.us
Fri Dec 12 19:09:09 CET 2008
In my work to bring sanity to basic networking I explored this. For 2008.x
the solution I ended with was udev. Two files in my netfix tarball pertain
# when USB is plugged/unplugged in device mode, udev triggers this script
on power change
# udevd does clearenv(). Export shell PATH to children.
if [[ $(cat /sys/devices/platform/s3c2410-ohci/usb_mode) = "device" ]]
if [[ $(cat
if [[ $(ping -c2 -q $(ip r | grep usb0 | grep default | cut -d' ' -f3) |
grep loss | cut -d' ' -f4) = 0 ]]
The only problem with this approach so far is that on powerup it doesn't
trigger, only on USB insertion after fully booted.
On Fri, 12 Dec 2008 09:48:41 -0800, "Sargun Dhillon"
<xbmodder+openmoko at gmail.com> wrote:
> You might even want to look at oeventsd, part of FSO ( freesmartphone.org
> On Fri, Dec 12, 2008 at 4:25 AM, Pander <pander at users.sourceforge.net>
>> On Fri, December 12, 2008 12:35, Vasco Névoa wrote:
>>> Hi all.
>>> I want to run a script automatically every time the USB is plugged or
>> This is in the udev rules.
>> for ideas concerning keybaords and
>> https://bugs.launchpad.net/ubuntu/+bug/289548 concerning networking.
>>> Where should I hook in the scripts? /etc/apm/?/... or somewhere else?
>>> I've looked into using the /etc/network/interfaces, but this doesn't
>>> work because usb0 does not get "downed" on unplug - so it is always
>>> "up" since booting...
>>> Openmoko community mailing list
>>> community at lists.openmoko.org
>> Openmoko community mailing list
>> community at lists.openmoko.org
> Openmoko community mailing list
> community at lists.openmoko.org
http://newkirk.us/om (FR stuff)
More information about the community