]> TLD Linux GIT Repositories - packages/grub2.git/blob - efi-net-fix.patch
- updated to 2.02-rc1
[packages/grub2.git] / efi-net-fix.patch
1 diff -urNp grub-2.02-rc1.orig/grub-core/net/drivers/efi/efinet.c grub-2.02-rc1/grub-core/net/drivers/efi/efinet.c
2 --- grub-2.02-rc1.orig/grub-core/net/drivers/efi/efinet.c       2017-02-08 15:08:35.748315754 +0000
3 +++ grub-2.02-rc1/grub-core/net/drivers/efi/efinet.c    2017-02-08 15:08:53.837315551 +0000
4 @@ -330,6 +330,7 @@ grub_efi_net_config_real (grub_efi_handl
5  {
6    struct grub_net_card *card;
7    grub_efi_device_path_t *dp;
8 +  grub_efi_simple_network_t *net;
9  
10    dp = grub_efi_get_device_path (hnd);
11    if (! dp)
12 @@ -383,6 +384,21 @@ grub_efi_net_config_real (grub_efi_handl
13                                     &pxe_mode->dhcp_ack,
14                                     sizeof (pxe_mode->dhcp_ack),
15                                     1, device, path);
16 +    net = grub_efi_open_protocol (card->efi_handle, &net_io_guid,
17 +                                 GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE);
18 +    if (net) {
19 +      if (net->mode->state == GRUB_EFI_NETWORK_STOPPED
20 +         && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS)
21 +       continue;
22 +
23 +      if (net->mode->state == GRUB_EFI_NETWORK_STOPPED)
24 +       continue;
25 +
26 +      if (net->mode->state == GRUB_EFI_NETWORK_STARTED
27 +         && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS)
28 +       continue;
29 +      card->efi_net = net;
30 +    }
31      return;
32    }
33  }