Skip to contentSkip to conversation

busybox: S01mdev: fix module autoloading

PATCH Superseded Peter Korsgaard 2 participants 3 messages May 7, 2018 – May 24, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 busybox: S01mdev: fix module autoloading

Commit b4fc5a180c (package/busybox: support spaces in module aliases in mdev) changed the mdev coldplugging to handle sysfs path elements and modalias values containing spaces. This unfortunately doesn't work as was recently reported:

http://lists.busybox.net/pipermail/buildroot/2018-May/220903.html

The problem is that sort -z also expects the fields of the input files to be zero terminated, which is not the case for modalias sysfs entries.

So drop the -z option to sort. Spaces in modalias entries could be handled with the xargs -d '\n' option, but that is unfortunately not supported by the busybox applet. Instead, use tr to convert newlines to zeros so we can use xargs -0.

---
 package/busybox/S10mdev | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/busybox/S10mdev +2 -1
index 63ca955b1c..7075b77016 100644
@@ -9,7 +9,8 @@ case "$1" in
 	echo /sbin/mdev >/proc/sys/kernel/hotplug
 	/sbin/mdev -s
 	# coldplug modules
-	find /sys/ -name modalias -print0 | xargs -0 sort -u -z | xargs -0 modprobe -abq
+	find /sys/ -name modalias -print0 | xargs -0 sort -u | tr '\n' '\0' | \
+	    xargs -0 modprobe -abq
 	;;
   stop)
 	;;
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 1/1 busybox: S01mdev: fix module autoloading

Hello,

Quoted 15 lines · Peter Korsgaard

Commit b4fc5a180c (package/busybox: support spaces in module aliases in mdev) changed the mdev coldplugging to handle sysfs path elements and modalias values containing spaces. This unfortunately doesn't work as was recently reported:

http://lists.busybox.net/pipermail/buildroot/2018-May/220903.html

The problem is that sort -z also expects the fields of the input files to be zero terminated, which is not the case for modalias sysfs entries.

So drop the -z option to sort. Spaces in modalias entries could be handled with the xargs -d '\n' option, but that is unfortunately not supported by the busybox applet. Instead, use tr to convert newlines to zeros so we can use xargs -0.

Quoted 5 lines
---
 package/busybox/S10mdev | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH v2 1/1 busybox: S01mdev: fix module autoloading

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

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

Commit b4fc5a180c (package/busybox: support spaces in module aliases in mdev) changed the mdev coldplugging to handle sysfs path elements and modalias values containing spaces. This unfortunately doesn't work as was recently reported:

http://lists.busybox.net/pipermail/buildroot/2018-May/220903.html

The problem is that sort -z also expects the fields of the input files to be zero terminated, which is not the case for modalias sysfs entries.

Quoted 7 lines

So drop the -z option to sort. Spaces in modalias entries could be handled with the xargs -d '\n' option, but that is unfortunately not supported by the busybox applet. Instead, use tr to convert newlines to zeros so we can use xargs -0.

Committed to 2018.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard