Uldreth
Posts: 8
Joined: Tue Aug 15, 2017 10:53 am

Using GRUB with Solus on UEFI

Mon Sep 04, 2017 6:24 pm

Introduction:

For Legacy/MBR, Solus uses GRUB as bootloader, like most other modern GNU/Linux distributions. However, for EFI/GPT, Solus uses a bootloader called goofiboot, instead of GRUB.

It needs to be said, that Legacy/MBR allowed only one bootloader to exist per physical drive, hence a good bootloader had to be able to handle multiple operating systems, if a multiboot scenario was to be realized. Which is also the reason why in Legacy mode with MBR partitioning scheme, if one wishes to dual boot MS Windows with a Linux distro, one should install Windows first. Both operating system will override the other's bootloader, but only Linux' bootloader (GRUB) can handle both systems.

UEFI/GPT changed this. Multiple bootloaders can exist simultanously on a partition called ESP (EFI System Partition - not to be confused with extrasensory perception). These bootloaders can be swapped in EFI. There are usually two ways to go around that. In the main EFI interface (obtained by incessantly hammering a key like F2, F12 etc. during startup), one should see something like this:

Image

Do note that my machine is an ASUS X550V laptop, different models will have different layouts for the interface. Here "boot" denotes the bootloader for my Arch Linux installation (which is GRUB), and "Linux Boot Manager" denotes the Solus bootloader (which is goofiboot). One my select a bootloader, and that will be used as default from then on.

The other way is to hammer a different key (for me, it is ESC), then one may arrive at a menu that looks like this:

Image

This is often called the "One-time boot menu", here a selection does not change the default bootloader. Selecting "boot" (Arch Linux' GRUB) will give the usual GRUB screen (at this stage, without the Solus entry):

Image

while selecting "Linux Boot Manager" will give Solus' boot menu:

Image

If the Solus boot menu doesn't appear for you, you can make it appear by hammering a key (like space), and you can set timeout by booting into Solus, and typing

Code: Select all

sudo clr-boot-manager set-timeout 5
then

Code: Select all

sudo clr-boot-manager update
then reboot. This will set a timeout of 5 secs.

Thus, dual booting is possible without problems, through EFI's own boot menu. Some people (me definitely) might find this inconvenient, however, and may wish to use a single bootloader for all their operating systems. This guide will explain how to use the bootloader of another Linux distribution (provided said distro uses GRUB) to boot both that distro and Solus. For me this other distro is Arch Linux, however for the sake of neutrality I will refer to it as "Other Linux".

Steps:

I will note that Solus with UEFI simply doesn't support GRUB. Period. I assume it is absolutely possible to set it up properly with GRUB, but this would include having to do some major manipulation of the distro at a pretty low level, this is probably both hard and dangerous. Instead, we will simply make an entry in Other Linux' GRUB, which will point to Solus' bootloader. The GRUB entry will only invoke Solus' bootloader, and then Solus' bootloader will boot Solus.
  • Step 1: Boot Other Linux.
  • Step 2: We will need to check two things. One is, how does the /boot folder of Other Linux look like. In particular, within /boot, we need to find something like /boot/EFI/goofiboot/goofibootx64.efi. This is just one possible path, afaik it can also be /boot/efi/EFI/goofiboot/goofibootx64.efi. You will need to remember this path. Here is a screenshot of mine for reference:

    Image
  • Step 3: The other thing we need to check is the name of the ESP (EFI System Partition). This will be almost certainly sda1, but do check it. Here is a screenshot of GParted showing my ESP:

    Image
  • Step 4: Use a text editor (in my case, it is nano, use whatever you want, but you must be able to open a file with root rights) to open /etc/grub.d/40_custom . Remember we are still in Other Linux. For nano, you can do this by

    Code: Select all

    sudo nano /etc/grub.d/40_custom
    Leave the contents of this file alone, but add the following code to the end of the file:

    Code: Select all

    menuentry "Solus" {
            insmod part_gpt
            insmod fat
            set root="hd0,gpt1"
            chainloader /EFI/goofiboot/goofibootx64.efi}
    Things to note here: hd0 is the name of your physical drive. It numbers from 0. So first drive is hd0, second hd1 etc. gpt1 is essentially sda1, if hd0 corresponds to sda. You will need to place the correct names here. The path in the entry that starts with "chainloader", it might also need to be modified, depending on the path I have asked you to check in Step 2. Everything after /boot should be here, but if it doesn't work, feel free to experiment. Here is a screenshot:

    Image

    Afterwards save and exit (for nano, press ctrl+X, then when it asks if you want to save it, press Y for "yes").
  • Step 5: Open a terminal and type

    Code: Select all

    sudo grub-mkconfig -o /boot/grub/grub.cfg
    to refresh GRUB. Now reboot and if needed, set EFI to use Other Linux' bootloader (in my example, "boot"). When it gets to GRUB, there should be an entry for Solus. When you select that entry, you should arrive at Solus' bootloader menu.

jppmarujo
Posts: 2
Joined: Sun Oct 01, 2017 1:12 am

Re: Using GRUB with Solus on UEFI

Mon Oct 02, 2017 2:23 am

Great tutorial!
Can i ask what Conky theme are you using and how can i get it? It looks amazing (it seems some derivative of Vision).

Thank you, for both things! :)

