Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cardreader works basically, how detect card insertion
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Konsti
l33t
l33t


Joined: 10 Dec 2002
Posts: 691

PostPosted: Thu Jan 31, 2008 10:30 am    Post subject: cardreader works basically, how detect card insertion Reply with quote

Hi!

While my cardreader generally works fine I wonder how for example kde detects the insertion of a sdcard. I was impressed by this functionality after I got experienced by my girl friend's kde I put onto her computer. It has built in cardreader and after usb-storage being loaded kde gets to know when I insert a sdcard. How is this done?

I for myself own a minimalistic Xorg with ion3 and I need to replug the whole cardreader after inserting a sdcard, than usb-storage detects the blockdevice and its partition. Is hal doing this? If yes, how does hal get to know from kernel I inserted a card?
Back to top
View user's profile Send private message
theotherjoe
Guru
Guru


Joined: 22 Nov 2003
Posts: 393

PostPosted: Thu Jan 31, 2008 12:47 pm    Post subject: Reply with quote

cant elaborate about details, but have a look for
inotify (found in kernel-sources-->Filesystems)
Back to top
View user's profile Send private message
Konsti
l33t
l33t


Joined: 10 Dec 2002
Posts: 691

PostPosted: Sun Feb 03, 2008 12:15 pm    Post subject: Reply with quote

I installed hal which depends on dbus and started it. That, what is interesting to me, seems to be sufficient. Inserting a card into an empty card reader makes /dev/sdc1 available. May be you are right and the Kernel inotifies /dev/sd[b|c|d|e] which hal gets known per inotify. Interesting!

How do I auto umount such stuff?
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Sun Feb 03, 2008 5:17 pm    Post subject: Reply with quote

There is the 'kded media manager' service that pops up the window on new media insertion (Windows XP style). This allows you to auto mount/open the media, and unmount from the desktop, if you have the right permissions. I think it depends on DBUS and hald running so you are mostly there. It's in the kcontrol 'KDE components>>Service manager' section.
Proper automounting (i.e. via fstab to /mnt/foo), historically for me, was done with hotplug, but this has been depreciated by udev, and the kde integration suffices now.
_________________
Current Project Thread (myth2avi)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum