]> TLD Linux GIT Repositories - packages/grub2.git/blob - efi-net-fix.patch
- updated for 2.02-beta3
[packages/grub2.git] / efi-net-fix.patch
1 diff -ur grub-2.02-beta3.orig/grub-core/net/drivers/efi/efinet.c grub-2.02-beta3/grub-core/net/drivers/efi/efinet.c
2 --- grub-2.02-beta3.orig/grub-core/net/drivers/efi/efinet.c     2016-02-28 02:07:41.000000000 +0000
3 +++ grub-2.02-beta3/grub-core/net/drivers/efi/efinet.c  2016-03-21 07:56:01.589768000 +0000
4 @@ -330,6 +330,7 @@
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 @@
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  }