On Sat, Aug 15, 2015 at 08:28:45AM +0100, linuxcbon linuxcbon wrote:
> Hi,
> 
> I need the kernel to "auto" modprobe ("radeon" for example)
> 
> What my rc.sysinit has  :
> - mount : /dev , /proc, /sys, /tmp, /var and / as root
> - "mdev -s" , which only creates /dev files
> 
> I don't know what's missing so the kernel does "radeon" and all needed
> modprobes...

For autoloading modules when hardware is hotplugged:
# in /etc/mdev.conf:
$MODALIAS=.*    root:root       0660    @modprobe -b "$MODALIAS"

For autoloading modules when hardware is coldplugged, roughly as per
Alpine Linux hwdrivers script:
# in rc.sysinit or an init script:
find /sys/devices -name modalias -type f -print0 | xargs -0 sort -u | \
        xargs modprobe -ab 2>/dev/null

Alternately:
# grepping in uevent:
grep -h MODALIAS /sys/bus/*/devices/*/uevent 2>/dev/null |cut -d = -f 2 \
        | sort -u | xargs modprobe -ab 2>/dev/null

# or using modalias:
sort -u /sys/bus/*/devices/*/modalias 2>/dev/null \
        | xargs modprobe -ab 2>/dev/null

"sort -u" is not really necessary; it makes the modules load in a predictable
order while removing some duplicates, so that interfaces and devices will
be named consistently.

HTH,
Isaac Dunham
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to