error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
set -x
+# do only execute for Debian and similar distros
+if ! ifclass DEBIAN ; then
+ exit 0
+fi
+
set -a
# do not set up grub during dirinstall
# disable os-prober because of #802717
ainsl /etc/default/grub 'GRUB_DISABLE_OS_PROBER=true'
+# efivars may still be mounted from the host system during fai-diskimage
+if [ -d $target/sys/firmware/efi/efivars ]; then
+ umount $target/sys/firmware/efi/efivars
+fi
+
# skip the rest, if not an initial installation
if [ $FAI_ACTION != "install" ]; then
$ROOTCMD update-grub