Repository navigation
Restore EFI/BOOT/BOOTX64.EFI fallback loader - #27
Merged
Merged
Conversation
The UEFI default/removable-media path EFI/BOOT/BOOTX64.EFI was populated until commit e66d648, which dropped the block that copied the loader there. The EFI/BOOT directory is still created but left empty, so systems that rely on the fallback path fail to auto-boot. This affects removable and USB-attached drives, where firmware typically does not persist the efibootmgr NVRAM entry and instead looks for EFI/BOOT/BOOTX64.EFI. Repopulate that path with rEFInd (plus REFIND.CONF, ICONS, and background.png) or the BSD loader, matching the current EFI/refind and EFI/<system> copies. Fixes ghostbsd/issues#377
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRestores population of the UEFI fallback boot path EFI/BOOT/BOOTX64.EFI so removable/USB-attached drives can auto-boot using either rEFInd or the BSD loader, matching existing EFI layout. Flow diagram for restored EFI fallback boot loader populationflowchart TD
A[setup_efi_boot] --> B[Check /usr/local/refind exists]
B --> C[Check EFILOADER = refind]
C -->|both true| D[Copy refind_x64.efi to EFI/BOOT/BOOTX64.EFI]
D --> E[Copy refind.conf-sample to EFI/BOOT/REFIND.CONF]
E --> F[Copy icons directory to EFI/BOOT/ICONS]
F --> G[Copy background.png to EFI/BOOT/background.png]
C -->|any check fails| H[Copy boot/loader.efi to EFI/BOOT/BOOTX64.EFI]
G --> I[umount $FSMNT/boot/efi]
H --> I
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new fallback copy logic assumes ${FSMNT}/boot/efi/EFI/BOOT already exists; consider explicitly ensuring this directory is created in this function before issuing the cp commands so the behavior remains robust if earlier setup changes.
- Hardcoding BOOTX64.EFI for the fallback path may not be appropriate for non‑x86_64 architectures; consider making the filename conditional on the target architecture similarly to how other EFI loader paths are handled.
- You now have two places where the main EFI loader is being copied (EFI/ and EFI/BOOT); consider refactoring into a small helper or using shared variables so both locations stay consistent if loader names or paths change in the future.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new fallback copy logic assumes ${FSMNT}/boot/efi/EFI/BOOT already exists; consider explicitly ensuring this directory is created in this function before issuing the cp commands so the behavior remains robust if earlier setup changes.
- Hardcoding BOOTX64.EFI for the fallback path may not be appropriate for non‑x86_64 architectures; consider making the filename conditional on the target architecture similarly to how other EFI loader paths are handled.
- You now have two places where the main EFI loader is being copied (EFI/<system> and EFI/BOOT); consider refactoring into a small helper or using shared variables so both locations stay consistent if loader names or paths change in the future.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The UEFI default/removable-media path EFI/BOOT/BOOTX64.EFI was populated until commit e66d648, which dropped the block that copied the loader there. The EFI/BOOT directory is still created but left empty, so systems that rely on the fallback path fail to auto-boot.
This affects removable and USB-attached drives, where firmware typically does not persist the efibootmgr NVRAM entry and instead looks for EFI/BOOT/BOOTX64.EFI. Repopulate that path with rEFInd (plus REFIND.CONF, ICONS, and background.png) or the BSD loader, matching the current EFI/refind and EFI/ copies.
Fixes ghostbsd/issues#377
Summary by Sourcery
Restore population of the UEFI fallback boot path EFI/BOOT/BOOTX64.EFI for installed systems.
New Features:
Bug Fixes: