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 VERY EXPERIMENTAL
seems to work so far on amd64 and x86 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: DEPENDANCIES:
- bootsplash - bootsplash

@ -74,7 +74,7 @@ create_base_initrd_sys() {
# bunzip2 "${TEMP}/initrd-temp/etc/devfsd.conf.bz2" || gen_die "could not uncompress devfsd.conf" # 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 \ 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 \ 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 xargs yes zcat chmod chown cut kill killall; do
rm -f ${TEMP}/initrd-temp/bin/$i > /dev/null rm -f ${TEMP}/initrd-temp/bin/$i > /dev/null

@ -52,7 +52,7 @@ gen_deps()
gen_dep_list() gen_dep_list()
{ {
rm -f ${TEMP}/moddeps > /dev/null rm -f ${TEMP}/moddeps > /dev/null
gen_deps ${STORAGE_MODULES} gen_deps ${SCSI_MODULES}
gen_deps ${FIREWIRE_MODULES} gen_deps ${FIREWIRE_MODULES}
gen_deps ${ATARAID_MODULES} gen_deps ${ATARAID_MODULES}
gen_deps ${PCMCIA_MODULES} gen_deps ${PCMCIA_MODULES}

@ -15,7 +15,7 @@ MY_HWOPTS="usb firewire"
QUIET=1 QUIET=1
ROOT_LINKS="bin sbin lib lib64 boot usr opt" ROOT_LINKS="bin sbin lib lib64 boot usr opt"
ROOT_TREES="etc root home var" ROOT_TREES="etc root home var"
if [ "$KMVER" = "2.6" ] if [ "${KMINOR}" -gt "4" ]
then then
KSUFF=".ko" KSUFF=".ko"
INSMOD="insmod" INSMOD="insmod"
@ -23,6 +23,7 @@ else
KSUFF=".o" KSUFF=".o"
INSMOD="insmod" INSMOD="insmod"
fi fi
REAL_ROOT="" REAL_ROOT=""
CDROOT=0 CDROOT=0

@ -13,11 +13,14 @@ parse_opt() {
} }
modules_scan() { modules_scan() {
for x in "`cat /etc/modules/${1}`" local MODS
MODS=`cat /etc/modules/${1}`
for x in ${MODS}
do do
echo -ne "${HILITE}---- Scanning for ${x}..." echo -ne "${HILITE}---- Scanning for ${x}..."
MODULE=`find /lib/modules -name "${x}.$KSUFF"` # MODULE=`find /lib/modules -name "${x}.$KSUFF"`
/sbin/modprobe -f ${MODULE} > /dev/null 2>&1 modprobe ${x}
# > /dev/null 2>&1
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
backup backup

@ -129,7 +129,7 @@ do
else else
echo "STEP 4a: Mounting root" echo "STEP 4a: Mounting root"
mount -o ro ${REAL_ROOT} /newroot mount -o rw ${REAL_ROOT} /newroot
if [ "$?" = "0" ] if [ "$?" = "0" ]
then then
break break
@ -174,8 +174,8 @@ then
mount -t proc proc /proc mount -t proc proc /proc
mount -t devfs devfs /dev mount -t devfs devfs /dev
kill_devfsd kill_devfsd
umount /initrd/proc umount /tmp/.initrd/proc
umount /initrd/dev umount /tmp/.initrd/dev
# Uhh, initrd is wasting memory ... let's # Uhh, initrd is wasting memory ... let's
# kill the sucker here and now! # kill the sucker here and now!

@ -35,7 +35,7 @@ modules_dep_list()
echo "modules_dep_list(): improper usage" echo "modules_dep_list(): improper usage"
exit 1 exit 1
fi 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} for x in ${LOADED_MODULES}
do do
if [ "${x}" == "${1}" ] if [ "${x}" = "${1}" ]
then then
# Yep, module is loaded # Yep, module is loaded
return 0 return 0
@ -79,7 +79,8 @@ is_module_already_loaded()
real_mod_path() 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() modprobe2()
@ -88,8 +89,14 @@ modprobe2()
if [ "$#" != "1" ] if [ "$#" != "1" ]
then then
echo "modprobe(): improper usage" 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 fi
modlist=`modules_dep_list ${1}` modlist=`modules_dep_list ${1}`
if [ "${modlist}" != "" -a "${modlist}" != " " ] if [ "${modlist}" != "" -a "${modlist}" != " " ]
then then
@ -97,8 +104,8 @@ modprobe2()
else else
deps="" deps=""
fi fi
# echo ""
echo "$1 -- DEPS=${deps}" # echo "$1 -- DEPS='${deps}'"
# Make sure we don't do any endless loops! # Make sure we don't do any endless loops!
LOADED_MODULES="${LOADED_MODULES} ${1}" LOADED_MODULES="${LOADED_MODULES} ${1}"
@ -107,15 +114,17 @@ modprobe2()
do do
if ! is_module_already_loaded ${x} if ! is_module_already_loaded ${x}
then then
modprobe2 "${x}" if [ "${x}" != "" -a "${x}" != " " ]
then
modprobe2 "${x}"
fi
else else
echo "skipping ${x}, module already loaded by us" echo "skipping ${x}, module already loaded by us"
fi fi
done 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 $? return $?
} }
@ -126,5 +135,5 @@ then
fi fi
modprobe2 ${1} modprobe2 ${1}
return $? exit $?

@ -11,7 +11,7 @@ aacraid sym53c8xx a100u2w cpqfc \
dmx3191d dpt_i2o imm in2000 ips qla1280 \ dmx3191d dpt_i2o imm in2000 ips qla1280 \
sim710 sym53c416" sim710 sym53c416"
FIREWIRE_MODULES="ieee1394 ohci1394 eth1394 sbp2" FIREWIRE_MODULES="ieee1394 ohci1394 sbp2"
ATARAID_MODULES="ataraid pdcraid hptraid" ATARAID_MODULES="ataraid pdcraid hptraid"

Loading…
Cancel
Save