What size boots do you wear?

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
3,284
Reaction score
3,037
Credits
29,214
Have you ever wondered about how your computer boots into Linux?

Am I using EFI or Legacy BIOS?
Does my BIOS support TPM? TPM2?
Does my computer support secure boot? Am I using secure boot?
What boot loader am I using currently?
What is my default boot loader?
Which initramfs am I using?

Have you ever noticed, when you go into your UEFI boot options, it will list the name of the
distro's you have booted from at least once. Where did it get that info?

Now of course there are multiple ways to find these things out.
You can always boot into the UEFI/BIOS and see some of these things for yourself if you know where to look and what to look for.

But that's sometimes inconvenient to do every time I want to get a little info.

So Use the bootctl command

It's very easy to use.

Code:
bootctl

Note: This only works on EFI systems. If it doesn't work, you're probably booted using Legacy BIOS.
There are some flags that will give you more specific information, You can use help to see them.

Code:
bootctl --help

But if you don't add an option flag, it shows you pretty much everything.

On my distro, this partially runs as any user, but I do get some errors.
If I sudo or run as root, then I get no errors.

One thing I found interesting here. This command will show you where your UEFI
expects the path of your bootloader to be. Believe it or not, not all Linux distro's
use these default directories. It still works, but adds a second or two to your boot time
while your computer figures it out.
 
Last edited:


brian@brian-desktop:~$ bootctl --help
Command 'bootctl' not found, but can be installed with:
sudo apt install systemd-boot
brian@brian-desktop:~$ sudo bootctl --help
sudo: bootctl: command not found
brian@brian-desktop:~$

Running LM22.1 Cinnamon
 
I often use mokutil and efibootmgr to manage my boot stuff, and so far I found them enough.

Those are usually installed by default on EFI systems.

Code:
gvisoc@vao:~$ efibootmgr
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,2001,2002,2003
Boot0000* Fedora        HD(1,GPT,95ee48e1-a911-46fe-9448-6ae247555309,0x800,0x12c000)/\EFI\fedora\shim.efiRC
Boot2001* EFI USB Device        RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC
gvisoc@vao:~$ mokutil --sb-state
SecureBoot enabled
gvisoc@vao:~$
 
Hmm.. after a little more testing, this seems to be a fedora, redhat thing. My apologies.

Code:
t# bootctl
systemd-boot not installed in ESP.
System:
      Firmware: n/a (n/a)
 Firmware Arch: x64
   Secure Boot: disabled
  TPM2 Support: yes
  Measured UKI: no
  Boot into FW: supported

Current Boot Loader:
      Product: n/a
     Features: ✗ Boot counting
               ✗ Menu timeout control
               ✗ One-shot menu timeout control
               ✗ Default entry control
               ✗ One-shot entry control
               ✗ Support for XBOOTLDR partition
               ✗ Support for passing random seed to OS
               ✗ Load drop-in drivers
               ✗ Support Type #1 sort-key field
               ✗ Support @saved pseudo-entry
               ✗ Support Type #1 devicetree field
               ✗ Enroll SecureBoot keys
               ✗ Retain SHIM protocols
               ✗ Menu can be disabled
               ✗ Boot loader sets ESP information
          ESP: n/a
         File: └─n/a

Random Seed:
 System Token: not set
       Exists: no

Available Boot Loaders on ESP:
          ESP: /boot/efi (/dev/disk/by-partuuid/f1d9a5aa-bdac-4268-ae00-5884c412833b)
         File: ├─/EFI/BOOT/fbx64.efi
               └─/EFI/BOOT/BOOTX64.EFI

Boot Loaders Listed in EFI Variables:
        Title: Fedora
           ID: 0x0000
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/f1d9a5aa-bdac-4268-ae00-5884c412833b
         File: └─/EFI/fedora/shimx64.efi

Boot Loader Entries:
        $BOOT: /boot/efi (/dev/disk/by-partuuid/f1d9a5aa-bdac-4268-ae00-5884c412833b)
        token: fedora

I have been trying to keep these tutorials pretty system agnostic for the most part.
 
One thing I found interesting here. This command will show you where your UEFI
expects the path of your bootloader to be. Believe it or not, not all Linux distro's
use these default directories. It still works, but adds a second or two to your boot time
while your computer figures it out.
My laptop's UEFI only likes the fallback location: /efi/boot/BOOTX64.EFI (yep, each fresh install needs a move and rename to GRUB running). Still, it's soon to enter 9 years active service.

Hmm.. after a little more testing, this seems to be a fedora, redhat thing. My apologies.
Lol, was about to mention that. It's still in Bullseye, and obviously Testing and Unstable (so maybe in Debian-derived distros based on Testing). It seems to have been merged into systemd-boot-efi suite (will check in a VM, not breaking my system ATM, lol).
It's hard to keep things agnostic these days. While the disagreement re systemd has mostly settled, there are more nuanced debates like how much systemd we have, etc. I'll be honest, I'm in the conservative camp here. Always have been, but with the recent rollouts and some of the optional stuff over the years, systemd is more/less set to take over everything. Whether that's good or bad depends on who's sitting at the other end of the monitor.
 
It's still in Bullseye

It's in openSUSE also, maybe that's why I assumed (yeah, I know what that word means) everyone had it.
 

Members online


Top