Skip to content

uefivars: Add boot option parsing for MBR disks#3490

Merged
dxing97 merged 5 commits into
u-root:mainfrom
dxing97:mbr-support
Feb 9, 2026
Merged

uefivars: Add boot option parsing for MBR disks#3490
dxing97 merged 5 commits into
u-root:mainfrom
dxing97:mbr-support

Conversation

@dxing97
Copy link
Copy Markdown
Contributor

@dxing97 dxing97 commented Jan 26, 2026

This change adds FilterMBRSig to blockdev to find devices matching a given MBR signature. It also implements the UEFI boot option parsing for SigType 1, which uses the MBR signature and partition number to identify the boot device. Test cases are added for FilterMBRSig.

@dxing97 dxing97 force-pushed the mbr-support branch 3 times, most recently from bd7eab6 to 2729de3 Compare January 27, 2026 00:21
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 27, 2026

Codecov Report

❌ Patch coverage is 89.65517% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.75%. Comparing base (a13d027) to head (f965cb3).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3490      +/-   ##
==========================================
+ Coverage   61.72%   61.75%   +0.02%     
==========================================
  Files         646      646              
  Lines       43721    43746      +25     
==========================================
+ Hits        26987    27014      +27     
+ Misses      16734    16732       -2     
Flag Coverage Δ
.-amd64 90.90% <ø> (ø)
cmds/...-amd64 51.11% <ø> (-0.02%) ⬇️
integration/generic-tests/...-amd64 30.91% <ø> (ø)
integration/generic-tests/...-arm 33.00% <ø> (ø)
integration/generic-tests/...-arm64 30.06% <ø> (-0.08%) ⬇️
integration/gotests/...-amd64 61.72% <75.00%> (+<0.01%) ⬆️
integration/gotests/...-arm 62.20% <75.00%> (+0.01%) ⬆️
integration/gotests/...-arm64 62.32% <75.00%> (+<0.01%) ⬆️
pkg/...-amd64 60.43% <89.65%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
everything 67.07% <89.65%> (+0.02%) ⬆️
cmds/exp 34.12% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@10000TB 10000TB requested a review from a team January 27, 2026 03:42
@10000TB 10000TB self-assigned this Jan 27, 2026
@10000TB
Copy link
Copy Markdown
Member

10000TB commented Jan 27, 2026

Try fix DCO failure, git commit -s

@10000TB 10000TB added Awaiting reviewer Waiting for a reviewer. Awaiting author Waiting for new changes or feedback for author. and removed Awaiting reviewer Waiting for a reviewer. labels Jan 27, 2026
Comment thread pkg/mount/block/blockdev_linux.go Outdated
Comment thread pkg/mount/block/blockdev_linux.go Outdated
This change adds FilterMBRSig to blockdev to find devices
matching a given MBR signature. It also implements the UEFI
boot option parsing for SigType 1, which uses the MBR signature
and partition number to identify the boot device. Test cases
are added for FilterMBRSig, MBR device path nodes, and resolving MBR
disks.

Signed-off-by: Daniel Xing <danielxing97@gmail.com>
@dxing97
Copy link
Copy Markdown
Contributor Author

dxing97 commented Jan 28, 2026

added a test for resolving a MBR boot option

@dxing97 dxing97 added Awaiting reviewer Waiting for a reviewer. and removed Awaiting author Waiting for new changes or feedback for author. labels Jan 28, 2026
Copy link
Copy Markdown
Member

@rminnich rminnich left a comment

Choose a reason for hiding this comment

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

This is getting there. Thanks so much for this contribution. Let's get this one down, and it guide the next two.

Comment thread pkg/mount/block/blockdev_linux.go Outdated
Comment thread pkg/mount/block/blockdev_linux.go Outdated
Comment thread pkg/uefivars/boot/efiDevicePathProtocol_test.go Outdated
Signed-off-by: Daniel Xing <danielxing97@gmail.com>
Signed-off-by: Daniel Xing <danielxing97@gmail.com>
Copy link
Copy Markdown
Member

@rminnich rminnich left a comment

Choose a reason for hiding this comment

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

looks ok, I wonder why the CI failed. Let's try it again.

rminnich
rminnich previously approved these changes Feb 7, 2026
andrewsun2898
andrewsun2898 previously approved these changes Feb 9, 2026
Comment thread pkg/mount/block/blockdev_linux.go Outdated
Comment thread pkg/mount/block/blockdev_linux.go Outdated
Comment thread pkg/mount/block/blockdev_linux.go Outdated
@10000TB
Copy link
Copy Markdown
Member

10000TB commented Feb 9, 2026

( Looks like I never published my comments : / -- better than never -- just sharing, since this is already submitted)

Signed-off-by: Daniel Xing <danielxing97@gmail.com>
@dxing97 dxing97 dismissed stale reviews from andrewsun2898 and rminnich via f965cb3 February 9, 2026 20:30
@dxing97 dxing97 merged commit f57cdcb into u-root:main Feb 9, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Awaiting reviewer Waiting for a reviewer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants