Bug 14481 - mdev -s doesn't coldplug devices
Summary: mdev -s doesn't coldplug devices
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-30 15:52 UTC by Axel Fontaine
Modified: 2021-12-30 15:52 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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