#!/bin/sh
# This is a simple script to update grub from the configuration file.
# Please note that after upgrading to a new grub version, you should
# first use "grub-install" to reinstall the bootloader, similar to this:
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --recheck
# or this:
# grub-install --target=i386-pc --recheck /dev/sdX

#if [ -e /boot/grub/grub.cfg ]; then
#  mv -n /boot/grub/grub.cfg /boot/grub/grub.cfg.old.$$ || exit 1
#fi

set -e
grub-mkconfig -o /boot/grub/grub.cfg "$@"

#if [ -d /sys/firmware/efi ]; then 
# bcd=/boot/efi/EFI/Microsoft/Boot/BCD
# if [ -f "$bcd" ]; then
#  windows_uefi >> /boot/grub/grub.cfg
# fi
#fi
