Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-17-2009, 01:12 AM
|
#1
|
LQ Newbie
Registered: Apr 2009
Posts: 6
Rep:
|
USB Pendrive detection
Hi all,
I need to develop a SW in which the SW has to determine when any USB is connected,it has to identify and do the Read and write operation with the pendrive.
I have to identify the moment when pendrive is connected.System has no GUI only Black Box.
Im using RHEL with Kernel 2.6.18.
My question is how to identify if pendrive is connected.Is any System flag or some other thing will set In OS?
Please help me out to solve this problem
Many Thanks in Advance
Yuvi
|
|
|
04-17-2009, 01:26 AM
|
#2
|
Member
Registered: Dec 2008
Location: Kerala, India
Distribution: Ubuntu 11.10
Posts: 334
Rep:
|
Quote:
Originally Posted by gyuvarajan
Hi all,
I need to develop a SW in which the SW has to determine when any USB is connected,it has to identify and do the Read and write operation with the pendrive.
I have to identify the moment when pendrive is connected.System has no GUI only Black Box.
Im using RHEL with Kernel 2.6.18.
My question is how to identify if pendrive is connected.Is any System flag or some other thing will set In OS?
Please help me out to solve this problem
Many Thanks in Advance
Yuvi
|
Definitely while external drives are plugged certain drivers are responsible for setting flags .. But i'm not quite sure which functions is invoked , either ioctl() or not .. Wait for others to reply
command lsusb is been invoked by surely a function which set flags ..
|
|
|
04-17-2009, 01:39 AM
|
#3
|
Member
Registered: Oct 2008
Location: Near Jakarta
Distribution: Slackware, Arch, Slax, Porteus, Tiny Core, Slitaz
Posts: 355
Rep:
|
What you need is found in /etc/udev/rules.d .
|
|
|
04-17-2009, 01:40 AM
|
#4
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
You should provide more info such as which kernel you are using. The architecture, etc. The udevd daemon can be configured to launch a program, but this is better for short scripts.
You might want to look at ivman.
Code:
DETAILS
Ivman is a flexible device manager, allowing users to run arbitrary commands when devices are added/removed, when device properties change, and when
devices emit conditions.
|
|
|
04-17-2009, 01:50 AM
|
#5
|
Senior Member
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687
Rep:
|
Did your instructor implement a timeline for you and other students to draft a perspective?
|
|
|
04-17-2009, 02:00 AM
|
#6
|
LQ Newbie
Registered: Apr 2009
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by jschiwal
You should provide more info such as which kernel you are using. The architecture, etc. The udevd daemon can be configured to launch a program, but this is better for short scripts.
You might want to look at ivman.
Code:
DETAILS
Ivman is a flexible device manager, allowing users to run arbitrary commands when devices are added/removed, when device properties change, and when
devices emit conditions.
|
kernel used is 2.6.18.
Im very new to linux....what is Ivman
|
|
|
04-17-2009, 02:03 AM
|
#7
|
LQ Newbie
Registered: Apr 2009
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by Junior Hacker
Did your instructor implement a timeline for you and other students to draft a perspective?
|
yes, i need to do this SW in 3 days.
|
|
|
04-17-2009, 02:15 AM
|
#8
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Ivman will automount the pendrive or sdcard automatically and can be used to run an arbitrary script. It is lighter weight than udev/dbus/hal/polkit AFAIK. Your application sounds like either for an embedded device or kiosk or VAR system.
Look if your distro supplies it. On mine it is installed but not used by default.
I asked for the kernel version because isn't uncommon for embedded device to run a different architecture or use a 2.5 kernel which may not have udev or hal support.
|
|
|
04-17-2009, 02:35 AM
|
#9
|
LQ Newbie
Registered: Apr 2009
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by jschiwal
Ivman will automount the pendrive or sdcard automatically and can be used to run an arbitrary script. It is lighter weight than udev/dbus/hal/polkit AFAIK. Your application sounds like either for an embedded device or kiosk or VAR system.
Look if your distro supplies it. On mine it is installed but not used by default.
I asked for the kernel version because isn't uncommon for embedded device to run a different architecture or use a 2.5 kernel which may not have udev or hal support.
|
It is for embedded device only.I have mentioned kernel version only.any way it is RHEL with Kernel 2.6
|
|
|
04-18-2009, 12:49 AM
|
#10
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
No. It isn't only for embedded devices. It may be easier for you to use than configuring the dbus/hal/polkit services.
|
|
|
All times are GMT -5. The time now is 01:21 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|