From: Robbie Harwood <rharwood@redhat.com>
To: development@efficientek.com
Cc: grub-devel@gnu.org, dkiper@net-space.pl, pmenzel@molgen.mpg.de,
javierm@redhat.com
Subject: Re: [PATCH v4 5/5] Don't display a uefi-firmware entry if it's not supported
Date: Mon, 22 Aug 2022 16:11:22 -0400 [thread overview]
Message-ID: <jlgczcsm42d.fsf@redhat.com> (raw)
In-Reply-To: <20220819172619.777e928e@crass-HP-ZBook-15-G2>
[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]
Glenn Washburn <development@efficientek.com> writes:
> On Thu, 18 Aug 2022 13:50:13 -0400
> Robbie Harwood <rharwood@redhat.com> wrote:
>
>> Add a new --is-supported option to commands/efi/efifwsetup and
>> conditionalize display on it.
>>
>> Signed-off-by: Robbie Harwood <rharwood@redhat.com>
>> ---
>> grub-core/commands/efi/efifwsetup.c | 3 +++
>> util/grub.d/30_uefi-firmware.in | 2 +-
>> 2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/grub-core/commands/efi/efifwsetup.c b/grub-core/commands/efi/efifwsetup.c
>> index cb4b6ff18c..53d23deea7 100644
>> --- a/grub-core/commands/efi/efifwsetup.c
>> +++ b/grub-core/commands/efi/efifwsetup.c
>> @@ -40,6 +40,9 @@ grub_cmd_fwsetup (grub_command_t cmd __attribute__ ((unused)),
>> grub_size_t oi_size;
>> static grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
>>
>> + if (argc >= 1 && grub_strcmp(args[0], "--is-supported") == 0)
>> + return !efifwsetup_is_supported ();
>> +
>> if (!efifwsetup_is_supported ())
>> return grub_error (GRUB_ERR_INVALID_COMMAND,
>> N_("reboot to firmware setup is not supported by the current firmware"));
>> diff --git a/util/grub.d/30_uefi-firmware.in b/util/grub.d/30_uefi-firmware.in
>> index b6041b55e2..78aef67d78 100644
>> --- a/util/grub.d/30_uefi-firmware.in
>> +++ b/util/grub.d/30_uefi-firmware.in
>> @@ -31,7 +31,7 @@ LABEL="UEFI Firmware Settings"
>> gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2
>>
>> cat << EOF
>> -if [ "\$grub_platform" = "efi" ]; then
>> +if [ "\$grub_platform" = "efi" ] && fwsetup --is-supported; then
>
> I don't believe that grub currently supported the && syntax. I just
> tested and I'm getting syntax errors.
>
> Untested, but I believe the following should work:
>
> fwsetup --is-supported
> if [ "\$grub_platform" = "efi" -a "\$?" = "0" ]; then
Good catch, thanks.
Be well,
--Robbie
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]
next prev parent reply other threads:[~2022-08-22 20:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-18 17:50 [PATCH v4 0/5] Improve logic to check for fwsetup support Robbie Harwood
2022-08-18 17:50 ` [PATCH v4 1/5] commands/efi/efifwsetup: Add missing grub_free()s Robbie Harwood
2022-08-18 17:50 ` [PATCH v4 2/5] Make all grub_efi_guid_t variables static Robbie Harwood
2022-08-18 17:50 ` [PATCH v4 3/5] templates: Check for EFI at runtime instead of config generation time Robbie Harwood
2022-08-18 17:50 ` [PATCH v4 4/5] efi: Print an error if boot to firmware setup is not supported Robbie Harwood
2022-08-18 17:50 ` [PATCH v4 5/5] Don't display a uefi-firmware entry if it's " Robbie Harwood
2022-08-19 22:26 ` Glenn Washburn
2022-08-19 22:55 ` Daniel Kiper
2022-08-22 20:11 ` Robbie Harwood [this message]
2022-08-19 13:49 ` [PATCH v4 0/5] Improve logic to check for fwsetup support Daniel Kiper
-- strict thread matches above, loose matches on Subject: below --
2022-08-19 20:54 [PATCH 0/2] grub.texi: Document fwsetup and fix typo Robbie Harwood
2022-08-19 20:54 ` [PATCH v4 5/5] Don't display a uefi-firmware entry if it's not supported Robbie Harwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jlgczcsm42d.fsf@redhat.com \
--to=rharwood@redhat.com \
--cc=development@efficientek.com \
--cc=dkiper@net-space.pl \
--cc=grub-devel@gnu.org \
--cc=javierm@redhat.com \
--cc=pmenzel@molgen.mpg.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.