[PATCH] efi_loader: adjust config options for capsule updates

Jon Humphreys jhumphreysti at gmail.com
Tue Jun 18 20:16:40 CEST 2024


Ilias Apalodimas <ilias.apalodimas at linaro.org> writes:

> Hi Jon,
>
> On Tue, 18 Jun 2024 at 19:49, Jon Humphreys <jhumphreysti at gmail.com> wrote:
>>
>> Ilias Apalodimas <ilias.apalodimas at linaro.org> writes:
>>
>> > EFI_IGNORE_OSINDICATIONS is used to ignore OsIndications if setvariable
>> > at runtime is not supported and allow the platform to perform capsule
>> > updates on disk. With the recent changes boards can conditionally enable
>> > setvariable at runtime using EFI_RT_VOLATILE_STORE.
>> >
>> > So let's make the options depend on each other and clarify their
>> > functionality. When EFI_RT_VOLATILE_STORE, setvariable at runtime is
>> > supported and EFI_IGNORE_OSINDICATIONS, which also breaks the EFI spec, is
>> > not needed anymore.
>>
>> Hi Ilias,
>>
>> Is there a corresponding effort to update fwupdmgr to set OSIndications
>> (and set it correctly so the change persists a reboot)?
>>
>
> We are not trying to fix anything atm, we probably will in the future.
>
>> Otherwise, fwupdmgr provided capsules will now get ignored for boards that
>> enable setvariable at runtime.
>
> That goes beyond fwupd, EFI variable changes will be ignored in
> general unless you sync the file manually -- e.g. dd
> if=/sys/firmware/efi/efivars/VarToFile-b2ac5fc9-92b7-4acd-aeac-11e818c3130c
> of=/boot/efi/ubootefi.var skip=4 bs=1
> after every variable change. Unless you do that, enabling
> EFI_RT_VOLATILE_STORE makes little sense (and that's why it's not
> enabled by default).
> So, I prefer making EFI_IGNORE_OSINDICATIONS, which was a hack,
> mutually exclusive and start going in the right direction.
>

I agree with the principle.  My concern is that we want to encourage people
to move to setvariable at runtime, but until LVFS is updated, people who
care about LVFS will be deincentivized.

Jon

> Regards
> /Ilias
>>
>> Jon
>>
>> >
>> > Signed-off-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
>> > ---
>> >  lib/efi_loader/Kconfig | 2 ++
>> >  1 file changed, 2 insertions(+)
>> >
>> > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
>> > index 430bb7f0f7dc..c84064de1366 100644
>> > --- a/lib/efi_loader/Kconfig
>> > +++ b/lib/efi_loader/Kconfig
>> > @@ -220,6 +220,8 @@ config EFI_CAPSULE_ON_DISK
>> >  config EFI_IGNORE_OSINDICATIONS
>> >       bool "Ignore OsIndications for CapsuleUpdate on-disk"
>> >       depends on EFI_CAPSULE_ON_DISK
>> > +     depends on !EFI_RT_VOLATILE_STORE
>> > +     default y
>> >       help
>> >         There are boards where U-Boot does not support SetVariable at runtime.
>> >         Select this option if you want to use the capsule-on-disk feature
>> > --
>> > 2.45.2


More information about the U-Boot mailing list