KISS đź’‹  News  Blog  Install KISS  Team  Guidestones

Screenshots  Package System  Testimonials  Style

FAQ  Software  Contact  Donate  Wiki  GitHub ->

+-------------------------------------------------------------------+
|                                                                   |
|            WIKI - Using EFISTUB instead of a bootloader           |
|                                                                   |
+-------------------------------------------------------------------+

For some UEFI users, the Linux kernel has the ability to act as an 
EFI executable, which simplifies the boot process by removing the 
need for a bootloader.

PREREQUISITES

* Install efibootmgr

  $ kiss b efibootmgr && kiss i efibootmgr


* Mount efivarfs

  See https://k1ss.org/wiki/mounting-uefi-variables).


* Enable EFISTUB support in the kernel

  In the kernel configuration, enable CONFIG_EFI_STUB=y.

  In menuconfig, this is located at:

  Processor type and features  --->
      [*] EFI runtime service support
      [*]   EFI stub support

  Then recompile and install the kernel. Keep the kernel's name as 
  vmlinuz, and not vmlinuz-VERSION otherwise the boot entry will 
  have to be updated for every new kernel update.


CREATING A UEFI BOOT ENTRY

$ efibootmgr --disk /dev/sdX \
             --part N \
             --create "KISS Linux" \
             --loader '/vmlinuz' \
             --unicode 'root=/dev/sdYM' \
             --verbose

Where /dev/sdXN is your EFI system partition and /dev/sdYM is your 
root partition.

Check to see that the entry was added with 'efibootmgr --verbose'.

Find the entry's boot number XXXX, and the other entry's boot 
numbers (YYYY, ZZZZ, and so on), and set it as the first in the boot 
order with:

$ efibootmgr --bootorder XXXX,YYYY,ZZZZ --verbose


* Specifying root by PARTUUID

  The root partition can also be referred to by its partition UUID:

  --unicode 'root=PARTUUID=aaaaaaaa-aaaa-4aaa-aaa-aaaaaaaaaaaa'

  The root partition's UUID can be found using blkid.


* Kernel parameters

  In the above command, the --unicode option specifies the parameters 
  passed to the kernel. If you require other parameters to boot your 
  system, pass them here.


REMOVING A UEFI BOOT ENTRY

Find your entry's boot number XXXX using 'efibootmgr --verbose' 
and run:

$ efibootmgr --bootnum XXXX --delete-bootnum

The registered trademark Linux(R) is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis. (C) Dylan Araps 2019-2020 View page source