21.2 Kernel uevents and udevThe required device information is exported by the sysfs file system. For every devicethe kernel has detected and initialized, a directory with the device name is created. Itcontains attribute files with device-specific properties. Every time a device is added orremoved, the kernel sends a uevent to notify udev of the change.The udev daemon reads and parses all provided rules from the /etc/udev/rules.d/*.rules files once at start-up and keeps them in memory. If rules files arechanged, added, or removed, the daemon receives an event and updates the in-memoryrepresentation of the rules.Every received event is matched against the set of provides rules. The rules can add orchange event environment keys, request a specific name for the device node to create,add symlinks pointing to the node, or add programs to run after the device node is cre-ated. The driver core uevents are received from a kernel netlink socket.21.3 Drivers, Kernel Modules, andDevicesThe kernel bus drivers probe for devices. For every detected device, the kernel createsan internal device structure and the driver core sends a uevent to the udev daemon. Busdevices identify themselves by a specially-formatted ID, which tells what kind of deviceit is. Usually these IDs consist of vendor and product ID and other subsystem-specificvalues. Every bus has its own scheme for these IDs, called MODALIAS. The kerneltakes the device information, composes a MODALIAS ID string from it, and sends thatstring along with the event. For a USB mouse, it looks like this:MODALIAS=usb:v046DpC03Ed2000dc00dsc00dp00ic03isc01ip02Every device driver carries a list of known aliases for devices it can handle. The list iscontained in the kernel module file itself. The program depmod reads the ID lists andcreates the file modules.alias in the kernel's /lib/modules directory for allcurrently available modules. With this infrastructure, module loading is as easy ascalling modprobe for every event that carries a MODALIAS key. If modprobe$MODALIAS is called, it matches the device alias composed for the device with the464 Deployment Guide