Skip to contentSkip to conversation

package/busybox: support automatic module loading with mdev

PATCH New Peter Korsgaard 3 participants 4 messages Mar 8, 2016 – Dec 2, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]>
---
 package/busybox/S10mdev   | 2 ++
 package/busybox/mdev.conf | 3 +++
 2 files changed, 5 insertions(+)
package/busybox/S10mdev +2 -0
index d386d42..4cb31de 100644
@@ -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)
 	;;
package/busybox/mdev.conf +3 -0
index 247c0ed..4fafe63 100644
@@ -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"
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/1 package/busybox: support automatic module loading with mdev

Peter, All,

On 2016-03-09 00:03 +0100, Peter Korsgaard spake thusly:

Quoted 5 lines

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:

Quoted 8 lines

- 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 <[email protected]>

Regards,
Yann E. MORIN.

Quoted 36 lines
---
 package/busybox/S10mdev   | 2 ++
 package/busybox/mdev.conf | 3 +++
 2 files changed, 5 insertions(+)
package/busybox/S10mdev +2 -0
index d386d42..4cb31de 100644
@@ -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)
 	;;
package/busybox/mdev.conf +3 -0
index 247c0ed..4fafe63 100644
@@ -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"
Signature · 6 lines
2.7.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 package/busybox: support automatic module loading with mdev

In reply to Peter Korsgaard
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

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:

Quoted 8 lines

- 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 <[email protected]>

Committed, thanks.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard 
#3 lore raw

PATCH 1/1 package/busybox: support automatic module loading with mdev

Quoted 18 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

?> A recently discussed on the mailing list:
?> http://lists.busybox.net/pipermail/buildroot/2016-February/154189.h
tml

?> 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.

Quoted 5 lines

?> Cc: Arnout Vandecappelle <[email protected]> ?> Signed-off-by: Peter Korsgaard <[email protected]>

Committed, thanks.

Sorry for bring this topic back, but this script still doesn't work properly.

Among modaliases I have the following:
?of:Neep0TCatmel,at25

And with the script:

# find /sys/ -name modalias -print0 | xargs -0 sort -u -z | xargs -0
modprobe -abq
#?

Manually:

# modprobe -abq of:Neep0TCatmel,at25
[??988.523305] at25 spi-PRP0001:00: 1 KByte at25 eeprom, pagesize 32

I'm afraid my (or similar) solution would do job better, i.e. serialize probing one-by-one.

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy