Sophie

Sophie

distrib > Mandriva > cs4.0 > x86_64 > by-pkgid > 3af08b8332b948fa8d784fdd66fe2fdf > scriptlet

lilo-22.6.1-11mlcs4.i586.rpm

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)
  	  ln -sf message-graphic /boot/message
          ;; # chosen based on /boot/message containing 0x0E at the beginning
        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
  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