#!/bin/sh
#
#  This is a sample script to add a new kernel to /etc/lilo.conf.  If it
#  does not do what you want, copy this script to somewhere outside the
#  kernel, change the copy and point your .config at the modified copy.
#  Then you do not need to change the script when you upgrade your kernel.
#

label=$(echo "$KERNELRELEASE" | cut -c1-15)
if ! grep "label=$label\$" /etc/lilo.conf > /dev/null
then
  ed /etc/lilo.conf > /dev/null 2>&1 <<EODATA 
/^image/
i
image=$CONFIG_INSTALL_PREFIX_NAME$CONFIG_INSTALL_KERNEL_NAME
	label=$label
	optional

.
w
q
EODATA
  if [ ! $? ]
  then
    echo edit of /etc/lilo.conf failed
    exit 1
  fi
fi
lilo
