Repository navigation
Use the ESP we booted from via LoaderDevicePartUUID - #2555
Open
Johan-Liebert1 wants to merge 4 commits into
Open
Johan-Liebert1 wants to merge 4 commits into
Johan-Liebert1 wants to merge 4 commits into
Conversation
read_uefi_var() decoded the entire contents of the efivarfs file as UTF-16LE. efivarfs prepends a 4-byte little-endian u32 of the variable's attributes, and EFI string variables are NUL-terminated. As a result the returned string was wrapped in invisible characters and incorrect string matches with UTF-8 encoded Strings Skip the 4-byte attribute header before decoding and trim trailing NUL and surrounding whitespace from the result. Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Member
Author
|
I've tested this locally and it works fine. Unfortunately, adding integration tests for this is going to be a little bit hacky |
On dual-booted systems, walking up to the root disk(s) and picking the first colocated ESP can return the wrong one, since there may be multiple ESPs. Instead, read the LoaderDevicePartUUID EFI variable set by the boot loader and match it against the partuuid of the candidate partitions, so we operate on the ESP we actually booted from. The install paths still use find_first_colocated_esp(), since at that point we are not booted into a bootc system and the EFI variable does not describe the target system. Fixes: bootc-dev#2554 Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Older versions of Grub, the one in c10s and c9s, don't fully implement the BLS spec, which means we don't get the efivar LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f. In such a case, go through all the ESPs and try to find bootc owned BLS config file in `ESP/loader/entries` Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Johan-Liebert1
force-pushed
the
multi-esp-fix
branch
from
October 8, 2026 09:28
136964b to
18dd8c6
Compare
Collaborator
I think we can change our bcvk wrapper tooling to support provisioning block devices to the VM (bcvk supports it), then it's just a matter of adding varoius different ESP partitions, spread across various disks or so. |
cgwalters
requested changes
Oct 8, 2026
AssistedBy: LLM Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Johan-Liebert1
force-pushed
the
multi-esp-fix
branch
from
October 9, 2026 07:13
bc7e87e to
a57ab34
Compare
cgwalters
approved these changes
Oct 9, 2026
This branch has not been deployed
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.
utils: Strip efivarfs attribute header and NUL when reading EFI vars
read_uefi_var() decoded the entire contents of the efivarfs file as
UTF-16LE.
efivarfs prepends a 4-byte little-endian u32 of the variable's attributes,
and EFI string variables are NUL-terminated.
As a result the returned string was wrapped in invisible characters and
incorrect string matches with UTF-8 encoded Strings
Skip the 4-byte attribute header before decoding and trim trailing
NUL and surrounding whitespace from the result.
store: Select the booted ESP via LoaderDevicePartUUID
On dual-booted systems, walking up to the root disk(s) and picking the
first colocated ESP can return the wrong one, since there may be
multiple ESPs.
Instead, read the LoaderDevicePartUUID EFI variable set
by the boot loader and match it against the partuuid of the candidate
partitions, so we operate on the ESP we actually booted from.
The install paths still use find_first_colocated_esp(), since at that
point we are not booted into a bootc system and the EFI variable does
not describe the target system.
Fixes: #2554
esp: Handle non-BLS bootloaders
Older versions of Grub, the one in c10s and c9s, don't fully implement
the BLS spec, which means we don't get the efivar
LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f.
In such a case, go through all the ESPs and try to find bootc owned BLS
config file in
ESP/loader/entries