Bug 1660098 - UEFI HTTP boot does not work with port in URL
Summary: UEFI HTTP boot does not work with port in URL
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 1619274 1619291
TreeView+ depends on / blocked
Reported: 2018-12-17 13:49 UTC by Lukas Zapletal
Modified: 2019-03-20 09:19 UTC (History)
4 users (show)

Clone Of:
Last Closed:

Attachments (Terms of Use)

Description Lukas Zapletal 2018-12-17 13:49:30 UTC

we are trying UEFI HTTP boot and it looks like grub2 from rawhide/f29 don't like explicit port in the URL. For example:

Errors on screen are: unrecognized network address

Comment 2 Stephen Benjamin 2018-12-17 18:04:11 UTC
I believe the two errors the customer was seeing are coming from different areas of the grub2 code base.  The unrecognised network address error is coming from a function that checks if it's an IPv6 IP since it needs to be formatted differently (e.g. http://[IPv6 IP]) than if it were IPv4.  Unfortunately that function always emits an error to the console when dealing with IPv4 addresses, which should probably be suppressed and IMHO is a valid bug.  

But EFI should handle the different port just fine (I think). The second error indicates it did make it to the code where we are sending an HTTP request, but the EFI system call returns an error code (there are two shown - 0x9 and 0x2).  9 is "EFI_OUT_OF_RESOURCES" and 2 is "EFI_INVALID_PARAMETER".  I'm not sure what those mean. Do we know the server is running new firmware? Also - is that a VM or hardware? If a VM, a tcpdump from the hypervisor would be really great.

Comment 3 Lukas Zapletal 2018-12-18 08:32:06 UTC
So we tried to move the EFI file to http server with port 80 and the IP error is gone, now we are looking at:

grub-core/net/http.c:234: Fail to send a request! status=0x12
grub-core/net/http.c:234: Fail to send a request! status=0x2

Looking into the codebase 0x12 seems to be GRUB_EFI_TIMEOUT and 0x2 is GRUB_EFI_INVALID_PARAMETER.

Comment 5 Lukas Zapletal 2018-12-18 13:54 UTC
Created attachment 1515347 [details]
pcap from the comm

Comment 8 Lukas Zapletal 2018-12-18 13:58:19 UTC
The customer tried to boot both grubx64.efi (embedded) and x86_64/core.efi created with only "http" module. New error appeared:

grub-core/kern/dl.c:257 ELF header smaller than expected

We have two pcap files with network dump. Attached.

Comment 11 Stephen Benjamin 2018-12-18 16:46:39 UTC
From what I see in the packet dump: grub2 gets downloaded but I don't see anything else.  So it's failing before it makes any more network requests, I think. 

But at least they have a grub2 recovery shell - can we see the environment variables? You can run 'set' in there.  It might be multiple pages - I'm mostly interested in seeing $root, $fw_path, and $http_path.

Comment 12 Stephen Benjamin 2018-12-18 17:50:49 UTC
Actually from grub2 rescue, could you do:

  set debug=all
  unset pager

Ideally, over a serial console to capture everything.

Comment 13 Lukas Zapletal 2018-12-19 09:35:39 UTC
Looks like the computer don't have physical serial connector: https://www.men.de/products/cpu-boards-1/f26l/

Note You need to log in before you can comment on or make changes to this bug.