Skip to content

Make shim boot path detection case-insensitive - #235

Open
Amodak9801 wants to merge 1 commit into
rhboot:mainfrom
Amodak9801:fix-223-shim-case-insensitive
Open

Amodak9801 wants to merge 1 commit into
rhboot:mainfrom
Amodak9801:fix-223-shim-case-insensitive

Conversation

@Amodak9801

Copy link
Copy Markdown

Summary

  • show_var_path() detected shim with sequential strstr() on /File(\EFI\, \shim, and .efi). Firmware often rewrites the loader to SHIMX64.EFI, so is_shim stayed false and optional data was not formatted as a second File(...).
  • Switch those searches to strcasestr (we already build with _GNU_SOURCE) so uppercase and mixed-case paths match. Lowercase shimx64.efi is unchanged.

Fixes #223

Test plan

  • On a UEFI machine or QEMU+OVMF, run efibootmgr -v against an entry whose path is SHIMX64.EFI (or create \EFI\<distro>\shimx64.efi and let firmware uppercase it). Optional data should display as File(...), not dotted UCS-2.
  • Confirm a lowercase shimx64.efi entry still formats the same as before.
  • Confirm a non-shim path such as grubx64.efi / GRUBX64.EFI is not treated as shim.

I could not run make in this environment (make and efivar devel packages are not installed). The change is the one-line strstr → strcasestr swap in show_var_path().

Made with Cursor

Firmware often stores SHIMX64.EFI, so strstr never sets is_shim and
optional loader data is formatted incorrectly.

Fixes rhboot#223

Signed-off-by: Amisha Modak <amodak@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Amodak9801
Amodak9801 marked this pull request as draft September 4, 2026 05:27
@Amodak9801
Amodak9801 marked this pull request as ready for review September 4, 2026 05:30
@Amodak9801

Copy link
Copy Markdown
Author

Gentle ping — this is ready for review when you have a moment.

One-line change: show_var_path() uses strcasestr so firmware-rewritten SHIMX64.EFI is treated as shim (Fixes #223). Happy to adjust the matcher or add UEFI/efibootmgr -v notes if that would help.

@Amodak9801

Copy link
Copy Markdown
Author

Gentle ping — still ready for review when you have a moment.

One-line change: show_var_path() uses strcasestr so firmware-rewritten SHIMX64.EFI is treated as shim (Fixes #223).

The ci.yml run on this PR expired after 30 days waiting for workflow approval from a maintainer (fork PR). Happy to rebase or adjust if needed.

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.

Detection of shim boot loader should be case insensitive

1 participant