Primitus
Posts: 2
Joined: Sat Mar 17, 2018 8:52 pm

Re: Using GRUB with Solus on UEFI

Sat Mar 17, 2018 9:03 pm

This solves my problem with using UEFI and GPT. It's my first time in the world of UEFI and goofiboot (my world was only MBR/GRUB). I now understand why my Solus boot menu disappears or why after the Acer splashes, blank screen loops. Thank you for this sharing!

_____
Acer Aspire 14 E5-475
Core i5-7200U
4GB DDR4
120 SSD
Intel HD Graphics 620
Nvidia GeForce 940MX

kungpaogao
Posts: 5
Joined: Thu Feb 08, 2018 6:11 am

Re: Using GRUB with Solus on UEFI

Mon May 14, 2018 2:24 am

Thank you so much for this tutorial! This helped me add Solus to my GRUB2 menu so that I can conveniently triple-boot Windows, Xubuntu, and Solus.

I did have to slightly change the process for my setup, so here are some things to note:
  • Regarding steps 2 and 4, even though goofibootx64.efi may be at /boot/efi/EFI/..., your mount point for the partition may be /boot/efi, so you can still keep the "chainloader" line as:

    Code: Select all

    chainloader /EFI/goofiboot/goofibootx64.efi
    
    You can find the mount point through GParted under the "Mount Point" column.
  • For step 4, I just wanted to clarify that hd0 = first drive, hd1 = second drive, hd2 = third, etc. AND gpt1 = sda1, gpt2 = sda2, etc. Depending on your configuration, you might have to switch this value. Use GParted to look for the partition named "EFI system partition"; it should be fat32 (at least it is in my case) and have a mount point of /boot or /boot/efi.
  • For step 5, on Ubuntu systems (on other distros, you may need to install the package), you can just use

    Code: Select all

    sudo update-grub
    instead of copying/typing out the grub-mkconfig command (though, if you enter it once, you can just use the up arrow to recall it).

Once again, thank you @Uldreth!

Uldreth
Posts: 8
Joined: Tue Aug 15, 2017 10:53 am

Re: Using GRUB with Solus on UEFI

Thu May 24, 2018 9:44 am

kungpaogao wrote:
Mon May 14, 2018 2:24 am
  • Regarding steps 2 and 4, even though goofibootx64.efi may be at /boot/efi/EFI/..., your mount point for the partition may be /boot/efi, so you can still keep the "chainloader" line as:

    Code: Select all

    chainloader /EFI/goofiboot/goofibootx64.efi
    
    You can find the mount point through GParted under the "Mount Point" column.
Yeah, when I wrote this, I wasn't fully aware how bootloaders work. May update when I get myself together for it lol.
[*]For step 4, I just wanted to clarify that hd0 = first drive, hd1 = second drive, hd2 = third, etc. AND gpt1 = sda1, gpt2 = sda2, etc. Depending on your configuration, you might have to switch this value. Use GParted to look for the partition named "EFI system partition"; it should be fat32 (at least it is in my case) and have a mount point of /boot or /boot/efi.
Agreed, this might need more qualification. However it would probably be the best to use UUIDs instead of names, but when I did this originally, I was too lazy to look up the UUIDs. I never had an issue with this setup here, however I originally did my first chainloading when I dual booted Arch Linux and FreeBSD, and if I had a USB stick in my computer when I did a boot, it screwed up, because for whatever godforsaken reason Grub named my USB stick hd0. UUIDs fix this.

[*]For step 5, on Ubuntu systems (on other distros, you may need to install the package), you can just use

Code: Select all

sudo update-grub
instead of copying/typing out the grub-mkconfig command (though, if you enter it once, you can just use the up arrow to recall it).
[/list]


Once again, thank you @Uldreth!
Dunno if there is a general package for this, I just wrote this because I thought update-grub was an Ubuntu-only thing. Do you know how is this package called?

At any rate, I'm glad that this guide is useful.

Return to “Tutorials”