--- trunk/busybox/mdev.rc 2010/08/22 16:43:06 1113 +++ trunk/busybox/mdev.rc 2010/12/10 23:03:22 1235 @@ -32,6 +32,46 @@ evaluate_retval } +# This works for 2.6.15 kernels or greater +trigger_uevents() +{ + local list="" + local i + local first + local last + local default + + # if you want real coldplug (with all modules being loaded for all + # devices in the system), uncomment out the next line. + #list="${lis}t $(echo /sys/bus/*/devices/*/uevent)" + list="${list} $(echo /sys/class/*/*/uevent)" + list="${list} $(echo /sys/block/*/uevent /sys/block/*/*/uevent)" + for i in ${list} + do + case "${i}" in + */device/uevent) + # skip followed device symlinks + continue + ;; + */class/mem/*|*/class/tty/*) + first="${first} ${i}" + ;; + */block/md*) + last="${last} ${i}" + ;; + */*) + default="${default} ${i}" + ;; + esac + done + + # trigger the sorted events + for i in ${first} ${default} ${last} + do + echo "add" > "${i}" + done +} + # main functions start_devicemanager() { @@ -65,6 +105,9 @@ modprobe -q unix 2>/dev/null fi + rc_print " Populating /dev with existing devices through uevents ..." + trigger_uevents + rc_print " Starting mdev ..." /sbin/mdev -s evaluate_retval