Bug 1660098 - UEFI HTTP boot does not work with port in URL
Summary: UEFI HTTP boot does not work with port in URL
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 31
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1619274 1619291
TreeView+ depends on / blocked
 
Reported: 2018-12-17 13:49 UTC by Lukas Zapletal
Modified: 2020-01-28 12:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-28 12:56:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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

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

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:18 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
  normal

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/

Comment 14 Ben Cotton 2019-08-13 17:08:03 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 15 Ben Cotton 2019-08-13 19:30:58 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 16 Lukas Zapletal 2020-01-28 12:56:14 UTC
Looks like the "unrecognized network address" error is just a warning, the OS is loaded after a small timeout.


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