Re: Linux-1.3.65

Bernd Eckenfels (ukd1@rzstud1.rz.uni-karlsruhe.de)
19 Feb 1996 22:00:24 GMT


Dan Janowski (danj@netcom.com) wrote:
> A suggestion in the context of this conversation. Suggest the use of =
the
> ability to have more that one bootable target in LILO.

The following script installed as /sbin/installkernel will install the
Kernel under /boot/zImage-1.x.x and make an entry to lilo.conf. Therefo=
re
you can just type "make install" and the KErnel will be build and insta=
lled
without overwriting the old kernels.

Greetings
Bernd

#!/bin/sh
#
# This file is called by the kernel-make, to install the IMAGE
#
# This File is under the GPL
#
# Copyright 1996 Bernd.Eckenfels@inka.de
#
# Arguments:
# $1 - kernel version
# $2 - kernel image file
# $3 - kernel map file
# $4 - default install path (blank if root directory)
#
echo "$0 installing $2 and $3"
echo " Version $1 (root: $4)"

# DBackup of existing images with same version

if [ -f $4/boot/zImage-$1 ]; then
mv -f $4/boot/zImage-$1 $4/boot/zImage-$1.old
echo " ...backup: $4/boot/zImage-$1.old"
fi

if [ -f $4/boot/System.map-$1 ]; then
mv -f $4/boot/System.map-$1 $4/boot/System.map-$1.old
echo " ...backup: $4/boot/System.map-$1.old"
fi

# store new images

cat $2 > $4/boot/zImage-$1
cp $3 $4/boot/System-$1.map

export IFS=3D"=D6"

if grep -sq "zImage-$1" $4/etc/lilo.conf ; then
echo " ...Image already registered in lilo."
else
echo " ...registering new Image in lilo.conf" =20
(
add=3D0
while read line; do
if [ "$add" =3D "0" ]; then
if echo $line | egrep -sq "(^image)|(^other)"=20
then
echo "image =3D /boot/zImage-$1"
echo " vga=3D1"
echo " label =3D v$1"
echo " root =3D /dev/hda5"
echo " read-only"
export add=3D1
fi
fi
echo "$line"
done
) > /tmp/lilo.conf.$$ < $4/etc/lilo.conf
mv -f $4/etc/lilo.conf $4/etc/lilo.conf.old
mv -f /tmp/lilo.conf.$$ $4/etc/lilo.conf
fi

if [ x"$4" =3D x"" ]; then
/sbin/lilo
else
/sbin/lilo -r "$4"
fi

echo Done.

Greetings
Bernd
--=20
(OO) -- Bernd_Eckenfels@Wittumstrasse13.76646Bruchsal.de --
( .. ) ecki@lina.{inka.de,ka.sub.org} http://home.pages.de/~eckes/
o--o *plush* 2048/93600EFD eckes@irc +4972573817 *plush*
(O____O) If privacy is outlawed only Outlaws have privacy