Skip to content

installer: create EFI NVRAM boot entry for EVE-OS after installation#5712

Merged
rene merged 1 commit intolf-edge:masterfrom
rucoder:rucoder/boot-entry-v2
Apr 21, 2026
Merged

installer: create EFI NVRAM boot entry for EVE-OS after installation#5712
rene merged 1 commit intolf-edge:masterfrom
rucoder:rucoder/boot-entry-v2

Conversation

@rucoder
Copy link
Copy Markdown
Contributor

@rucoder rucoder commented Mar 27, 2026

Description

After writing the EFI partition to disk, the installer did not create an EFI
NVRAM boot entry. On some hardware and firmware configurations this means
EVE-OS would not appear in the boot menu after installation and the system
might not boot into EVE without manual BIOS intervention.

This change adds create_efi_boot_entry() to the installer script. It:

  • Detects the EFI bootloader path by architecture (x86_64, ARM64, RISCV64)
    from the installer's own EFI files (available at /root/EFI/BOOT/ via the
    linuxkit init layer)
  • Removes any pre-existing "EVE-OS" NVRAM entries to avoid duplicates on
    reinstall
  • Creates a new NVRAM entry pointing to the correct EFI bootloader on the
    installed disk using efibootmgr

efibootmgr is added as a runtime dependency of the installer container.

tested on QEMU. EVE-OS entry appears in UEFI boot manager and works
image

PR dependencies

How to test and validate this PR

  1. Build an installer image: make installer
  2. Flash to USB and boot on an EFI-capable x86_64 or ARM64 device
  3. After installation completes, reboot and enter the BIOS/UEFI boot menu
  4. Verify an "EVE-OS" entry is present and the system boots from it
  5. Run the installer a second time on the same device and verify there is only
    one "EVE-OS" entry (no duplicates)

Alternatively, test in QEMU with OVMF:

make run-installer-raw   # installs to target.img
make run-target          # boots from target.img — should boot EVE without grub fallback

Changelog notes

EVE-OS installer now creates an EFI NVRAM boot entry during installation,
ensuring the device boots into EVE-OS automatically after installation on
EFI-capable hardware.

PR Backports

  • 16.0-stable: No
  • 14.5-stable: No
  • 13.4-stable: No

Checklist

  • I've provided a proper description

  • I've added the proper documentation

  • I've tested my PR on amd64 device

  • I've tested my PR on arm64 device

  • I've written the test verification instructions

  • I've set the proper labels to this PR

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

@rucoder rucoder requested a review from eriknordmark as a code owner March 27, 2026 22:27
@rucoder rucoder requested a review from rene March 27, 2026 22:29
@rucoder rucoder force-pushed the rucoder/boot-entry-v2 branch 6 times, most recently from f0485c6 to dafd328 Compare March 29, 2026 22:30
Comment thread pkg/installer/install
local DISK="$1"
local BOOTLOADER=''
local PLATFORM=''
mount -t efivarfs efivarfs /sys/firmware/efi/efivars || bail "FATAL: cannot mount efivarfs"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boot can work without forcing the creation of this entry, as it has been working so far. Do we really want to crash here in case of error(s)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rene it must never crash on EFI + EFI enabled kernel. if it wails - we are in real trouble

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still support legacy BIOS boot?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eriknordmark good question. but do we have to? I do not know any HW we use with legacy boot mode. I think we have not tested it for ages

e2fsprogs-dev
e2fsprogs-extra
e2fsprogs-libs
efibootmgr
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes more sense to put this change in the other commit, get-deps ensure dependencies will be built in the right other, so you don't need to worry.....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rene yes, I will split

@rucoder rucoder force-pushed the rucoder/boot-entry-v2 branch from dafd328 to 9b6531e Compare March 31, 2026 14:53
@github-actions github-actions Bot requested a review from rene March 31, 2026 14:54
Copy link
Copy Markdown
Contributor

@rene rene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rene
Copy link
Copy Markdown
Contributor

rene commented Apr 11, 2026

@rucoder , pls, rebase on top of master....

After writing the EFI partition to disk, the installer did not create
an EFI NVRAM boot entry. On some hardware and firmware configurations
this means EVE-OS would not appear in the boot menu and the system
might not boot into EVE without manual BIOS intervention.

Add create_efi_boot_entry() to the installer script. It detects the
EFI bootloader path by architecture (x86_64, ARM64, RISCV64) from the
installer's own EFI files, removes any pre-existing "EVE-OS" NVRAM
entries to avoid duplicates on reinstall, then creates a new entry
pointing to the correct EFI bootloader on the installed disk.

Add efibootmgr as a runtime dependency of the installer container.

Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
@rucoder rucoder force-pushed the rucoder/boot-entry-v2 branch from 9b6531e to 24a7d6b Compare April 20, 2026 10:23
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.68%. Comparing base (2281599) to head (24a7d6b).
⚠️ Report is 531 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5712      +/-   ##
==========================================
+ Coverage   19.52%   25.68%   +6.15%     
==========================================
  Files          19       24       +5     
  Lines        3021     4213    +1192     
==========================================
+ Hits          590     1082     +492     
- Misses       2310     2911     +601     
- Partials      121      220      +99     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rene rene merged commit ecbfebc into lf-edge:master Apr 21, 2026
41 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants