From: Peter Korsgaard Date: Tue, 8 Mar 2016 23:03:25 +0000 (+0100) Subject: package/busybox: support automatic module loading with mdev X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=07f46c2b6daec44a6176039c90be67e66c4c2e42;p=buildroot.git package/busybox: support automatic module loading with mdev A recently discussed on the mailing list: http://lists.busybox.net/pipermail/buildroot/2016-February/154189.html Our mdev configuration currently doesn't handle module loading. Fix that by: - Telling mdev to run modprobe on hotplug events providing MODALIAS - Adjust the init script to handle coldplug modalias events (E.G. modules for which the devices were already present before mdev was added as the hotplug handler). mdev -s should arguable handle this, but it doesn't. Cc: Arnout Vandecappelle Signed-off-by: Peter Korsgaard Acked-by: "Yann E. MORIN" Signed-off-by: Peter Korsgaard --- diff --git a/package/busybox/S10mdev b/package/busybox/S10mdev index d386d420b5..4cb31de42d 100644 --- a/package/busybox/S10mdev +++ b/package/busybox/S10mdev @@ -8,6 +8,8 @@ case "$1" in echo "Starting mdev..." echo /sbin/mdev >/proc/sys/kernel/hotplug /sbin/mdev -s + # coldplug modules + find /sys/ -name modalias | xargs sort -u | xargs modprobe -abq ;; stop) ;; diff --git a/package/busybox/mdev.conf b/package/busybox/mdev.conf index 247c0ed02d..4fafe63f0c 100644 --- a/package/busybox/mdev.conf +++ b/package/busybox/mdev.conf @@ -33,3 +33,6 @@ event[0-9]+ root:root 640 =input/ mice root:root 640 =input/ mouse[0-9] root:root 640 =input/ ts[0-9] root:root 600 =input/ + +# load modules +$MODALIAS=.* root:root 660 @modprobe "$MODALIAS"