From 547ef2c399fb2bb382b3d6c28c309acdb4377bbd Mon Sep 17 00:00:00 2001 From: sean Date: Tue, 23 Jul 2019 13:40:16 -0700 Subject: [PATCH] try this version that erases stuff --- setup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 4727088..9ff4d27 100644 --- a/setup.sh +++ b/setup.sh @@ -308,7 +308,15 @@ echo ' echo "Failed to create dos file system for EFI partition - $errors"' >> / echo " exit 100">> /mnt/setup-chroot.sh echo "fi">> /mnt/setup-chroot.sh echo "echo PARTUUID=$(blkid -s PARTUUID -o value /dev/disk/by-id/${firstdisk}-part2) /boot/efi vfat nofail,x-systemd.device-timeout=0 0 1 >> /etc/fstab" >> /mnt/setup-chroot.sh -echo "errors=\$(mount /boot/efi 2>&1 1>/dev/null && apt install -y grub-efi-amd64-signed shim-signed 2>&1 1>/dev/null)" >> /mnt/setup-chroot.sh + +echo "echo \"\"" >> /mnt/setup-chroot.sh +echo "echo \"Mounting /boot/efi and cleaning past boot items...\"" >> /mnt/setup-chroot.sh +echo "mount /boot/efi 2>&1 1>/dev/null" >> /mnt/setup-chroot.sh +# clear past boots +echo "for f in \`efibootmgr -v | grep -e '^Boot[0-9]\\+' | sed 's/^Boot\\([0-9]*\\).*/\\1/g'\`; do efibootmgr -b \$f -B; done" >> /mnt/setup-chroot.sh +echo "echo \"Done.\"" >> /mnt/setup-chroot.sh + +echo "errors=\$(apt install -y grub-efi-amd64-signed shim-signed 2>&1 1>/dev/null)" >> /mnt/setup-chroot.sh echo 'if ! [ "$?" = "0" ]; then '>> /mnt/setup-chroot.sh echo ' echo "Failed to mount EFI partition or install grub-EFI - $errors"' >> /mnt/setup-chroot.sh echo " exit 1">> /mnt/setup-chroot.sh