[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 0/4] Improve logic to check for fwsetup support

From: Robbie Harwood
Subject: [PATCH v2 0/4] Improve logic to check for fwsetup support
Date: Wed, 17 Aug 2022 15:50:30 -0400

Javier's original message for this series:

> The fwsetup command can be used for rebooting to the firmware setup UI but
> this can only be used on machines that have support for this feature.
> Curently, this is achieved by checking in the 30_uefi-firmware template if
> OsIndicationsSupported is present and has EFI_OS_INDICATIONS_BOOT_TO_FW_UI
> set. This is again checked in the efifwsetup module init function and the
> fwsetup command is only registered if that condition is meet.
> But this logic has a comple of problems, since it assumes that the config
> file is always generated in the same machine than the one that's booted.
> If that's not the case, any of the following situations could happen:
> * A config file generated on a non-EFI machine, will not have the fwsetup
>   menu entry even when booting with EFI.
> * A config file generated on an EFI machine, will have a fwsetup even when
>   is not booted with EFI.
> * A config file generated on an EFI machine that supports rebooting to the
>   firmware setup, will have the fwsetup even if booting on an EFI machine
>   that does not support that feature.
> To prevent these, let's change when the check is done. Instead of doing it
> at config generation time, do it at runtime with grub_platform == "efi" and
> when the command is executed. That way, the 30_uefi-firmware template won't
> make any assumption about the firmware support of the machine that's booted.

In this version, I've made changes to address dkiper's and pmenzel's feedback.
This includes the addition of two new commits.  I have also modified the error
printing commit to hopefully produce a diff that's easier to read.

Be well,

Javier Martinez Canillas (2):
  templates: Check for EFI at runtime instead of config generation time
  efi: Print an error if boot to firmware setup is not supported

Robbie Harwood (2):
  commands/efi/efifwsetup: Add missing grub_free()s
  Make all grub_efi_guid_t variables static

 grub-core/commands/efi/efifwsetup.c  | 27 ++++++++++++++++++---------
 grub-core/efiemu/i386/pc/cfgtables.c |  6 +++---
 grub-core/kern/efi/fdt.c             |  2 +-
 grub-core/loader/efi/fdt.c           |  2 +-
 grub-core/term/efi/console.c         |  2 +-
 util/grub.d/      | 21 ++++++++-------------
 6 files changed, 32 insertions(+), 28 deletions(-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]