# run the workgroup after.rpms.sh file first
WORKGROUP=`/bin/cat /etc/workgroup`
source /etc/$WORKGROUP/scripts/farms.after.rpms.sh
# Set SPM to "" for no SMP, or "smp-" for SMP
SMP="smp-"

# This is the kernel's major version, i.e. 2.2.10
MAJORVERSION="2.2.10"

# First, determine new kernel location
KERNEL=`rpm -ql kernel-${SMP}${MAJORVERSION} | grep vmlinuz`
VERSION=`echo $KERNEL | sed 's/\/boot\/vmlinuz-//'`
echo "New 2.2 Kernel... KERNEL: $KERNEL, VERSION: $VERSION" >/dev/tty5

# Load loopback module...
echo "Loading loop.o..." >/dev/tty5
/sbin/insmod /lib/modules/2.0.36-3/block/loop.o

# Make initial ramdisk
cd /boot
echo "Making new initrd..." >/dev/tty5
/sbin/mkinitrd initrd-$VERSION.img $VERSION >/dev/tty5 2>&1

# Modify /etc/lilo.conf
echo "Changing /etc/lilo.conf..." >/dev/tty5
cp /etc/lilo.conf /etc/lilo.conf-bak
chmod a+x /etc/`cat /etc/workgroup`/configfiles/dolilo.pl
/etc/`cat /etc/workgroup`/configfiles/dolilo.pl $KERNEL /boot/initrd-$VERSION.img >/dev/tty5 2>&1

# Run lilo
echo "Running LILO..." >/dev/tty5
/sbin/lilo >/dev/tty5 2>&1

