-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a FuEfivars class that can be used to set up a test framework #7322
Conversation
Maybe a dumb question; but why not umockdev? Can't we just mock the directory with the variables instead of a whole backend? |
Not a dumb question at all; I'm reimplementing a bit of efibootmgr that means we can do A/B updates for bootloader components -- and I need something I can set up in half a dozen different configurations and then examine the steps -- doing things like simulating a reboot (clearing BootNext for example). |
As in fwupd does the A/B updates of bootloader components? Like part of something like Silverblue? Might want to hear more of the big picture here. I (of course naively) view GRUB as on the general chopping block a few years from now and UKI's taking over.
To me; this feels a safer to do with umockdev. You don't have to worry about implementation bugs that only show up in real environment. |
Yes, something like that. I think the idea is that we have something like
Yes, I think that's fair. nmbl is basically "we don't need a bootloader"
Let me show you the tests -- then maybe you might see how we're peeking into the EFI variables. The other thing having "an object" lets you have is caching; so we don't have to hit either efivarfs or the filesystem repeatedly -- e.g. we put a single hashtable in |
Something I want to caution in this design is the optimism in use of switching BootXXXX variables. Don't underestimate the assumptions that vendors have made in their BIOS for their boot manager to 'auto-add' entries for common paths. Think like how we have So I would think it's generally safer to keep a single boot entry and instead iterate on another variable or a flat file on the filesystem to decide what "shim" loads. But if you're envisioning swapping shim that's another story and this may be inevitable. Anyway; that's generally divergent, I get the big picture now.
👍
Yeah; I could see caching increases speed of tests by a magnitude. I guess you envision enough tests to justify the improvement? |
We actually tested that; we saw a few [old] systems doing horrible things when modifying the active boot entry.
Ohh interesting; can you share the root cause? i.e. that's exactly the kind of thing I want to write tests for.
I think there's a lot of broken hardware, and I think we'll need the ability to do various insane things to the variable. |
Heuristics associated with mucking with boot order. The fact that this BIOS team did it and it caused problems means it's probably done by others too. I think that a test case confirming that the expected entries are still in the same position in the boot order would catch it.
It's interesting to think of fwupd as critical path here for UKIs because these are traditionally "distribution" provided components. Do you think LVFS would be how UKIs get rolled out then? |
I don't think so, but I think the SBAT (and microsoft thing) will be in a future fwupd release ;) |
8218da4
to
e373fdd
Compare
dab3530
to
8a6086a
Compare
This allows us to create a FuDummyEfivars and then test various UEFI methods without reading and writing to the filesystem.
We need the same handling in three places, and we're about to add a fourth. This also allows us to add a `fwupdtool efivar-boot` debug command.
This also adds fu_context_get_esp_volume_by_hard_drive_device_path() for future use.
…he context This also adds `fwupdtool efivar-files` as a debug command.
This means it works on non-Linux, and gets rid of more binary blobs from git.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this once tests are pasing.
This allows us to create a FuDummyEfivars and then test various UEFI methods without reading and writing to the filesystem.
Type of pull request: