#!/bin/sh

set -e

if  [ -f "/etc/osso-af-init/orig.matchbox.defs" ] ; then 
  mv /etc/osso-af-init/orig.matchbox.defs /etc/osso-af-init/matchbox.defs.orig
fi

if  [ -f "/usr/bin/matchbox-window-manager-orig" ] ; then 
  mv /usr/bin/matchbox-window-manager-orig /usr/bin/matchbox-window-manager.orig
fi

if  [ ! -e "/sbin/dmlosetup" ] ; then 
   ln -s /sbin/dmsetup /sbin/dmlosetup
fi

if  [ ! -e "/sbin/ezchroot" ] ; then 
   ln -s /sbin/qchroot /sbin/ezchroot
fi

# yet another kludge; detect an upgrade (forced OFF)
UPGRD='no'

# this takes a while; that's why it's at the end...
update-sudoers

if [ "x$UPGRD" = "x" ] ; then
   maemo-select-menu-location cpu-perform.desktop tana_fi_settings
   maemo-select-menu-location cpu-ondemand.desktop tana_fi_settings
   maemo-select-menu-location windowhack.desktop tana_fi_settings
fi

exit 0	