1
0
Fork
You've already forked uki-efi-boot
0
A simple utility that automatically scans for efi executables creates boot entries for them in the UEFI boot menu
  • Shell 91.4%
  • Makefile 8.6%
2026年01月30日 11:53:01 +05:30
.gitignore Initial commit 2026年01月30日 11:53:01 +05:30
LICENSE Initial commit 2026年01月30日 11:53:01 +05:30
Makefile Initial commit 2026年01月30日 11:53:01 +05:30
README.md Initial commit 2026年01月30日 11:53:01 +05:30
uki-efi-boot Initial commit 2026年01月30日 11:53:01 +05:30
uki-efi-boot.conf Initial commit 2026年01月30日 11:53:01 +05:30

uki-efi-boot

A simple utility partly inspired by uefi-mkconfig.

It automatically scans for efi executables in the configured directories on all mounted esp partitions and creates boot entries for them in the UEFI boot menu.

Features

  • Override the boot entries by making a text file with the same name as the efi executable in /etc/uki-efi-boot.d. You can also create a file without a corresponding efi file to create an entry, in which case you need to specify the loader path of the efi file you want to reference with LOADER and PART.

    Note

    The efi executables are added before any remaining custom boot entries are added. Check the config at /etc/uki-efi-boot.conf to see what you can configure.

    eg:

    # /etc/uki-efi-boot.d/00-arch-linux.efi
    EXTRA_ARGS="quiet splash"
    
    # /etc/uki-efi-boot.d/10-arch-linux-verbose
    # You *must* use single quotes for the backslashes to work. Alternatively you
    # can use forward slashes.
    LOADER='\EFI\Linux00円-arch-linux.efi'
    PART=/dev/nvme0n1p1 # You might want to use /dev/disk/by-uuid/... instead
    LABEL_FMT="%NAME (%VERSION_ID~verbose)"
    
    # /etc/uki-efi-boot.d/90-arch-linux-snapshot-20260122145637
    LOADER='\EFI\Linux00円-arch-linux.efi'
    PART=/dev/sda1
    LABEL_FMT="%NAME Snapshot 2026年01月22日 14:56:37 (%VERSION_ID)"
    EXTRA_ARGS="rootflags=subvol=@/.snapshots/1/snapshot quiet splash"
    

    Warning

    Some devices don't support adding cmdline args to the UEFI boot entry. In that case, just include the cmdline in your UKI and don't set any EXTRA_ARGS.

Pros

  • No need for a dedicated bootloader.
  • You can use the same uki with different cmdline args to save on space.
  • You can automate the creation of entries for different configurations (like snapper snapshots).

Cons

  • It's not very portable if you choose to use the overrides to set the cmdline.
  • Separating the cmdline means you rely on your device's UEFI implementation for security. You should probably configure your UKI to have a default cmdline anyway for portability.
  • Currently depends on systemd-ukify so it won't work on non-systemd distros. Contributions are welcome.

Packaging

Dependencies:

  • bash
  • efibootmgr
  • envsubst (gettext)
  • getopt, lsblk (util-linux)
  • jq
  • ukify (systemd-ukify)
mkdir ./pkg
make INSTALL_ROOT="$(pwd)/pkg" BINARY_PATH=/usr/bin install

Usage

$ uki-efi-boot --help
Utility to automatically add and update UEFI boot entries.
Usage:
 uki-efi-boot [options]
Options:
 -c, --config <file> Path to config file (Current: /etc/uki-efi-boot.conf)
 -b, --boot-dir <dir> Path to boot entry directory (Current: /etc/uki-efi-boot.d)
 -d, --dry-run Show the changes that will be made without actually making those changes
 -v, --verbose Print additional messages
 -h, --help Show this message and exit
 -V, --version Show the utility's version and exit