Commit Graph

14 Commits

Author SHA1 Message Date
Peter Jones
dd712378a7 shim: make everything use a common perror() call.
Signed-off-by: Peter Jones <pjones@redhat.com>
2018-03-12 16:21:43 -04:00
Peter Jones
9fdca5bbe1 Don't use uefi_call_wrapper(), ever.
I'm pretty done with typing uefi_call_wrapper() and counting arguments
every time.  Instead, just make the compiler error if we don't have
ms_abi.  Also, make it so nothing can use uefi_call_wrapper() directly.

Signed-off-by: Peter Jones <pjones@redhat.com>
2018-03-12 16:21:43 -04:00
Peter Jones
1c2376338d shim: Use EFI_ERROR() instead of comparing to EFI_SUCCESS everywhere.
Also consistently name our status variable "efi_status" unless there's a
good reason not to, such as already having another one of those.

Signed-off-by: Peter Jones <pjones@redhat.com>
2018-03-12 16:21:43 -04:00
Peter Jones
b953468e91 Don't have tons of local guid definitions for no reason at all.
Signed-off-by: Peter Jones <pjones@redhat.com>
2018-03-12 16:21:43 -04:00
Peter Jones
dc62a3c4dc Move includes around to clean the source tree up a bit.
Signed-off-by: Peter Jones <pjones@redhat.com>
2018-03-12 16:21:43 -04:00
Gary Lin
62d8397202 httpboot: include console.h
in_protocol is declared in console.h, so httpboot.c has to include the
header.

Signed-off-by: Gary Lin <glin@suse.com>
2018-02-28 14:47:15 -05:00
Gary Lin
736af67122 httpboot: fix the infinite loop
We should get out of the loop once the uri node is not the last node in
the device path.

Signed-off-by: Gary Lin <glin@suse.com>
2018-02-28 14:47:12 -05:00
Gary Lin
a752290c38 httpboot: Amend the device path matching rule
Originally, we check if the last 2 nodes in the device path are
IPv4()/Uri() or IPv6()/Uri() to determine whether httpboot is used or
not. However, since UEFI 2.7, the DNS node will be inserted between the
IP node and the URI node if the server provides the DNS server address.
This commit changes the matching rule to search IP node and URI node
and ignore any node between those two nodes.

Signed-off-by: Gary Lin <glin@suse.com>
2018-02-28 14:47:12 -05:00
Peter Jones
97a3f6cf94 "in_protocol" is used in more than shim.o; make it not static.
Signed-off-by: Peter Jones <pjones@redhat.com>
2017-12-19 16:52:01 -05:00
Lans Zhang
7d745e49c0 httpboot: fix OVMF crash
This is a typical typo. The free operation should be done if uri
was allocated.

Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
2017-07-17 13:13:00 -04:00
Peter Jones
d00ea5558e Fix some i386 type casting errors
Signed-off-by: Peter Jones <pjones@redhat.com>
2017-03-27 14:16:42 -04:00
Gary Lin
3ee08dde9c httpboot: parse https prefix in the uri
This commit adds the check for "https://" in the uri to support HTTPs
Boot.

Signed-off-by: Gary Lin <glin@suse.com>
2017-03-24 18:27:48 -04:00
Peter Jones
83c62ff582 Fix some type errors gcc7 finds in http boot code.
Signed-off-by: Peter Jones <pjones@redhat.com>
2017-02-27 15:45:54 -05:00
Gary Ching-Pang Lin
3d79bcb265 Add the optional HTTPBoot support
This commit adds the basic support for HTTPBoot, i.e. to fetch
the next stage loader with the HTTP protocol.

It requires gnu-efi >= 3.0.3 to support the URI device path and
Ip4Config2 or Ip6Config protocol support in the UEFI implementation.

To build shim.efi with HTTPBoot support:
make ENABLE_HTTPBOOT=1 shim.efi

Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
2016-09-06 14:49:52 -04:00