VERY EXPERIMENTAL
seems to work so far on amd64 and x86
-I've only tested with 2.6 kernels, it's possible that
-the module-init-tools we use doesn't work with 2.4 in
-which case we need to compile modutils as well and
-provide a static binary for that....
DEPENDANCIES:
- bootsplash
# bunzip2 "${TEMP}/initrd-temp/etc/devfsd.conf.bz2" || gen_die "could not uncompress devfsd.conf"
for i in '[' ash basename cat chroot clear cp dirname echo env false find \
- grep gunzip gzip insmod ln ls loadkmap losetup lsmod mkdir mknod more mount mv \
+ grep gunzip gzip ln ls loadkmap losetup lsmod mkdir mknod more mount mv \
pivot_root ps awk pwd rm rmdir rmmod sh sleep tar test touch true umount uname \
xargs yes zcat chmod chown cut kill killall; do
rm -f ${TEMP}/initrd-temp/bin/$i > /dev/null
gen_dep_list()
{
rm -f ${TEMP}/moddeps > /dev/null
- gen_deps ${STORAGE_MODULES}
+ gen_deps ${SCSI_MODULES}
gen_deps ${FIREWIRE_MODULES}
gen_deps ${ATARAID_MODULES}
gen_deps ${PCMCIA_MODULES}
QUIET=1
ROOT_LINKS="bin sbin lib lib64 boot usr opt"
ROOT_TREES="etc root home var"
-if [ "$KMVER" = "2.6" ]
+if [ "${KMINOR}" -gt "4" ]
then
KSUFF=".ko"
INSMOD="insmod"
KSUFF=".o"
INSMOD="insmod"
fi
+
REAL_ROOT=""
CDROOT=0
}
modules_scan() {
- for x in "`cat /etc/modules/${1}`"
+ local MODS
+ MODS=`cat /etc/modules/${1}`
+ for x in ${MODS}
do
echo -ne "${HILITE}---- Scanning for ${x}..."
- MODULE=`find /lib/modules -name "${x}.$KSUFF"`
- /sbin/modprobe -f ${MODULE} > /dev/null 2>&1
+# MODULE=`find /lib/modules -name "${x}.$KSUFF"`
+ modprobe ${x}
+# > /dev/null 2>&1
if [ $? -eq 0 ]
then
backup
else
echo "STEP 4a: Mounting root"
- mount -o ro ${REAL_ROOT} /newroot
+ mount -o rw ${REAL_ROOT} /newroot
if [ "$?" = "0" ]
then
break
mount -t proc proc /proc
mount -t devfs devfs /dev
kill_devfsd
- umount /initrd/proc
- umount /initrd/dev
+ umount /tmp/.initrd/proc
+ umount /tmp/.initrd/dev
# Uhh, initrd is wasting memory ... let's
# kill the sucker here and now!
echo "modules_dep_list(): improper usage"
exit 1
fi
- cat /lib/modules/${KV}/modules.dep | grep ${1}${KEXT}\: | cut -d\: -f2
+ cat /lib/modules/${KV}/modules.dep | grep ${1}${KSUFF}\: | cut -d\: -f2
}
for x in ${LOADED_MODULES}
do
- if [ "${x}" == "${1}" ]
+ if [ "${x}" = "${1}" ]
then
# Yep, module is loaded
return 0
real_mod_path()
{
- find /lib/modules/${KV}/ -path "*${1}${KEXT}"
+ # find doesn't work like we expect, let's add a grep to it
+ find /lib/modules | grep "${1}${KSUFF}"
}
modprobe2()
if [ "$#" != "1" ]
then
echo "modprobe(): improper usage"
+ exit 1
+ fi
+ real_path=`real_mod_path ${1}`
+ if [ "${real_path}" = "" -o "${real_path}" = " " ]
+ then
+ echo "no such module found"
+ exit 1
fi
-
modlist=`modules_dep_list ${1}`
if [ "${modlist}" != "" -a "${modlist}" != " " ]
then
else
deps=""
fi
-
- echo "$1 -- DEPS=${deps}"
+# echo ""
+# echo "$1 -- DEPS='${deps}'"
# Make sure we don't do any endless loops!
LOADED_MODULES="${LOADED_MODULES} ${1}"
do
if ! is_module_already_loaded ${x}
then
- modprobe2 "${x}"
+ if [ "${x}" != "" -a "${x}" != " " ]
+ then
+ modprobe2 "${x}"
+ fi
else
echo "skipping ${x}, module already loaded by us"
fi
done
+# echo "running insmod on '${real_path}'"
+ ${INSMOD} ${real_path} > /dev/null 2>&1
- real_path=`real_mod_path ${1}`
- echo "running insmod on ${real_path}"
- ${INSMOD} ${real_path}
return $?
}
fi
modprobe2 ${1}
-return $?
+exit $?
dmx3191d dpt_i2o imm in2000 ips qla1280 \
sim710 sym53c416"
-FIREWIRE_MODULES="ieee1394 ohci1394 eth1394 sbp2"
+FIREWIRE_MODULES="ieee1394 ohci1394 sbp2"
ATARAID_MODULES="ataraid pdcraid hptraid"