git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@26 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Brad House 21 years ago
parent 10400569fd
commit d2dc99dfd8

@ -1,9 +1,5 @@
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

@ -74,7 +74,7 @@ create_base_initrd_sys() {
# 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

@ -52,7 +52,7 @@ gen_deps()
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}

@ -15,7 +15,7 @@ MY_HWOPTS="usb firewire"
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"
@ -23,6 +23,7 @@ else
KSUFF=".o"
INSMOD="insmod"
fi
REAL_ROOT=""
CDROOT=0

@ -13,11 +13,14 @@ parse_opt() {
}
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

@ -129,7 +129,7 @@ do
else
echo "STEP 4a: Mounting root"
mount -o ro ${REAL_ROOT} /newroot
mount -o rw ${REAL_ROOT} /newroot
if [ "$?" = "0" ]
then
break
@ -174,8 +174,8 @@ then
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!

@ -35,7 +35,7 @@ modules_dep_list()
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
}
@ -68,7 +68,7 @@ is_module_already_loaded()
for x in ${LOADED_MODULES}
do
if [ "${x}" == "${1}" ]
if [ "${x}" = "${1}" ]
then
# Yep, module is loaded
return 0
@ -79,7 +79,8 @@ is_module_already_loaded()
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()
@ -88,8 +89,14 @@ 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
@ -97,8 +104,8 @@ modprobe2()
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}"
@ -106,16 +113,18 @@ modprobe2()
for x in ${deps}
do
if ! is_module_already_loaded ${x}
then
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 $?
}
@ -126,5 +135,5 @@ then
fi
modprobe2 ${1}
return $?
exit $?

@ -11,7 +11,7 @@ aacraid sym53c8xx a100u2w cpqfc \
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"

Loading…
Cancel
Save