View previous topic :: View next topic |
Author |
Message |
Konsti l33t
Joined: 10 Dec 2002 Posts: 691
|
Posted: Thu Jan 31, 2008 10:30 am Post subject: cardreader works basically, how detect card insertion |
|
|
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 |
|
|
theotherjoe Guru
Joined: 22 Nov 2003 Posts: 393
|
Posted: Thu Jan 31, 2008 12:47 pm Post subject: |
|
|
cant elaborate about details, but have a look for
inotify (found in kernel-sources-->Filesystems) |
|
Back to top |
|
|
Konsti l33t
Joined: 10 Dec 2002 Posts: 691
|
Posted: Sun Feb 03, 2008 12:15 pm Post subject: |
|
|
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 |
|
|
pteppic l33t
Joined: 28 Nov 2005 Posts: 781
|
Posted: Sun Feb 03, 2008 5:17 pm Post subject: |
|
|
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 |
|
|
|