linuxrc: move modules initialization code to modules_init

master
Fabio Erculiani 12 years ago
parent f1f04247f4
commit d8af91e3e8

@ -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'

@ -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

Loading…
Cancel
Save