#!/bin/sh

# get target path of new system
TARGET="${1}"

# config grub
if [ -d ${TARGET}/usr/share/plymouth/themes/astra-theme ] 
then
    sed -i 's/quiet/quiet splash/g' ${TARGET}/etc/default/grub
    chroot ${TARGET} plymouth-set-default-theme -R astra-theme

    # dirty hack
    if [ -f ${TARGET}/usr/share/plymouth/debian-logo_orig.png ] 
    then
        chroot ${TARGET} cp /usr/share/plymouth/debian-logo_orig.png /usr/share/plymouth/debian-logo.png
    fi

    chroot ${TARGET} update-grub2
    chroot ${TARGET} update-initramfs -u
fi
