简体   繁体   中英

Why the linux module rtl8812au is loaded automatically when a Wifi-USB adapter plugged in?

I use an Edimax EW-7811UTC Wi-Fi USB Adapter. I have installed in my Linux distribution the necessary rtl8812au driver.

At boot, if the Wifi-USB adapter is not plugged in, the module 88XXau.ko in not loaded. When I plug in the Wifi-USB adapter the kernel and udev automatically load the module, but I don't find the specific udev rule which executes this loading.

Someone can help me to better know this automatism?

Thanks

https://www.linuxfromscratch.org/lfs/view/development/chapter09/udev.html

Device drivers compiled as modules may have aliases built into them. Aliases are visible in the output of the modinfo program and are usually related to the bus-specific identifiers of devices supported by a module. For example, the snd-fm801 driver supports PCI devices with vendor ID 0x1319 and device ID 0x0801, and has an alias of “pci:v00001319d00000801sv sd bc04sc01i*”. For most devices, the bus driver exports the alias of the driver that would handle the device via sysfs. Eg, the /sys/bus/pci/devices/0000:00:0d.0/modalias file might contain the string “pci:v00001319d00000801sv00001319sd00001319bc04sc01i00”. The default rules provided with udev will cause udevd to call out to /sbin/modprobe with the contents of the MODALIAS uevent environment variable (which should be the same as the contents of the modalias file in sysfs), thus loading all modules whose aliases match this string after wildcard expansion.

https://wiki.archlinux.org/title/Modalias

$ cd /usr/lib/udev/rules.d
$ grep -r MODALIAS .
80-drivers.rules
5:ENV{MODALIAS}=="?*", RUN{builtin}+="kmod load '$env{MODALIAS}'"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM