feat(bls): boot unified kernel images (Type #2 entries) - #111
Merged
Merged
Conversation
Scan the EFI/Linux directory, or the new uki-path option of the BLS generator, for .efi files and turn each one into an entry using the metadata in its PE sections. Autoconfigure now also detects a disk that only has unified kernel images. An image with the id of a type 1 entry is skipped, and boot counting works on the .efi file name.
…ype 1 scan fails Check file name suffixes without slicing by byte offset, drop the PE section bytes once an image has been parsed, and only fail the generator on a type 1 error when unified kernel images are disabled.
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.
Adds BLS Type #2 support. The BLS generator now scans
\EFI\Linux(or the newuki-pathoption, where an empty value turns it off) for.efifiles and makes an entry from each unified kernel image, using the title and version from its.osrelsection. Only the PE headers and the.osrel,.cmdlineand.unamesections are read, so large images are never loaded. Images without.osrel, or built for another architecture, are skipped, and a unified kernel image with the same id as a Type #1 entry is ignored. Autoconfigure also detects a disk that only has unified kernel images.Boot counting works on
.efifile names too. The counter rename is now done in place instead of copying the file, which matters for 100 MB images and also makes the.confrename atomic.Scanning is on by default, so existing BLS setups will list any images in
\EFI\Linux. Two generators that read the same directory would list every image twice, so only one should scan it. Whenuki-pathisn't set it follows the device ofpath. I tested with QEMU/OVMF using synthetic images, not real signed unified kernel images, and not on aarch64 at runtime or with Secure Boot.