feat(bls): boot unified kernel images (Type #2 entries) (#111)

* feat(bls): read PE sections without loading the whole image

* feat(bls): produce entries from unified kernel images

* feat(bls): boot unified kernel images as type 2 entries

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.

* fix(boot): rename boot counter files in place instead of copying them

* fix(bls): skip hidden files and keep unified kernel images when the type 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 commit is contained in:
alex authored and GitHub committed 2026-10-03 19:09:17 -07:00
1 parent 98e8c9ad44
commit f4221131f1
9 files changed
+948 -95

No files matched your search

+4 -2
View File
@@ -134,10 +134,12 @@ impl BootableEntry {
}
/// Determine if this entry matches `needle` by comparing to the id of the entry, which is
/// the name with or without the `.conf` suffix. This is how loader.conf selects entries.
/// the name with or without the `.conf` or `.efi` suffix. This is how loader.conf selects entries.
/// The `needle` is a glob pattern, where `*` matches any sequence of characters.
pub fn is_match_id(&self, needle: &str) -> bool {
glob_match(needle, &self.name) || glob_match(needle, &format!("{}.conf", self.name))
glob_match(needle, &self.name)
|| glob_match(needle, &format!("{}.conf", self.name))
|| glob_match(needle, &format!("{}.efi", self.name))
}
/// Create a variant of this entry, with the name suffixed by `suffix` and using `context`.