diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 03158d1..ac33442 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -181,6 +181,29 @@ modules_scan() { [ -n "${MODS}" ] && [ -z "${QUIET}" ] && echo } +modules_init() { + if [ -z "${DO_modules}" ]; then + good_msg 'Skipping module load; disabled via commandline' + elif [ -d "/lib/modules/${KV}" ]; then + good_msg 'Loading modules' + # Load appropriate kernel modules + if [ "${NODETECT}" != '1' ]; then + for modules in ${MY_HWOPTS} + do + modules_scan ${modules} + done + fi + # Always eval doload=... + modules_load ${MDOLIST} + else + good_msg 'Skipping module load; no modules in the ramdisk!' + fi + + # Give udev time to execute all the rules. This may be beneficial + # for usb-storage devices. + is_udev && udevadm settle +} + uppercase() { # needs tr on busybox echo $1 | tr 'a-z' 'A-Z' diff --git a/defaults/linuxrc b/defaults/linuxrc index 323a743..2951384 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -291,30 +291,7 @@ fi splash_init -# Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel -if [ -z "${DO_modules}" ] -then - good_msg 'Skipping module load; disabled via commandline' -elif [ -d "/lib/modules/${KV}" ] -then - good_msg 'Loading modules' - # Load appropriate kernel modules - if [ "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do - modules_scan ${modules} - done - fi - # Always eval doload=... - modules_load ${MDOLIST} -else - good_msg 'Skipping module load; no modules in the ramdisk!' -fi - -# Give udev time to execute all the rules. This may be beneficial -# for usb-storage devices. -is_udev && udevadm settle +modules_init # Apply scan delay if specified sdelay