[PATCH REBASED] net: reset nb->data per dns record lookup loop

2015-11-24 Thread Josef Bacik
We were resetting nb->data every time we tried a new server, but we need to do
it every time we try for a different record, otherwise we don't end up falling
back to the A record properly.  Thanks,

Signed-off-by: Josef Bacik 
---
-This is a rebase onto this mornings master.

 grub-core/net/dns.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c
index b7e951a..82a3307 100644
--- a/grub-core/net/dns.c
+++ b/grub-core/net/dns.c
@@ -568,11 +568,10 @@ grub_net_dns_lookup (const char *name,
{
   grub_err_t err2;
 
-  nb->data = nbd;
-
   grub_size_t t = 0;
   do
 {
+  nb->data = nbd;
   if (servers[j].option == DNS_OPTION_IPV4 ||
  ((servers[j].option == DNS_OPTION_PREFER_IPV4) && (t++ == 0)) 
||
  ((servers[j].option == DNS_OPTION_PREFER_IPV6) && (t++ == 1)))
-- 
2.1.0


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH REBASED] net: reset nb->data per dns record lookup loop

2015-11-24 Thread Andrei Borzenkov
24.11.2015 20:41, Josef Bacik пишет:
> We were resetting nb->data every time we tried a new server, but we need to do
> it every time we try for a different record, otherwise we don't end up falling
> back to the A record properly.  Thanks,
> 

Applied. Thanks!

> Signed-off-by: Josef Bacik 
> ---
> -This is a rebase onto this mornings master.
> 
>  grub-core/net/dns.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c
> index b7e951a..82a3307 100644
> --- a/grub-core/net/dns.c
> +++ b/grub-core/net/dns.c
> @@ -568,11 +568,10 @@ grub_net_dns_lookup (const char *name,
>   {
>grub_err_t err2;
>  
> -  nb->data = nbd;
> -
>grub_size_t t = 0;
>do
>  {
> +  nb->data = nbd;
>if (servers[j].option == DNS_OPTION_IPV4 ||
>   ((servers[j].option == DNS_OPTION_PREFER_IPV4) && (t++ == 
> 0)) ||
>   ((servers[j].option == DNS_OPTION_PREFER_IPV6) && (t++ == 
> 1)))
> 


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: Grub get and set efi variables

2015-11-24 Thread Mat Troi
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 
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
>
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: Grub get and set efi variables

2015-11-24 Thread Seth Goldberg
That sounds like a firmware implementation bug, unfortunately.  I've seen it be 
hit or miss setting boot service only variables on some platforms.  

   --S

> On Nov 24, 2015, at 11:23 AM, Mat Troi  wrote:
> 
> 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  
>> 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
> 
> ___
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel