Home

Published on 26/12/18 by Tomás Abril


Booting ArchLinux without a bootloader

Calling The Kernel EFI Stub directly from EFI firmware in the motherboard.

Archlinux wiki - EFI STUB

Recent versions of the Arch Linux kernel are built with the option to be booted directly by a UEFI motherboard, this is called EFISTUB. Using a bootloades like rEFInd or grub is still recommended if you are using multible operating systems.

Not all EFI firmware supports EFISTUB, but this should work on most computers made in the last few years.

Formatting partitions

EFI_system_partition

An Efi system partition should be between 100mb and 500mb.

I use cfdisk which is a command line graphic program to partition the disk, The EFI partition has to be set to type EFI System.

This are the partitions I ended up on my system.

/dev/sda1 is my efi partition and /dev/sda2 will be my root partition.

After the partitions are created you must format the esp as FAT32, you can do that with the command

# mkfs.fat -F32 /dev/sda1

Proceed with normal Arch instalation

Mount the esp partition to your /boot

Complete normal instalation but instead of installing a boot loader use the steps bellow.

Managing EFI Boot Loaders - Kernel EFI Stub Loader

Arch Wiki on EFI stub

Blog on Managing EFI Boot Loaders for Linux: Using the Kernel's EFI Stub Loader by Rod Smith

Page on efibootmgr, this is a Linux program to modify the EFI Boot Manager. We will use this to create and destroy boot entries and change boot order.

To list current boot options use the command
# efibootmgr

This gives me the following result. "Boot0000* Arch-Linux" is my current Arch Linux boot.

To delete an entry from this list use the command
# efibootmgr -b 0 -B

-b -B options are to modify and delete. 0 is the number of the entry, this is always an hexadecimal. In my case this command would delete my Arch-Linux boot entry.

Create a new boot entry
# efibootmgr --disk /dev/sda --part 1 --create --label "Arch-Linux" --loader /vmlinuz-linux --unicode 'root=/dev/sda2 rw initrd=\intel-ucode.img initrd=\initramfs-linux.img' --verbose

This command has to be exactly right to your system or your OS will not boot.

--disk /dev/sda The disk where the loader is located (not partition). Change according to your system
--part 1 EFI partition where loader will be created. Change according to your system
--create Create new boot entry and add to boot list
--label "Arch-Linux" Boot manager display label
--loader /vmlinuz-linux Name of the EFI loader
--unicode ' ' Inside the quotes is a list of kernel parameters, root and initrd are obligatory
root=/dev/sda2 Location of your root folder. Change according to your system
rw Mount as read/write
initrd=\intel-ucode.img This option is to enable microcode on your system. This is optional and depends on the cpu. Change according to your system
initrd=\initramfs‑linux.img Location of initial ram disk, note the backslash (\). If you mounted the efi partition to /boot this option can be used as shown
--verbose Show additional information during and after execution