I'm working with embedded linux.
There are two USB gadget drivers built as LKM, g_ether.ko and g_file_storage.ko.
I did depmod
and then in modprobe -l
both drivers show up in the list.
kernel/drivers/usb/gadget/g_ether.ko
kernel/drivers/usb/gadget/g_file_storage.ko
The problem is, the kernel doesn't load either of them on boot anatomically.
Curently my solution is to add boot scripts to /etc/init.d
etc/rcX.d
to force g_ether.ko
to be loaded on boot as the default driver.
Are there other (better) ways to make g_ether.ko
default driver?
A possible solution is, I make g_ether.ko
a static driver, and make g_file_storage.ko
an LKM, but I don't know how to turn off a static driver to release the hardware so that another LKM driver can be loaded.
Any suggestions?
It's a user choice to use USB peripheral controller as ethernet or storage. So there is no related hardware event for automatic client driver loading.
But there is a way to bind/unbind driver in user space through sysfs. Look at this: https://lwn.net/Articles/143397/
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다