2009-03-02 13:39:52

by Oguz Yarimtepe

[permalink] [raw]
Subject: usb hotplug and hooking

Hi,

I want to run an application when an external usb flash disk is plugged to
my box machine that has STLinux installed in it. My aim is to check some
issues on usb disk, whether it has an official software or not. I am not
sure how will i hook my own application that will check usb device
when it is plugged. I don't want the application run at the
background, but run only when a plug is occured.

Will be happy if you guide a little.

Thanx.

--
O?uz Yar?mtepe
http://www.loopbacking.info


2009-03-02 14:08:37

by Oliver Neukum

[permalink] [raw]
Subject: Re: usb hotplug and hooking

Am Montag 02 M?rz 2009 14:39:41 schrieb Oguz Yarimtepe:
> Hi,
>
> I want to run an application when an external usb flash disk is plugged to
> my box machine that has STLinux installed in it. My aim is to check some
> issues on usb disk, whether it has an official software or not. I am not
> sure how will i hook my own application that will check usb device
> when it is plugged. I don't want the application run at the
> background, but run only when a plug is occured.

Have you looked at writing a udev script? Do you need a GUI?

Regards
Oliver

2009-03-02 14:34:09

by Oguz Yarimtepe

[permalink] [raw]
Subject: Re: usb hotplug and hooking

I will look at the udev scripting. I don't need a GUI, yet. I will
just communicate with the usb device, check its files and if an
authorized software is found (will use asymmetric cryptography) will
load it. I can write the software that will do the mentioned things.
I just don't know the hooking part. But udev is a good start. Thanks.

2009/3/2 Oliver Neukum <[email protected]>
>
> Am Montag 02 M?rz 2009 14:39:41 schrieb Oguz Yarimtepe:
> > Hi,
> >
> > I want to run an application when an external usb flash disk is plugged to
> > my box machine that has STLinux installed in it. My aim is to check some
> > issues on usb disk, whether it has an official software or not. I am not
> > sure how will i hook my own application that will check usb device
> > when it is plugged. I don't want the application run at the
> > background, but run only when a plug is occured.
>
> Have you looked at writing a udev script? Do you need a GUI?
>
> ? ? ? ?Regards
> ? ? ? ? ? ? ? ?Oliver
>



--
O?uz Yar?mtepe
http://www.loopbacking.info

2009-03-02 14:48:43

by Xavier Bestel

[permalink] [raw]
Subject: Re: usb hotplug and hooking

On Mon, 2009-03-02 at 16:33 +0200, Oguz Yarimtepe wrote:
> I will look at the udev scripting. I don't need a GUI, yet. I will
> just communicate with the usb device, check its files and if an
> authorized software is found (will use asymmetric cryptography) will
> load it. I can write the software that will do the mentioned things.
> I just don't know the hooking part. But udev is a good start. Thanks.

Have a look at halevt:
http://www.environnement.ens.fr/perso/dumas/halevt.html

HTH,
Xav

2009-03-02 15:35:18

by Sitsofe Wheeler

[permalink] [raw]
Subject: Re: usb hotplug and hooking

Hello,

On Mon, Mar 02, 2009 at 03:39:41PM +0200, Oguz Yarimtepe wrote:
> I want to run an application when an external usb flash disk is plugged to
> my box machine that has STLinux installed in it. My aim is to check some
> issues on usb disk, whether it has an official software or not. I am not
> sure how will i hook my own application that will check usb device
> when it is plugged. I don't want the application run at the
> background, but run only when a plug is occured.

I think these days that problem tends to be handled by HAL
http://www.freedesktop.org/wiki/Software/hal and some software listening
to HAL events on dbus . If you are using KDE or GNOME both of these have
tools for automatically running software when devices are detected
(GNOME uses gnome-volume-manager and I think KDE has media://ioslave).

--
Sitsofe | http://sucs.org/~sits/

2009-03-02 15:46:32

by Oguz Yarimtepe

[permalink] [raw]
Subject: Re: usb hotplug and hooking

I don't have hald installed at my platform. It is an embedded
platform. Checking the udev rules now.


>
> I think these days that problem tends to be handled by HAL
> http://www.freedesktop.org/wiki/Software/hal and some software listening
> to HAL events on dbus . If you are using KDE or GNOME both of these have
> tools for automatically running software when devices are detected
> (GNOME uses gnome-volume-manager and I think KDE has media://ioslave).
>
> --
> Sitsofe | http://sucs.org/~sits/
>



--
O?uz Yar?mtepe
http://www.loopbacking.info