Hands-On: Adding UEFI boot to Tanglu Linux 4.0 Alpha

The Tanglu Linux 4.0 Alpha release does not include UEFI Boot support. Here's how I added it.
Written by J.A. Watson, Contributor
The Tanglu GNU/Linux Gnome 3 Desktop.
Image: J.A. Watson
Despite the fact that I always have openSuSE, Debian, Fedora, and Linux Mint installed on my systems, I am quite interested in some of the 'smaller' Linux distributions I have come across.

One such distribution is Tanglu GNU/Linux, an independent distribution based on Debian which offers KDE, Gnome, and Core (no GUI desktop) versions.

When I saw that Tanglu had announced an Alpha release of their next version (4.0 Dasyatis kuhlii), I decided to take a look at it, specifically to see how they are doing with UEFI firmware support. They have been struggling with UEFI until now, with preliminary support showing up in one of the previous releases, but never working quite right and then disappearing again.

I was initially disappointed to see that there is no mention of UEFI support in the release announcement, and even more so when I found that the Live ISO image doesn't include UEFI boot capability. Normally I would have given up at this point, and just installed it on my few remaining MBR systems, but this has turned out to be a slow week because the Fedora 23 final release has been postponed, so I decided to poke around in the Tanglu Alpha a bit more.

First I did a 'Legacy Boot' (MBR) installation on one of my UEFI systems. To do that I had to go into the BIOS setup and change the boot mode from UEFI to Legacy, then boot the Live USB stick that I had created from the Tanglu download. From the Live image I ran the calamares installer, and made a normal installation. In the 'Expert' disk partitioning, I told it to install the bootloader to the root partition (/) rather than the MBR -- not strictly necessary, but I like to keep the disk as orderly as possible, and I plan to make this a UEFI boot, not an MBR boot.

On rebooting after the installation completed, I went directly back to the BIOS setup and changed the boot mode back to UEFI. You have to pay attention here, because there may be some side effects of this change, depending on the specific system, BIOS, and bootloader(s) you have installed. Don't be surprised if the UEFI boot doesn't default to the same installation that it was before you changed to Legacy and back, you might have to reset the boot contents and sequence using efibootmgr after you reboot.

After I reset the BIOS configuration and booted openSuSE (always the default on my systems), I ran the grub2-mkconfig utility to generate a new boot configuration file, and that found and configured the new Tanglu installation. At this point I could have stopped, because I could now successfully multi-boot Tanglu along with the other Linux installations. However, openSuSE performs the actual boot of Tanglu using linuxefi and initrdefi directives, and I still can't boot Tanglu 'standalone' in UEFI boot mode.

The next step was to go ahead and boot the Tanglu installation. Remember, I interrupted the initial boot after installation so that I could change the BIOS setting back to UEFI boot, so this was actually the first time the installed Tanglu has been booted. I was pleased that it came up with no problem.

Once it was up and running, I poked around a bit and saw that it was a normal-looking MBR (non-EFI) installation. It had grub2 installed, which is the standard package, it did not have the efibootmgr utility installed, and of course there was no /boot/efi directory nor was the EFI boot partition mounted anywhere. At this point I still wasn't sure that I would succeed, because I remember that manually configuring the GRUB EFI boot installation used to be pretty nasty.

I created a /boot/efi directory, and then added an entry in /etc/fstab to automount the EFI boot partition. This is the only part which can be a bit tedious/tricky, if you don't have a running EFI boot Linux system to copy this from, the line should look like this:

UUID=23C1-7413 /boot/efi vfat umask=0002,utf8=true 0 0

Of course, the UUID would have to be adjusted to match whatever is on your system. Otherwise that is a pretty standard command to mount a FAT32 filesystem on Linux.

With that done, and the EFI boot partition actually mounted (mount -a or mount /boot/efi as root), the next step was to install the EFI boot packages. Since Tanglu is derived from Debian, this can be done with the apt-get utility. There are 32-bit and 64-bit specific versions, so the command that I had to use was:

apt-get install grub-efi-amd64

As it turns out, because of dependencies and exclusions, this command does several interesting and useful things. It not only installs the grub-efi package, it also installs the efibootmgr utility, which is indispensable on a UEFI boot Linux system, and it removes the grub-pc and grub2 packages so there will be no conflicts. All of this only takes a minute or so. Nice.

Once the packages have been installed, you're basically set to go. As I mentioned above, the command to actually install and configure GRUB UEFI booting was rather complicated, as you had to specify various paths, names and architectures on the command line. This seems to have been simplified in recent versions, because all I had to do was type:

grub-install /dev/sda

Zowie! It doesn't get much easier than that... and in fact, that is exactly the same syntax that has been used with grub2 for a default installation on an MBR system. The command reported that "no errors were detected", and I poked around a bit to see exactly what it had done.

There was now a new directory /boot/efi/EFI/tanglu, and it contained a grubx64.efi file, which is the GRUB boot image. There was also a file /boot/grub/grub.cfg, which contained the information necessary to actually boot. Using the newly installed efibootmgr I could see that it had also added a boot line for Tanglu, and that line was listed first in the boot sequence.

It really looked like everything was done, and it was ready to boot. So I rebooted and -- hooray -- Tanglu came right up, using EFI boot! I am pleased, and surprised, and a bit amazed that it was as easy as that.

I have just a bit more work to do on this, because I will put it back to booting openSuSE Tumbleweed by default and then add Tanglu as an EFI chainloader option. But all of that is very routine and will certainly not present any problems.

As this is a very early pre-release of Tanglu 4, I don't have anything to say about it in detail. I will only observe that it looks very good, amazingly stable for an Alpha release. I am very much looking forward to the final release.

More on Linux and open source:

Editorial standards