#! /bin/sh -e
#
# Last finishing touch before rebooting into the installed system.

# Register changes before and after cfengine is executed, to make it
# easier to track our changes
[ -x /target/usr/sbin/debian-edu-etc-svk ] && \
  in-target /usr/sbin/debian-edu-etc-svk update

# libnss-ldap seem to remove this while when it is installed.  Reinsert it to
# make cfengine can do its stuff without hanging.
touch /target/var/lib/nss-ldap/bind_policy_soft

in-target cfengine-debian-edu -D installation || true

# Workaround for usplash bug #431560, skolelinux bug #1164
if [ -x /target/etc/rc1.d/K01usplash ] ; then
  mv /target/etc/rc1.d/K01usplash /target/etc/rc1.d/S80usplash
fi

# Register changes before and after cfengine is executed, to make it
# easier to track our changes
[ -x /target/usr/sbin/debian-edu-etc-svk ] && \
  in-target /usr/sbin/debian-edu-etc-svk update

exit 0
