Skip to content

Improve ESP auto-mount detection across Fedora layouts - #8

Merged
GlitchSlayed merged 2 commits into
mainfrom
codex/add-checks-for-esp-mounting-locations
Mar 8, 2026
Merged

GlitchSlayed merged 2 commits into
mainfrom
codex/add-checks-for-esp-mounting-locations

Conversation

@GlitchSlayed

Copy link
Copy Markdown
Owner

Motivation

  • Automatic ESP detection/mounting was failing on some Fedora systems where the ESP is not mounted at /boot/efi or /efi, leading to a hard failure during setup.
  • The goal is to make ESP discovery more robust by checking additional common mount points and scanning mounted FAT/VFAT filesystems for an EFI directory.

Description

  • Add ESP_MOUNT_CANDIDATES containing /boot/efi, /efi, /boot, /boot/EFI, and /esp and iterate these when attempting fstab-based mounts.
  • Implement find_mounted_esp_target() which first checks the candidate mount points and then falls back to scanning findmnt for FAT/VFAT mounts that contain an EFI directory.
  • Replace direct /boot/efi//efi lookups in ensure_esp_mounted() and the generated uki-build.sh template with the new detection and candidate-iteration logic, and attempt mounting the detected ESP device across all candidates.
  • Improve error messages to list the checked locations and update README.md to document the expanded ESP handling.

Testing

  • Ran bash -n uki-setup.sh to verify there are no syntax errors; the check succeeded.
  • Ran the repository test script bash tests/test_uki_setup.sh, which verifies generation of the uki-build.sh helper and kernel-install plugin and it completed successfully.
  • End-to-end local checks in the test harness completed without failures.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d9bbb2bb85

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread uki-setup.sh Outdated
Comment on lines +90 to +92
for candidate in "${ESP_MOUNT_CANDIDATES[@]}"; do
target="$(findmnt -n -o TARGET "$candidate" 2>/dev/null || true)"
[[ -n "$target" ]] && { echo "$target"; return 0; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Validate candidate mount type before accepting it as ESP

The new find_mounted_esp_target() returns the first mounted candidate path without checking that it is actually an EFI System Partition. On systems with a separate ext4 /boot and an unmounted ESP (e.g. /boot/efi not mounted), this now returns /boot as the ESP, so ensure_esp_mounted exits early and later efibootmgr registration targets the /boot partition instead of the FAT ESP. That can produce unusable boot entries and place UKIs on a partition firmware cannot read.

Useful? React with 👍 / 👎.

@GlitchSlayed
GlitchSlayed merged commit be98aa0 into main Mar 8, 2026
0 of 2 checks passed
@GlitchSlayed
GlitchSlayed deleted the codex/add-checks-for-esp-mounting-locations branch March 19, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant