POSTIN
/bin/sh
if [ -f /etc/lilo.conf ]; then
if [ -L /boot/lilo ]; then
# upgrading from old lilo boot.b based
# before:
# - message is a symlink to either lilo-text/message, lilo-menu/message or lilo-graphic/message
# - lilo-text/message and lilo-menu/message are created by DrakX (and are usually the same file)
# - lilo-graphic/message is in the RPM (will be removed by RPM after %post)
# after:
# - message-text is the text message
# - message-graphic is the old lilo-graphic/message
# transforming the /boot/message symlink in non-symlink
if [ -e /boot/lilo-text/message ]; then
mv -f /boot/lilo-text/message /boot/message-text
fi
if [ -e /boot/lilo-menu/message ]; then
mv -f /boot/lilo-menu/message /boot/message-text
fi
if [ -e /boot/message-text ]; then
ln -sf message-text /boot/message
fi
# ensuring the right choice is taken
link=`perl -e 'print readlink("/boot/lilo")'`
case $link in
lilo-menu) ;; # chosen by default
lilo-bmp) ;; # automatically chosen by lilo based on "bitmap=..."
lilo-graphic) ;; # obsolete
lilo-text)
# need a special install=...
perl -pi -e 's|^install=.*\n||; $_ = "install=text\n$_" if $. == 1' /etc/lilo.conf ;;
*)
echo "ERROR: unknown lilo scheme, it is DROPPED (please tell pixel@mandriva.com)"
sleep 1 ;;
esac
rm -f /boot/lilo
elif [ -e /boot/message-graphic ]; then
if perl -e 'exit(-s "/boot/message" > 65_000 ? 0 : 1)'; then
link=`perl -e 'print readlink("/boot/message")'`
rm /boot/message
if [ "$link" = "message-graphic" -a -e /boot/message-text ]; then
ln -s message-text /boot/message
if perl -e 'exit(-s "/boot/message" > 65_000 ? 0 : 1)'; then
# weird message-text file... well someone had this on cooker, better be safe
echo > /boot/message
fi
else
echo > /boot/message
fi
fi
fi
chmod 600 /etc/lilo.conf
if [ -x /usr/sbin/detectloader ]; then
LOADER=$(/usr/sbin/detectloader -q)
if [ "$LOADER" = "LILO" ]; then
/sbin/lilo > /dev/null
fi
fi
fi