# Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 03 Feb 2008; Andrew Gaffney <agaffney@gentoo.org> generic/initrd.scripts,
+ generic/linuxrc:
+ Add setup_hotplug() function that runs before the modules are loaded to
+ setup mdev as the hotplug event handler. Add $KV to /lib/modules anywhere it
+ occurs to allow for an initramfs with multiple sets of modules
+
03 Feb 2008; Andrew Gaffney <agaffney@gentoo.org> gen_configkernel.sh,
genkernel.conf:
Clean up OLDCONFIG logic and default to OLDCONFIG=yes. This is for bug 207895
then
[ -n "${DEBUG}" ] && echo -ne "${BOLD} ::${NORMAL} Checking for ${x}..."
# find -name does not work since the return status is always zero
- if find /lib/modules | grep /"${x}${KSUFF}" >/dev/null 2>&1
+ if find /lib/modules/${KV} | grep /"${x}${KSUFF}" >/dev/null 2>&1
then
echo -ne "${BOLD} ::${NORMAL} Scanning for ${x}..."
modprobe ${x} -n
runmdev() {
# busybox udev replacement
mdev -s
-
- # catch udev hotplug events
- echo /sbin/mdev > /proc/sys/kernel/hotplug
}
test_success() {
mount -o bind ${NEW_ROOT}/dev /dev
}
+setup_hotplug() {
+ # Check udev is available...
+ if [ "${KV_2_6_OR_GREATER}" -a "${USE_UDEV_NORMAL}" != '0' ]
+ then
+ USE_UDEV_NORMAL=1
+ else
+ USE_UDEV_NORMAL=0
+ fi
+
+ if [ "${USE_UDEV_NORMAL}" = '1' ]
+ then
+ # catch udev hotplug events
+ echo /sbin/mdev > /proc/sys/kernel/hotplug
+ fi
+}
+
start_dev_mgr() {
# Check udev is available...
if [ "${KV_2_6_OR_GREATER}" -a "${USE_UDEV_NORMAL}" != '0' ]
}
load_modules() {
- # Load modules listed in MY_HWOPTS if /lib/modules exists
+ # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel
- if [ -d '/lib/modules' ]
+ if [ -d '/lib/modules/${KV}' ]
then
good_msg 'Loading modules'
# Load appropriate kernel modules
detect_sbp2_devices
cmdline_hwopts
-# Load modules listed in MY_HWOPTS if /lib/modules exists
-if [ -d '/lib/modules' ]
+# Setup hotplugging for firmware loading
+setup_hotplug
+
+# Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel
+if [ -d '/lib/modules/${KV}' ]
then
good_msg 'Loading modules'
# Load appropriate kernel modules