more generic

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

@ -82,6 +82,15 @@ create_base_initrd_sys() {
done done
} }
print_list()
{
local x
for x in ${*}
do
echo ${x}
done
}
create_initrd_modules() { create_initrd_modules() {
if [ "${PAT}" -gt "4" ] if [ "${PAT}" -gt "4" ]
then then
@ -113,7 +122,6 @@ create_initrd_modules() {
cp -ax --parents /lib/modules/${KV}/modules* ${TEMP}/initrd-temp cp -ax --parents /lib/modules/${KV}/modules* ${TEMP}/initrd-temp
print_info 1 "WARNING WARNING: Brad, Dont forget to output modules files to autoload"
# cat ${GK_SHARE}/${ARCH}/linuxrc | sed -e "s/%%STORAGE_MODULES%%/${STORAGE_MODULES}/" \ # cat ${GK_SHARE}/${ARCH}/linuxrc | sed -e "s/%%STORAGE_MODULES%%/${STORAGE_MODULES}/" \
# -e "s/%%FIREWIRE_MODULES%%/${FIREWIRE_MODULES}/" \ # -e "s/%%FIREWIRE_MODULES%%/${FIREWIRE_MODULES}/" \
# -e "s/%%ATARAID_MODULES%%/${ATARAID_MODULES}/" \ # -e "s/%%ATARAID_MODULES%%/${ATARAID_MODULES}/" \
@ -121,10 +129,40 @@ create_initrd_modules() {
# -e "s/%%USB_MODULES%%/${USB_MODULES}/" \ # -e "s/%%USB_MODULES%%/${USB_MODULES}/" \
# > ${TEMP}/initrd-temp/linuxrc # > ${TEMP}/initrd-temp/linuxrc
mkdir -p "${TEMP}/initrd-temp/etc/modules"
print_list ${SCSI_MODULES} > "${TEMP}/initrd-temp/etc/modules/scsi"
print_list ${FIREWIRE_MODULES} > "${TEMP}/initrd-temp/etc/modules/firewire"
print_list ${ATARAID_MODULES} > "${TEMP}/initrd-temp/etc/modules/ataraid"
print_list ${PCMCIA_MODULES} > "${TEMP}/initrd-temp/etc/modules/pcmcia"
print_list ${USB_MODULES} > "${TEMP}/initrd-temp/etc/modules/usb"
if [ -f "${GK_SHARE}/${ARCH}/linuxrc" ]
then
cp "${GK_SHARE}/${ARCH}/linuxrc" "${TEMP}/initrd-temp/linuxrc"
else
cp "${GK_SHARE}/generic/linuxrc" "${TEMP}/initrd-temp/linuxrc" cp "${GK_SHARE}/generic/linuxrc" "${TEMP}/initrd-temp/linuxrc"
fi
if [ -f "${GK_SHARE}/${ARCH}/initrd.scripts" ]
then
cp "${GK_SHARE}/${ARCH}/initrd.scripts" "${TEMP}/initrd-temp/etc/initrd.scripts"
else
cp "${GK_SHARE}/generic/initrd.scripts" "${TEMP}/initrd-temp/etc/initrd.scripts" cp "${GK_SHARE}/generic/initrd.scripts" "${TEMP}/initrd-temp/etc/initrd.scripts"
fi
if [ -f "${GK_SHARE}/${ARCH}/initrd.defaults" ]
then
cp "${GK_SHARE}/${ARCH}/initrd.defaults" "${TEMP}/initrd-temp/etc/initrd.defaults"
else
cp "${GK_SHARE}/generic/initrd.defaults" "${TEMP}/initrd-temp/etc/initrd.defaults" cp "${GK_SHARE}/generic/initrd.defaults" "${TEMP}/initrd-temp/etc/initrd.defaults"
fi
if [ -f "${GK_SHARE}/${ARCH}/modprobe" ]
then
cp "${GK_SHARE}/${ARCH}/modprobe" "${TEMP}/initrd-temp/sbin/modprobe"
else
cp "${GK_SHARE}/generic/modprobe" "${TEMP}/initrd-temp/sbin/modprobe" cp "${GK_SHARE}/generic/modprobe" "${TEMP}/initrd-temp/sbin/modprobe"
fi
chmod +x "${TEMP}/initrd-temp/linuxrc" chmod +x "${TEMP}/initrd-temp/linuxrc"
chmod +x "${TEMP}/initrd-temp/etc/initrd.scripts" chmod +x "${TEMP}/initrd-temp/etc/initrd.scripts"
chmod +x "${TEMP}/initrd-temp/etc/initrd.defaults" chmod +x "${TEMP}/initrd-temp/etc/initrd.defaults"

@ -158,14 +158,14 @@ then
kill_devfsd kill_devfsd
else else
echo "STEP 5b: setting up stuff for pivot_root" echo "STEP 5b: setting up stuff for pivot_root"
mkdir /newroot/initrd mkdir -p /newroot/tmp/.initrd
fi fi
echo "STEP 6: pivot_root and exec/chroot real init" echo "STEP 6: pivot_root and exec/chroot real init"
cd /newroot cd /newroot
pivot_root . initrd pivot_root . tmp/.initrd
if [ "${USE_DEVFS_NORMAL}" -eq "1" -a "${CDROOT}" -eq "0" ] if [ "${USE_DEVFS_NORMAL}" -eq "1" -a "${CDROOT}" -eq "0" ]
then then
@ -179,8 +179,8 @@ then
# 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!
umount /initrd # umount tmp/.initrd
blockdev --flushbufs /dev/ram0 # blockdev --flushbufs /dev/ram0
# at this point it lets us umount the new # at this point it lets us umount the new
# devfs, don't know why, just does, stop # devfs, don't know why, just does, stop

@ -1,189 +0,0 @@
#!/bin/sh
# Daniel Robbins <drobbins@gentoo.org>
# Copyright 2003 Gentoo Technologies, Inc.
# Distributed under the GPL
PATH=/usr/sbin:/usr/bin:/sbin:/bin
BACK_UP="\033[1K\033[0G"
HILITE="\033[1m"
NORMAL="\033[0m"
WARN="\033[1m"
BAD="\033[1m"
#mount -o remount,rw /
mount /proc
INITRD="true"
SCSI="yes"
CDCACHE="no"
IDEBUG="no"
FIREWIRE="no"
ATARAID="no"
PCMCIA="no"
DETECT="no"
USB="yes"
KEYMAP="no"
if [ ! -e /dev/.devfsd ]
then
#mount devfs
mount -t devfs devfs /dev
fi
CMDLINE="`cat /proc/cmdline`"
for x in $CMDLINE
do
if [ "$x" = "doscsi" ]
then
SCSI="yes"
elif [ "$x" = "cdcache" ]
then
CDCACHE="yes"
elif [ "$x" = "idebug" ]
then
IDEBUG="yes"
fi
done
for x in $CMDLINE
do
if [ "$x" = "dofirewire" ]
then
FIREWIRE="yes"
fi
done
for x in $CMDLINE
do
if [ "$x" = "nousb" ]
then
USB="no"
fi
done
for x in $CMDLINE
do
if [ "$x" = "doataraid" ]
then
ATARAID="yes"
fi
done
for x in $CMDLINE
do
if [ "$x" = "dopcmcia" ]
then
PCMCIA="yes"
fi
done
for x in $CMDLINE
do
if [ "$x" = "dokeymap" ]
then
KEYMAP="yes"
fi
done
blurb() {
echo -ne ${HILITE}${1}
}
backup() {
echo -ne "\033[0G\033[0K"
}
if [ -e /dev/.devfsd ]
then
RAM_DEVICE="rd"
else
RAM_DEVICE="ram0"
fi
# Create the new root FS
mounted=""
initmsg() {
echo -e "${HILITE}${*}${NORMAL}"
}
getkeymap() {
local mykeymap
echo -ne ${HILITE}
cat /keymaps/key.lst
echo -ne ${NORMAL}
read -p "Keymap selection: " mykeymap
if [ -e /keymaps/${mykeymap}.map ]
then
echo -e "${HILITE}---- Loading ${mykeymap} keymap${NORMAL}"
loadkmap < /keymaps/${mykeymap}.map
elif [ "$mykeymap" = "" ]
then
#default keymap is "us"
echo -e "${HILITE}---- Loading default (US) keymap${NORMAL}"
loadkmap < /keymaps/us.map
else
getkeymap
fi
}
modules_scan() {
local type
type=${1}; shift
for x in "$@"
do
blurb "---- Scanning for ${x}..."
insmod.static -f /modules/${type}/${x}.o > /dev/null 2>&1
if [ $? -eq 0 ]
then
backup
echo -e "${GOOD}---- Detected ${x} hardware${NORMAL}"
else
backup
echo -ne "${NORMAL}"
fi
done
}
echo "${GOOD} Initial RAMDISK Loading Starting..."
# Mount the CD
if [ "$SCSI" = "yes" ]
then
DEVICE=SCSI
echo -e "${HILITE} ---- Beginning storage detection${NORMAL}"
# This next "%% %%" gets sed tweaked:
modules_scan storage %%STORAGE_MODULES%%
fi
if [ "$FIREWIRE" = "yes" ]
then
DEVICE=FIREWIRE
echo -e "${HILITE} ---- Beginning firewire detection${NORMAL}"
# This next "%% %%" gets sed tweaked:
modules_scan firewire %%FIREWIRE_MODULES%%
fi
if [ "$ATARAID" = "yes" ]
then
DEVICE=ATARAID
echo -e "${HILITE} ---- Beginning ata detection${NORMAL}"
# This next "%% %%" gets sed tweaked:
modules_scan ataraid %%ATARAID_MODULES%%
fi
if [ "$PCMCIA" = "yes" ]
then
DEVICE=PCMCIA
echo -e "${HILITE} ---- Beginning pcmcia detection${NORMAL}"
# This next "%% %%" gets sed tweaked:
modules_scan %%PCMCIA_MODULES%%
fi
if [ "$USB" = "yes" ]
then
DEVICE=USB
echo -e "${HILITE} ---- Beginning usb detection${NORMAL}"
# This next "%% %%" gets sed tweaked:
modules_scan usb %%USB_MODULES%%
fi
if [ "$KEYMAP" = "yes" ]
then
getkeymap
fi
exit

@ -1,4 +1,4 @@
STORAGE_MODULES="sd_mod sg sr_mod \ SCSI_MODULES="sd_mod sg sr_mod \
aic7xxx aic7xxx_old BusLogic \ aic7xxx aic7xxx_old BusLogic \
ncr53c8xx NCR53c406a \ ncr53c8xx NCR53c406a \
initio advansys aha1740 aha1542 aha152x \ initio advansys aha1740 aha1542 aha152x \
@ -17,11 +17,5 @@ ATARAID_MODULES="ataraid pdcraid hptraid"
PCMCIA_MODULES="ide-cs" PCMCIA_MODULES="ide-cs"
USB_MODULES="usbcore ehci-hcd uhci usb-ohci hid usb-storage" USB_MODULES="ehci-hcd uhci usb-ohci hid usb-storage"
INITRD_SIZE=5000
#BOOT_SPLASH_INITRD="/boot/initrd.bs"
MRPROPER="yes"

@ -1,4 +1,4 @@
STORAGE_MODULES="sd_mod sg sr_mod \ SCSI_MODULES="sd_mod sg sr_mod \
aic7xxx aic7xxx_old BusLogic \ aic7xxx aic7xxx_old BusLogic \
ncr53c8xx NCR53c406a \ ncr53c8xx NCR53c406a \
initio advansys aha1740 aha1542 aha152x \ initio advansys aha1740 aha1542 aha152x \

Loading…
Cancel
Save