All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mat Troi <mattroisang@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: Grub get and set efi variables
Date: Tue, 24 Nov 2015 11:23:33 -0800	[thread overview]
Message-ID: <CAA0a8nVMzL8MU9bKOs1GBvJ2d4SDf0gA30rQRrfn_ntdK1Rxbw@mail.gmail.com> (raw)
In-Reply-To: <5646B275.5040707@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2150 bytes --]

For a specific project implementation, I need to be able to write and read
one EFI variable during boot only.  So I have written a grub command to do
just that.  But the issue is with setting these attributes to the variable
(GRUB_EFI_VARIABLE_NON_VOLATILE, GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS), I
am not able to modify it during boot on some platform.  Since this is so
specific, I am wondering if anyone has seen similar issue?

On Fri, Nov 13, 2015 at 8:03 PM, Andrei Borzenkov <arvidjaar@gmail.com>
wrote:

> 13.11.2015 22:42, Ignat Korchagin пишет:
>
>> +static enum efi_var_type
>>>>> +parse_efi_var_type (const char *type)
>>>>> +{
>>>>> +  if (!grub_strncmp (type, "string", sizeof("string")))
>>>>> +    return EFI_VAR_STRING;
>>>>> +
>>>>>
>>>>
>>>>
>>>> I think this should be "ascii" or "utf8". "string" is too ambiguous in
>>>> UEFI
>>>> environment, it can also mean sequence of UCS-2 characters.
>>>>
>>> I'm still not sure how exactly GRUB + UEFI interprets "raw buffers"
>>> when printing. Maybe, to avoid confusion, it might be better to
>>> completely remove this option. Basically, you do not want to interpret
>>> raw buffers as strings. For best compatibility "hex" mode should be
>>> promoted, I guess. What do you think?
>>>
>> Checked again the UEFI spec. For globally defined variables which are
>> strings they specify ASCII. So if we leave this option, ascii is the
>> best name.
>>
>>
> What about
>
>   - ascii - print ASCII characters verbatim, escape non-ASCII in usual way
> (similar to "od -c")
>
>   - raw - simply put raw variable without any interpretation.
>
> This is better aligned with argument describing output formatting rather
> than attempting to "type" variable.
>
> Alternative (or in addition to) ascii - dump which prints usual pretty hex
> dump of content (hexdump -C). This is handy to interactively look at
> variable content.
>
> Or, and change name from --type to --format :)
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>

[-- Attachment #2: Type: text/html, Size: 3226 bytes --]

  parent reply	other threads:[~2015-11-24 19:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 19:39 Grub get and set efi variables Mat Troi
2015-11-03 20:12 ` SevenBits
2015-11-03 23:05   ` Mat Troi
2015-11-04  5:38     ` Andrei Borzenkov
2015-11-05 18:25       ` SevenBits
2015-11-06  2:00         ` Ignat Korchagin
2015-11-11 18:09           ` Andrei Borzenkov
2015-11-13 19:34             ` Ignat Korchagin
2015-11-13 19:42               ` Ignat Korchagin
2015-11-14  4:03                 ` Andrei Borzenkov
2015-11-17 11:48                   ` Ignat Korchagin
2015-11-29  8:57                     ` Andrei Borzenkov
2015-11-24 19:23                   ` Mat Troi [this message]
2015-11-24 20:48                     ` Seth Goldberg
2015-11-27 14:07                   ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-11-27 14:25                     ` Ignat Korchagin
2015-11-29  9:00                       ` Andrei Borzenkov
2015-12-02 12:53                         ` Ignat Korchagin
2015-12-02 13:00                           ` Andrei Borzenkov
2015-12-02 13:05                             ` Vladimir 'phcoder' Serbinenko
2015-12-02 14:52                               ` Ignat Korchagin
2015-12-03 16:43                                 ` Andrei Borzenkov
2015-12-03 17:19                                   ` Ignat Korchagin
2015-12-09 14:42                                     ` Ignat Korchagin
2015-12-12  8:36                                     ` Andrei Borzenkov
2015-12-14 11:08                                       ` Ignat Korchagin
2015-12-14 11:17                                         ` Ignat Korchagin
2016-01-29 16:25                                           ` Ignat Korchagin

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=CAA0a8nVMzL8MU9bKOs1GBvJ2d4SDf0gA30rQRrfn_ntdK1Rxbw@mail.gmail.com \
    --to=mattroisang@gmail.com \
    --cc=grub-devel@gnu.org \
    /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.