From: Quentin Schulz <quentin.schulz@bootlin.com>
To: openembedded-core@lists.openembedded.org
Cc: thomas.petazzoni@bootlin.com
Subject: [PATCH] busybox: mdev: make mdev auto load modules at boot
Date: Mon, 5 Mar 2018 09:22:33 +0100 [thread overview]
Message-ID: <20180305082233.8493-1-quentin.schulz@bootlin.com> (raw)
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.
Let's manually modprobe all modules in the rootfs.
Taken from:
- https://github.com/buildroot/buildroot/commit/07f46c2b6daec44a6176039c90be67e66c4c2e42
- https://github.com/buildroot/buildroot/commit/b4fc5a180c81689a982d5c595844331684c14f51
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.schulz@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 b/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
CONFIG_CTTYHACK=y
CONFIG_FEATURE_SHADOWPASSWDS=y
+
+CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
diff --git a/meta/recipes-core/busybox/files/mdev b/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 -abq
#
# We might have mounted something over /dev, see if /dev/initctl is there.
--
2.14.1
next reply other threads:[~2018-03-05 8:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-05 8:22 Quentin Schulz [this message]
2018-03-06 3:12 ` [PATCH] busybox: mdev: make mdev auto load modules at boot Khem Raj
2018-03-06 8:39 ` Quentin Schulz
2018-03-06 12:28 ` Mike Looijmans
2018-03-07 10:12 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180305082233.8493-1-quentin.schulz@bootlin.com \
--to=quentin.schulz@bootlin.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox