@@ -29,6 +29,11 @@ add_module_post_hook() {
MODULE_POST_HOOKS="$MODULE_POST_HOOKS $1"
}
+# Register a function to enqueue devices before the udev coldplug wait.
+add_udev_trigger_hook() {
+ UDEV_TRIGGER_HOOKS="$UDEV_TRIGGER_HOOKS $1"
+}
+
# Load kernel module
load_kernel_module() {
if modprobe $1 >/dev/null 2>&1; then
@@ -74,6 +79,7 @@ fatal() {
ROOTFS_DIR="/rootfs" # where to do the switch root
MODULE_PRE_HOOKS="" # functions to call before running each module
MODULE_POST_HOOKS="" # functions to call after running each module
+UDEV_TRIGGER_HOOKS="" # functions to enqueue devices before udev settle
MODULES_DIR=/init.d # place to look for modules
EFI_DIR=/sys/firmware/efi # place to store device firmware information
@@ -88,5 +88,9 @@ udev_run() {
else
udevadm trigger --action=add
fi
+ # Let modules enqueue additional devices before waiting for coldplug.
+ for udev_trigger_hook in ${UDEV_TRIGGER_HOOKS:-}; do
+ "$udev_trigger_hook"
+ done
udevadm settle
}
Modules cannot enqueue additional devices between the initial udev trigger and its queue wait. Add a registration helper and run the hooks before settle so modules can share that wait. AI-Generated: OpenAI Codex (GPT-6) Signed-off-by: Wenwen Fu <wenwfu@qti.qualcomm.com> --- meta/recipes-core/initrdscripts/initramfs-framework/init | 6 ++++++ meta/recipes-core/initrdscripts/initramfs-framework/udev | 4 ++++ 2 files changed, 10 insertions(+) base-commit: 09ba457b9f2bcbf4e44bb9d262c0e1b7f4b8a707