Here's something I just knocked up for myself. Other Red Hat
users might find it useful.
------8<------ /usr/local/sbin/install-kernel -------8<------
# (C) 2000 Kenn Humborg
# GPLed. Hunt around http://www.fsf.org for a copy of the GPL.
# Standard disclaimers apply. If this breaks your
# machine, you get to keep both pieces.
# This script should be run as root from the root dir of a linux
# kernel source tree. It does the following:
# o does a make bzImage modules
# o determines the full kernel version from include/linux/version.h
# o copies arch/i386/boot/bzImage to /boot/vmlinuz-<VER>
# o copies System.map to /boot/System.map-<VER>
# o copies .config to config-<VER>
# o installs the modules after cleaning out old modules
# o if a reference to this image exists in /etc/lilo.conf, it
# runs lilo, otherwise it prints a warning that lilo.conf
# needs to be edited.
# To get the full benefit from this script, you should change
# EXTRAVERSION in the kernel Makefile whenever you want to try
# out a new kernel config. E.g. I usually use -kh1, -kh2, etc.
# This way multiple kernels (and their modules) can live side-by-side
# and can be selected via LILO options. The Red Hat boot scripts
# will find the right modules and link /boot/System.map to the
# correct System.map for you.
# First look for the files we expect to find in a kernel source root
if [ ! -f Makefile -o ! -f Rules.make -o ! -f REPORTING-BUGS ] ; then
echo Current directory doesn\'t look like a kernel source dir root
make bzImage modules
if [ ! $? = 0 ] ; then
echo Kernel compilation failed
VERSION=grep UTS_RELEASE include/linux/version.h | cut -d\" -f 2
if [ -z "$VERSION" ] ; then
echo Unable to determine kernel version
cp -fv arch/i386/boot/bzImage $IMAGE
cp -fv System.map /boot/System.map-$VERSION
cp -fv .config config-$VERSION
rm -rf /lib/modules-$VERSION
sed -e 's/#.*//' /etc/lilo.conf | grep -q $IMAGE
if [ $? = 0 ] ; then
echo Image file $IMAGE not referenced in /etc/lilo.conf.
echo You will need to edit this file and run lilo manually
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!