[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Grub get and set efi variables
From: |
Vladimir 'φ-coder/phcoder' Serbinenko |
Subject: |
Re: Grub get and set efi variables |
Date: |
Fri, 27 Nov 2015 15:07:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.3.0 |
On 14.11.2015 05:03, Andrei Borzenkov 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.
>
I would add:
* hex. To print and store in hex form
* utf16. Decode utf16 into utf8. utf16 is a common encoding in EFI land.
I would also skip on raw, at least until we have a real need for it as
we currently are not equiped to handle raw strings in variable contents,
including but not limited to \0 being considered a terminator
> 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
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
signature.asc
Description: OpenPGP digital signature
- Re: Grub get and set efi variables, (continued)
- Re: Grub get and set efi variables, SevenBits, 2015/11/05
- Re: Grub get and set efi variables, Ignat Korchagin, 2015/11/05
- Re: Grub get and set efi variables, Andrei Borzenkov, 2015/11/11
- Re: Grub get and set efi variables, Ignat Korchagin, 2015/11/13
- Re: Grub get and set efi variables, Ignat Korchagin, 2015/11/13
- Re: Grub get and set efi variables, Andrei Borzenkov, 2015/11/13
- Re: Grub get and set efi variables, Ignat Korchagin, 2015/11/17
- Re: Grub get and set efi variables, Andrei Borzenkov, 2015/11/29
- Re: Grub get and set efi variables, Mat Troi, 2015/11/24
- Re: Grub get and set efi variables, Seth Goldberg, 2015/11/24
- Re: Grub get and set efi variables,
Vladimir 'φ-coder/phcoder' Serbinenko <=
- Re: Grub get and set efi variables, Ignat Korchagin, 2015/11/27
- Re: Grub get and set efi variables, Andrei Borzenkov, 2015/11/29