Added a check for /dev/tty0 to setup_keymap, added raid personality modules for EVMS, and fixed lots of space/tab issues, along with a general style cleanup. I'm calling this one 3.3.11b internally, and hopefully it will be added to the tree if it resolves bug #124388.

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@373 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Chris Gianelloni 19 years ago
parent da0a76e458
commit 3098153d53

@ -5,8 +5,7 @@ backup() {
echo -ne "\033[0G\033[0K"
}
strlen()
{
strlen() {
if [ -z "$1" ]
then
echo "usage: strlen <variable_name>"
@ -92,6 +91,7 @@ findcdmount() {
fi
fi
}
cache_cd_contents() {
# Check loop file exists and cache to ramdisk if DO_cache is enabled
if [ "${LOOPTYPE}" != "noloop" ] && [ "${LOOPTYPE}" != "sgimips" ]
@ -130,8 +130,7 @@ mount_sysfs(){
# $1 = union absolute path (starting with /)
# $2 = path to data directory
#
union_insert_dir()
{
union_insert_dir() {
/sbin/unionctl $1 --add --after 0 --mode ro $2
if [ $? = '0' ]
then
@ -140,14 +139,17 @@ union_insert_dir()
}
findnfsmount() {
if [ "${IP}" != '' ]; then
if [ "${NFSROOT}" = '' ]; then
if [ "${IP}" != '' ]
then
if [ "${NFSROOT}" = '' ]
then
# Obtain NFSIP
OPTIONS=`busybox dmesg | grep rootserver | sed -e "s/,/ /g"`
for OPTION in $OPTIONS
do
if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootserver' ]; then
NFSIP=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2`;
if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootserver' ]
then
NFSIP=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2`
fi
done
@ -155,8 +157,9 @@ findnfsmount() {
OPTIONS=`busybox dmesg | grep rootpath | sed -e "s/,/ /g"`
for OPTION in $OPTIONS
do
if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootpath' ]; then
NFSPATH=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2`;
if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootpath' ]
then
NFSPATH=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2`
fi
done
@ -170,11 +173,14 @@ findnfsmount() {
fi
fi
if [ "${NFSROOT}" != '' ]; then
if [ "${CDROOT}" != '0' ]; then
if [ "${NFSROOT}" != '' ]
then
if [ "${CDROOT}" != '0' ]
then
good_msg "Attempting to mount NFS CD image on ${NFSROOT}"
mount -t nfs -o ro,nolock,rsize=1024,wsize=1024 ${NFSROOT} ${NEW_ROOT}/mnt/cdrom
if [ "$?" = '0' ]; then
if [ "$?" = '0' ]
then
REAL_ROOT="/dev/nfs"
else
bad_msg "NFS Mounting failed. Is the path corrent ?"
@ -182,7 +188,8 @@ findnfsmount() {
else
good_msg "Attemping to mount NFS root on ${NFSROOT}"
mount -t nfs -o ro,nolock,rsize=1024,wsize=1024 ${NFSROOT} ${NEW_ROOT}
if [ "$?" = '0' ]; then
if [ "$?" = '0' ]
then
REAL_ROOT="/dev/nfs"
else
bad_msg "NFS Mounting failed. Is the path correct ?"
@ -325,7 +332,8 @@ cmdline_hwopts() {
done
done
# Shouldnt need to sort this the following loop should figure out the duplicates and strip them out
# Shouldnt need to sort this as the following loop should figure out the
# duplicates and strip them out
#MY_HWOPTS=`echo ${MY_HWOPTS}| sort`
for x in ${MY_HWOPTS}
@ -370,8 +378,9 @@ detect_sbp2_devices() {
# /proc
# /proc/scsi/sbp2/0, /proc/scsi/sbp2/1, etc.
#
# You may manually add/remove SBP-2 devices via the procfs with add-single-device <h> <b> <t> <l> or remove-single-device <h> <b> <t> <l>, where:
#
# You may manually add/remove SBP-2 devices via the procfs with:
# add-single-device <h> <b> <t> <l> or remove-single-device <h> <b> <t> <l>,
# where:
#
# <h> = host (starting at zero for first SCSI adapter)
# <b> = bus (normally zero)
@ -390,7 +399,7 @@ detect_sbp2_devices() {
setup_keymap() {
if [ "${DO_keymap}" ]
then
if [ ! -e /dev/vc/0 ]
if [ ! -e /dev/vc/0 -a ! -e /dev/tty0 ]
then
DEVBIND=1
mount -o bind ${NEW_ROOT}/dev /dev
@ -407,6 +416,7 @@ setup_keymap() {
fi
fi
}
chooseKeymap() {
good_msg "Loading keymaps"
cat /lib/keymaps/keymapList
@ -417,7 +427,8 @@ chooseKeymap() {
loadkmap < /lib/keymaps/${keymap}.map
xkeymap=${keymap}
echo ${keymap} | egrep -e "[0-9]+" >/dev/null 2>&1
if [ "$?" -eq '0' ]; then
if [ "$?" -eq '0' ]
then
xkeymap=`tail -n 7 /lib/keymaps/keymapList | grep ${keymap} | sed -r "s/.*\s+${keymap}\s+([a-z-]+).*/\1/g" | egrep -v 1`
fi
mkdir -p /etc/sysconfig
@ -471,11 +482,9 @@ startVolumes() {
bad_msg "LVM2 and EVMS do not work well together"
USE_EVMS2_NORMAL=0
fi
else
bad_msg "vgscan or vgchange not found: skipping LVM2 volume group activation!"
fi
fi
if [ "${USE_EVMS2_NORMAL}" -eq '1' ]
@ -489,8 +498,10 @@ startVolumes() {
}
sdelay() {
# Sleep a specific number of seconds if SDELAY is set otherwise only 1 second
if [ -n "${SDELAY}" ]; then
# Sleep a specific number of seconds if SDELAY is set otherwise only sleep
# 1 second
if [ -n "${SDELAY}" ]
then
sleep ${SDELAY}
else
sleep 1
@ -518,7 +529,7 @@ cdupdate() {
if [ "$?" != '0' ]
then
splash 'verbose'
bad_msg "FAILED TO EXECUTE cdupdate.sh"
bad_msg "Executing cdupdate.sh failed!"
run_shell
fi
else
@ -547,7 +558,8 @@ setup_md_device() {
}
rundebugshell() {
if [ -n "$DEBUG" ]; then
if [ -n "$DEBUG" ]
then
good_msg 'Starting debug shell as requested by "debug" option.'
good_msg 'Type "exit" to continue with normal bootup.'
[ -x /bin/sh ] && /bin/sh || /bin/ash
@ -567,7 +579,6 @@ setup_unionfs(){
CHANGES=$MEMORY/unionfs_changes/$UID
fi
mkdir -p ${MEMORY}
mkdir -p ${UNION}
good_msg "Loading unionfs module"
@ -577,8 +588,8 @@ setup_unionfs(){
CHANGESDEV=${UNIONFS}
good_msg "mounting $CHANGESDEV to $MEMORY for unionfs support"
mount -t auto $CHANGESDEV $MEMORY
# mount tmpfs only in the case when changes= boot parameter was empty
# or we were not able to mount the storage device
# mount tmpfs only in the case when changes= boot parameter was
# empty or we were not able to mount the storage device
ret=$?
if [ "${ret}" -ne 0 ]
then

@ -8,6 +8,7 @@
splash() {
return 0
}
[ -e /etc/initrd.splash ] && . /etc/initrd.splash
# Clean input/output
@ -49,7 +50,6 @@ then
then
ln -s /sbin/udev /sbin/udevsend
fi
fi
if [ -e /bin/lvm ]
@ -76,7 +76,6 @@ do
real_init\=*)
REAL_INIT=`parse_opt "${x}"`
;;
# Livecd options
cdroot)
CDROOT=1
@ -85,7 +84,6 @@ do
CDROOT=1
CDROOT_DEV=`parse_opt "${x}"`
;;
# Start livecd loop and looptype options
loop\=*)
LOOP=`parse_opt "${x}"`
@ -93,7 +91,6 @@ do
looptype\=*)
LOOPTYPE=`parse_opt "${x}"`
;;
# Start Device Manager options
devfs)
USE_DEVFS_NORMAL=1
@ -130,7 +127,6 @@ do
fi
fi
;;
# Start Volume manager options
dolvm2)
USE_LVM2_NORMAL=1
@ -149,7 +145,6 @@ do
debug)
DEBUG='yes'
;;
# Scan delay options
scandelay\=*)
SDELAY=`parse_opt "${x}"`
@ -157,7 +152,6 @@ do
scandelay)
SDELAY=10
;;
# Module no-loads
doload\=*)
MDOLIST=`parse_opt "${x}"`
@ -171,23 +165,19 @@ do
MLIST="`echo ${MLIST} | sed -e \"s/,/ /g\"`"
export MLIST
;;
# Redirect output to a specific tty
CONSOLE\=*)
CONSOLE=`parse_opt "${x}"`
exec >${CONSOLE} <${CONSOLE} 2>&1
;;
# /dev/md
lvmraid\=*)
RAID_DEVICES="`parse_opt ${x}`"
RAID_DEVICES="`echo ${RAID_DEVICES} | sed -e 's/,/ /g'`"
;;
part\=*)
MDPART=`parse_opt "${x}"`
;;
# NFS
ip\=*)
IP=`parse_opt "${x}"`
@ -216,7 +206,6 @@ then
eval DO_`echo $modules | sed 's/-//'`=1
done
fi
# Always eval doload=...
modules_load $MDOLIST
else
@ -279,7 +268,8 @@ then
cp /dev/loop0 ${NEW_ROOT}/dev
fi
# Required for gensplash to work. Not an issue with the initrd as this device isnt created there and is not needed.
# Required for gensplash to work. Not an issue with the initrd as this
# device isnt created there and is not needed.
if [ -e /dev/tty1 ]
then
cp /dev/tty1 ${NEW_ROOT}/dev

@ -2,7 +2,7 @@
# Genkernel v3
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
GK_V='3.3.11'
GK_V='3.3.11b'
TMPDIR='/var/tmp/genkernel'
TODEBUGCACHE=1 # Until an error occurs or DEBUGFILE is fully qualified.

@ -12,7 +12,7 @@ CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
# CONFIG_FEATURE_VERBOSE_USAGE is not set
# CONFIG_FEATURE_INSTALLER is not set
# CONFIG_LOCALE_SUPPORT is not set
CONFIG_FEATURE_DEVFS=y
# CONFIG_FEATURE_DEVFS is not set
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_SUID is not set

@ -14,6 +14,6 @@ MODULES_ATARAID="ataraid pdcraid hptraid"
MODULES_PCMCIA="pcmcia_core yenta_socket i82365 ds ide-cs"
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd"
MODULES_LVM2="dm-mod dm-snapshot dm-mirror dm-bbr"
MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr"
MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr raid0 raid1 raid5 raid6 raid10"
MODULES_DMRAID="dm-mod dm-mirror"
MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci ata_piix sata_mv pdc_adma"

@ -12,7 +12,7 @@ CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
# CONFIG_FEATURE_VERBOSE_USAGE is not set
# CONFIG_FEATURE_INSTALLER is not set
# CONFIG_LOCALE_SUPPORT is not set
CONFIG_FEATURE_DEVFS=y
# CONFIG_FEATURE_DEVFS is not set
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_SUID is not set

@ -14,6 +14,6 @@ MODULES_ATARAID="ataraid pdcraid hptraid"
MODULES_PCMCIA="pcmcia_core yenta_socket i82365 ds ide-cs"
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd"
MODULES_LVM2="dm-mod dm-snapshot dm-mirror dm-bbr"
MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr"
MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr raid0 raid1 raid5 raid6 raid10"
MODULES_DMRAID="dm-mod dm-mirror"
MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci ata_piix sata_mv pdc_adma"

@ -12,7 +12,7 @@ CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
# CONFIG_FEATURE_VERBOSE_USAGE is not set
# CONFIG_FEATURE_INSTALLER is not set
# CONFIG_LOCALE_SUPPORT is not set
CONFIG_FEATURE_DEVFS=y
# CONFIG_FEATURE_DEVFS is not set
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_SUID is not set

@ -14,6 +14,6 @@ MODULES_ATARAID="ataraid pdcraid hptraid"
MODULES_PCMCIA="pcmcia_core yenta_socket i82365 ds ide-cs"
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd"
MODULES_LVM2="dm-mod dm-snapshot dm-mirror dm-bbr"
MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr"
MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr raid0 raid1 raid5 raid6 raid10"
MODULES_DMRAID="dm-mod dm-mirror"
MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci ata_piix sata_mv pdc_adma"

@ -12,7 +12,7 @@ CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
# CONFIG_FEATURE_VERBOSE_USAGE is not set
# CONFIG_FEATURE_INSTALLER is not set
# CONFIG_LOCALE_SUPPORT is not set
CONFIG_FEATURE_DEVFS=y
# CONFIG_FEATURE_DEVFS is not set
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
# CONFIG_FEATURE_SUID is not set

@ -14,6 +14,6 @@ MODULES_ATARAID="ataraid pdcraid hptraid"
MODULES_PCMCIA="pcmcia_core yenta_socket i82365 ds ide-cs"
MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd usbhid sl811-hcd"
MODULES_LVM2="dm-mod dm-snapshot dm-mirror dm-bbr"
MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr"
MODULES_EVMS2="dm-mod dm-snapshot dm-mirror dm-bbr raid0 raid1 raid5 raid6 raid10"
MODULES_DMRAID="dm-mod dm-mirror"
MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci ata_piix sata_mv pdc_adma"

Loading…
Cancel
Save