I would like to understand the flow of the USB events form the Kernel space to the User space (just out of my curiosity, in knowing how things are implemented).
To be more clear, I would like to know how does that pop-up comes in my desktop when I plug a USB drive to my system and how does the drive gets mounted.
I would also like to know how it finds out if some images are present in my USB and if "yes" , how it asks me whether I need to open it in GIMP or some other software?
I know its a very big and wide question, but please guide me with some pointers on how to understand the whole idea behind it.
I have not done large code browsings, but I assure you that I have no problem in doing so if I can be guided correctly.
/lib/modules/$(uname -r)/modules.alias
for the complete list.) These will look different based on the hardware interface. For example,pci:v0000102Bd00002527sv*sd*bc*sc*i*
for a PCI device vendor 102B, device 2527, and anything for subvendor, etc, or USB:usb:v2040p4982d*dc*dsc*dp*ic*isc*ip*
.udev
in userspace.udev
matches the notification against its list of rules in/lib/udev/rules.d/
and/etc/udev/rules.d
. From here, the behavior is extremely specialized, based on the rules.80-udisks.rules
file is likely the best place to work from. These rules will use things like blkid and other helpers to probe the type and contents of a disk, populating all sort of configuration values including things likeENV{UDISKS_PRESENTATION_HIDE}="1"
to ignore a disk for some reason. See "man 7 udisks" for details./usr/share/polkit-1/actions/org.freedesktop.udisks.policy
. (Who can mount, umount, etc.)DCIM
is found on a filesystem.