Page 1 of 1

Booting up systems with hardcoded lookup for Windows EFI file

Posted: Sat Jan 06, 2018 3:47 pm
by jb95x
WARNING: Only do this if you only have Solus installed. That's the only test case I did. It might work well on Linux multi-booting, not Windows, but I don't know for sure.

Some laptops, mainly from around the time EFI was introduced, have hardcoded lookups for the Windows EFI file.

This can lead to some annoyances like:

  • System not booting
  • At boot time a message being displayed saying that there's no media to boot from and then after some time it boot's (because of fallback efi file location)
To work arround this I made a simple script that most likely will be a one shot solution.

If your computer doesn't boot try this: https://solus-project.com/articles/trou ... rescue/en/

Then just do the following:

From the terminal

  • Type: nano fixuefi.sh
  • Paste the following code from above, or type it

Code: Select all

#!/bin/bash
current="$PWD"
echo "Insert ESP partiton (ex: sda1) [Press Enter for sda1]"
read partition
if [ -z "$partition" ]; then
    partition="sda1"
fi
echo "Mounting ESP partition to boot"
mount /dev/$partition /boot
echo "Creating folders"
cd /boot/EFI
mkdir Microsoft
cd Microsoft
mkdir Boot
cd Boot
echo "Applying fix"
cp /boot/EFI/Boot/BOOTX64.EFI ./bootmgfw.efi
cd $current
umount /dev/$partition
echo "Fix Applied"
  • Then press Ctrl+X, type y, and press Enter
  • Type chmod +x fixuefi.sh
Now we just need to know where the boot partition is. To know that you can do one of the following:

  • Go to gparted and see in the disk in which Solus is installed the partition that has the flags: boot, esp
  • Type lsblk -f and see wich one has a vfat filesystem (Not the best method but usually works)
After you got the partition reference (ex: sda1), just do the following:

  • sudo ./fixuefi.sh
  • Type your user password
  • Insert your boot partition and press Enter
And that's it! :D

If you want you can delete that file with: rm fixuefi.sh
But I would not delete it because if something happens you can just run it again and it might fix it, it's just there ready to be used.
You can then reboot and see if it worked.