Loading modules with cold plugged devices
Natanael Copa
ncopa at alpinelinux.org
Wed Sep 24 17:03:44 UTC 2014
On Wed, 24 Sep 2014 14:15:10 +0200
Luca Ellero <lroluk at gmail.com> wrote:
> Hi,
> I'm trying to load kernel modules at boot time (if needed) but I don't
> manage to get it right.
> My configuration is the following:
> Pandaboard with U-Boot 2014.07, Linux kernel 3.16 and BusyBox 1.22.1
>
> I have an init script /etc/init.d/rcS like this:
>
> #!/bin/sh
> mount -t proc none /proc
> mount -t sysfs none /sys
> echo /sbin/mdev > /proc/sys/kernel/hotplug
> /sbin/mdev -s
>
> and a configuration file /etc/mdev.conf containing only the following line:
>
> $MODALIAS=.* 0:0 660 @modprobe "$MODALIAS"
>
> Modules are correctly loaded if I plug in a device while the system is
> up and running.
> For example if I plug-in an USB keyboard the correct module (usbhid) is
> loaded.
> But if the keyboard is "cold plugged" (when the system is off) and then
> I power up the Pandaboard, the module isn't loaded.
> Even executing "mdev -s" when the system is up doesn't load the module.
> Doesn't "mdev -s" scan /sys entries and load modules (as mdev.conf
> points), or am I missing something?
No, it does not trigger hotplug events by scanning /sys.
Alpine Linux does this:
find /sys -name modalias | xargs sort -u \
| xargs modprobe -a 2> /dev/null
-nc
More information about the busybox
mailing list