BIOS boot anomalies with Endless

My Thinkpad X220 has two internal drives. One is an mSATA in a PCIe slot and the other is in a regular SATA drive bay. The X220 is set to boot using UEFI. Pressing F12 on boot up allows me to select the drive to start from. I have noticed an anomaly with the Endless OS entry in the boot list.

Whenever I boot from the drive containing Endless OS, Endless moves itself to the default boot position. This is not a major problem, it is common if you try out a new OS it will generally move itself into the default position. I have never seen an OS besides Endless though that will move itself into the default position every time the OS is booted.

If I presses F1 on boot I am taken to the BIOS setting and in the BIOS settings I can set the default drive or OS to boot from. And this is where the irksome anomaly appears. If Endless OS is in the boot order, it will always appear as the default. I can change the boot order settings, and while the order appears to change, Endless continues to place itself as the default boot loader even if I move it down the list and save the settings (F10 on a Thinkpad x220).

I know this is a convoluted description. I can and have worked around this, however I was wondering if this anomaly I am experiencing is something others might have noticed and might be the cause of some problems people report on trying to boot from USB or boot to other Ones. The only way I can change Endless from being the default boot loader is to completely delete it from the boot options. In the case of the X220 I can still boot to Endless by selecting the drive Endless is install on as the boot drive. And then when I do boot into Endless OS, Endless makes itself the default boot boot option once again.

Endless seems to be writing changes to the BIOS boot loader beyond what it should be doing.

Bill

Why was this post moved to a different topic. It is not a request for help, it simply a report on what I consider to be an anomaly in the way Endless handles booting. It is a feedback post.

bill

In theory, Endless’s bootloader only adjusts the UEFI BootOrder if it is run from the “fallback” path, \EFI\BOOT\bootx64.efi. It scans for \EFI\*\BOOT.CSV and adds BootOrder entries accordingly. If it’s run from \EFI\Endless\shim.efi it should not be touching the boot order. (This is standard upstream Shim behaviour.) Are you able to check the path for the Endless OS boot order entry from the firmware settings?

@wjt, Thank you for your response. I did get a chance to do some more checking on the boot order on my machine.

Whenever I format a disk, I format GPT and create an EFI partition, 512MB, formatted FAT. This partition is generally hidden, and it can be hard to just get it mounted to see what ends up installed on that partition. Most installers even when you select erase or format the drive for a clean install do not format or erase the EFI partition and just add the OS boot info into the existing EFI partition. This results in the BIOS boot info often listing boot options that simply do not exist on the physical media. And it also indicates that the firmware must populate the boot options by reading info on the disks and saving the information. I have no idea how it does this nor where the information is stored.

What appears to happen when you install Endless on a multiple drive system where both drives have an EFI partition is that Endless writes its boot information to the EFI partitions on both hard drives. The information that is written to the EFI partition on the drive where Endless is installed successfully boots Endless. The information that is written to the EFI partition that Endless is no installed on, does not point to valid boot information, resulting in dropping to the Grub command line.

Just a guess as to what is happening on my specific system when Endless gets installed. I have Windows installed on the second hard drive. I assume the Endless installer installs correctly to the first harddrive, then sees a valid Windows install on the second hard drive and then follows the install procedure to dual boot with Windows. In the case of my setup, it should really just ignore the second hard entirely. Or of course as an alternative I should have probably just removed the Windows hard drive before I installed Endless.

I can work around any quirks created. I think this is something of an odd edge case and there is probably very little reason you need to expend resources looking into this.

Thanks again for your response. Enjoy your weekend.
bill

Weird. I’m assuming from your description that you’re installing Endless OS by booting from a USB stick and clicking “Reformat”, rather than using the Endless Installer for Windows, which is an app you run under Windows.

The reformatter just overwrites the whole drive with a new disk image, including an ESP. It doesn’t touch any other disks, or adjust the boot order. The boot order is only adjusted when booting from \EFI\BOOT\BOOTX64.EFI on the ESP, which is the fallback when no boot order is configured – this is probably what happens if you tell the firmware to boot from a specific drive.

There is some logic that assumes that the boot device (in the EFI case, I believe this is the disk that holds the EFI executable that’s running) is on the same disk as the root partition. If you can still reproduce this problem, could you run the following commands at the GRUB command line:

echo $bootdev
echo $root
echo $prefix
ls
ls ($root)
ls ($prefix)

and send a picture?

We don’t do anything to detect Windows from the reformatter.

I always thought that the install process for Grub involved finding all bootable systems and making them available. Watching the verbose install or update/upgrade typically shows “update-grub” shell script running and as far as I know part of the script involves looking for bootable systems. That of course might be something just specific to Ubuntu.

Figuring out how to get booted is not a big issue. And of course Endless is very very stable so once booted it generally runs until some update makes a restart necessary. So I guess the biggest thing that would keep me from dealing with any anomalies would be simply updating Endless less often :slight_smile:

bill

You’re right, and that’s not Ubuntu-specific. It’s Endless that’s the odd one out. Endless OS doesn’t use update-grub – the bootloader is pre-installed in the disk image written to disk by the reformatter.

Thank you for your explanations. I hope I am not taking up too much of your time. I do not really understand how Grubs works. I had assumed that besides looking for other systems the update-grub was also the script that generated the grub configuration files.

I guess you then just have a generic grub config file that is installed as well(?), and I again without really know ing how grub works, I assumed the config file contained information that is specific to hardware that grub would be booting. (although now that I think about it, a generic grub config file, must be what is used on “live” images)

Thank you again for the information.
bill