Skip to contentSkip to conversation

package/busybox: support spaces in module aliases in mdev

PATCH New Andy Shevchenko 2 participants 3 messages Jul 2, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/busybox: support spaces in module aliases in mdev

The new change which enabled automatic module loading on boot does not handle the cases when module alias includes spaces. It prevents modules to be loaded since script fails:

% find /sys/ -name modalias | xargs sort -u
sort: /sys/devices/platform/Fixed: No such file or directory

First alias in question is "platform:Fixed MDIO bus".

Amend the script to support above like cases.

Note: the -z option to sort in Busybox depends on SORT_BIG, which is enabled in out busybox bundled configuration, so we can use it.

Fixes 07f46c2b6dae ("package/busybox: support automatic module loading with mdev")

---
In v2:
- address Yann's and Thomas comments

 package/busybox/S10mdev | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/busybox/S10mdev +1 -1
index 4cb31de..63ca955 100644
@@ -9,7 +9,7 @@ case "$1" in
 	echo /sbin/mdev >/proc/sys/kernel/hotplug
 	/sbin/mdev -s
 	# coldplug modules
-	find /sys/ -name modalias | xargs sort -u | xargs modprobe -abq
+	find /sys/ -name modalias -print0 | xargs -0 sort -u -z | xargs -0 modprobe -abq
 	;;
   stop)
 	;;
Signature · 1 line
2.8.1
#1 lore raw

PATCH v2 1/1 package/busybox: support spaces in module aliases in mdev

Hello,

Quoted 9 lines · Andy Shevchenko

The new change which enabled automatic module loading on boot does not handle the cases when module alias includes spaces. It prevents modules to be loaded since script fails:

% find /sys/ -name modalias | xargs sort -u
sort: /sys/devices/platform/Fixed: No such file or directory

First alias in question is "platform:Fixed MDIO bus".

Quoted 8 lines

Amend the script to support above like cases.

Note: the -z option to sort in Busybox depends on SORT_BIG, which is enabled in out busybox bundled configuration, so we can use it.

Fixes 07f46c2b6dae ("package/busybox: support automatic module loading with mdev")

Thanks for this new version, but in the mean time, I had already modified and applied your first version.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH v2 1/1 package/busybox: support spaces in module aliases in mdev

Quoted 20 lines · Thomas Petazzoni

Hello,

Quoted 17 lines · Andy Shevchenko

The new change which enabled automatic module loading on boot does not handle
the cases when module alias includes spaces. It prevents modules to be loaded
since script fails:

? % find /sys/ -name modalias | xargs sort -u
? sort: /sys/devices/platform/Fixed: No such file or directory

First alias in question is "platform:Fixed MDIO bus".

Amend the script to support above like cases.

Note: the -z option to sort in Busybox depends on SORT_BIG, which is enabled
in out busybox bundled configuration, so we can use it.

Quoted 7 lines
Quoted 4 lines
Fixes 07f46c2b6dae ("package/busybox: support automatic module

loading with mdev")

Thanks for this new version, but in the mean time, I had already modified and applied your first version.

You were fast, I like it! Thanks.

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