Bug 14481

Summary: mdev -s doesn't coldplug devices
Product: Busybox Reporter: Axel Fontaine <axel>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Axel Fontaine 2021-12-30 15:52:18 UTC
Linux Kernel 5.15.11 (mainline)
Busybox 1.34.1 x64 static build


When executing mdev -s within the init of an initramfs devices aren't picked up and modules aren't being loaded.

Instead one must execute 

find /sys/ -name modalias | xargs sort -u | xargs -n 1 modprobe

to ensure all hardware is found and the relevant modules are loaded.

How to reproduce:
1. create a minimal x64 QEMU machine
2. Launch a VM with a minimal Busybox-based initramfs where /init is a reqular shell script
3. Mount /proc and /sys then execute mdev -s as part of this script