´╗┐On 05-03-18 09:22, Quentin Schulz wrote:
Thanks to the MODALIAS line at the beginning of mdev.conf, mdev supports
module auto probing on hotplug.

However, this does not work for cold plugged modules (i.e. modules for
devices that were probed before mdev is added as hotplug handler).
Running mdev -s to replay hotplug events does not work in that case.

I'd rather have this in a seperate bootscript, like this (which performs the same but applies a filter):

This gives users a choice as to whether or not they want this to happen.

Another note: Since this runs at each and every boot, it'd be wise to optimize this for performance. That "sort -u" might be bad for performance, and modprobe doesn't mind if modules were already probed.

Let's manually modprobe all modules in the rootfs.

Taken from:

We need xargs to support zero termination of args so let's enable this
configuration in the fragment for mdev.

Signed-off-by: Quentin Schulz <quentin.sch...@bootlin.com>
  meta/recipes-core/busybox/busybox/mdev.cfg | 2 ++
  meta/recipes-core/busybox/files/mdev       | 1 +
  2 files changed, 3 insertions(+)

diff --git a/meta/recipes-core/busybox/busybox/mdev.cfg 
index 6aefe90e43..0d60fc9560 100644
--- a/meta/recipes-core/busybox/busybox/mdev.cfg
+++ b/meta/recipes-core/busybox/busybox/mdev.cfg
@@ -9,3 +9,5 @@ CONFIG_SETSID=y
diff --git a/meta/recipes-core/busybox/files/mdev 
index 8c9c06e96c..165b275256 100755
--- a/meta/recipes-core/busybox/files/mdev
+++ b/meta/recipes-core/busybox/files/mdev
@@ -9,6 +9,7 @@ touch /dev/mdev.seq
  #sysctl -w kernel.hotplug=/sbin/mdev
  echo "/sbin/mdev" > /proc/sys/kernel/hotplug
  mdev -s
+find /sys/ -name modalias -print0 | xargs -0 sort -u -z | xargs -0 modprobe 
  # We might have mounted something over /dev, see if /dev/initctl is there.

Kind regards,

Mike Looijmans
System Expert

TOPIC Products
Materiaalweg 4, NL-5681 RJ Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijm...@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail

Openembedded-core mailing list

Reply via email to