#!/bin/sh

set -e

. /usr/share/debconf/confmodule

case "$1" in
    configure)
        mkdir -p /etc/default/grub.d/
        ln -sf /usr/share/oem-stella-guillermin-meta/oem-flavour.cfg /etc/default/grub.d/oem-flavour.cfg
        if [ -e /boot/grub/grub.cfg ] && command -v update-grub; then
            update-grub
        fi

        # Fix ESP partition
        if [ -x /usr/lib/oem-stella-guillermin-meta/oem-fix-esp ]; then
            /usr/lib/oem-stella-guillermin-meta/oem-fix-esp
        fi
    ;;
esac

#DEBHELPER#
