Skip to main content
edited body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18
"GET /liveos/focal/kernel HTTP/1.1" 200 11780639 "-" "GRUB 2.06-2ubuntu14.1" "GET /liveos/focal/initrd HTTP/1.1" 200 6169720489168508 "-" "GRUB 2.06-2ubuntu14.1" "GET /liveos/focal/squashfs HTTP/1.1" 200 218095923388669747 "-" "Wget" 

So GRUB use the http agent "UefiHttpBoot/1.0" to load kernel and initrd. Unfortunately the access log shows that server did not respond full size of data to the UEFI HTTP boot client. Full size response should be like 6169720489168508, but now are just 449680.

"GET /liveos/focal/kernel HTTP/1.1" 200 11780639 "-" "GRUB 2.06-2ubuntu14.1" "GET /liveos/focal/initrd HTTP/1.1" 200 61697204 "-" "GRUB 2.06-2ubuntu14.1" "GET /liveos/focal/squashfs HTTP/1.1" 200 218095923 "-" "Wget" 

So GRUB use the http agent "UefiHttpBoot/1.0" to load kernel and initrd. Unfortunately the access log shows that server did not respond full size of data to the UEFI HTTP boot client. Full size response should be like 61697204, but now are just 449680.

"GET /liveos/focal/kernel HTTP/1.1" 200 11780639 "-" "GRUB 2.06-2ubuntu14.1" "GET /liveos/focal/initrd HTTP/1.1" 200 89168508 "-" "GRUB 2.06-2ubuntu14.1" "GET /liveos/focal/squashfs HTTP/1.1" 200 388669747 "-" "Wget" 

So GRUB use the http agent "UefiHttpBoot/1.0" to load kernel and initrd. Unfortunately the access log shows that server did not respond full size of data to the UEFI HTTP boot client. Full size response should be like 89168508, but now are just 449680.

added 4 characters in body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18

Found the http agent string in GRUB2's debian patched source: http://archive.ubuntu.com/ubuntu/pool/main/g/grub2-unsigned/grub2-unsigned_2.06-2ubuntu14.1.debian.tar.xz, it was a patch file suse-add-support-for-UEFI-network-protocols.patch, which replaced some http related functions to use efi firmware functions.

+static grub_err_t +efihttp_request (grub_efi_http_t *http, char *server, char *name, int use_https, int headeronly, grub_off_t *file_size) +{ + grub_efi_http_request_data_t request_data; + grub_efi_http_message_t request_message; + grub_efi_http_token_t request_token; + grub_efi_http_response_data_t response_data; + grub_efi_http_message_t response_message; + grub_efi_http_token_t response_token; + grub_efi_http_header_t request_headers[3]; + + grub_efi_status_t status; + grub_efi_boot_services_t *b = grub_efi_system_table->boot_services; + char *url = NULL; + + request_headers[0].field_name = (grub_efi_char8_t *)"Host"; + request_headers[0].field_value = (grub_efi_char8_t *)server; + request_headers[1].field_name = (grub_efi_char8_t *)"Accept"; + request_headers[1].field_value = (grub_efi_char8_t *)"*/*"; + request_headers[2].field_name = (grub_efi_char8_t *)"User-Agent"; + request_headers[2].field_value = (grub_efi_char8_t *)"UefiHttpBoot/1.0"; + ... + /* request token */ + request_token.event = NULL; + request_token.status = GRUB_EFI_NOT_READY; + request_token.message = &request_message; + + request_callback_done = 0; + status = efi_call_5 (b->create_event, + GRUB_EFI_EVT_NOTIFY_SIGNAL, + GRUB_EFI_TPL_CALLBACK, + grub_efi_http_request_callback, + NULL, + &request_token.event); + + ... 
  • it seems does support url querystring well.
  • it does not handle large data well. I will report this to GRUB2 developers. Turns out that the TCP windows size is too small, causedthere are a lot of TCP retransmission and windows size adjustment.

Found the http agent string in GRUB2's debian patched source: http://archive.ubuntu.com/ubuntu/pool/main/g/grub2-unsigned/grub2-unsigned_2.06-2ubuntu14.1.debian.tar.xz

  • it seems does support url querystring well.
  • it does not handle large data well. I will report this to GRUB2 developers. Turns out that the TCP windows size is too small, caused a lot of retransmission.

Found the http agent string in GRUB2's debian patched source: http://archive.ubuntu.com/ubuntu/pool/main/g/grub2-unsigned/grub2-unsigned_2.06-2ubuntu14.1.debian.tar.xz, it was a patch file suse-add-support-for-UEFI-network-protocols.patch, which replaced some http related functions to use efi firmware functions.

+static grub_err_t +efihttp_request (grub_efi_http_t *http, char *server, char *name, int use_https, int headeronly, grub_off_t *file_size) +{ + grub_efi_http_request_data_t request_data; + grub_efi_http_message_t request_message; + grub_efi_http_token_t request_token; + grub_efi_http_response_data_t response_data; + grub_efi_http_message_t response_message; + grub_efi_http_token_t response_token; + grub_efi_http_header_t request_headers[3]; + + grub_efi_status_t status; + grub_efi_boot_services_t *b = grub_efi_system_table->boot_services; + char *url = NULL; + + request_headers[0].field_name = (grub_efi_char8_t *)"Host"; + request_headers[0].field_value = (grub_efi_char8_t *)server; + request_headers[1].field_name = (grub_efi_char8_t *)"Accept"; + request_headers[1].field_value = (grub_efi_char8_t *)"*/*"; + request_headers[2].field_name = (grub_efi_char8_t *)"User-Agent"; + request_headers[2].field_value = (grub_efi_char8_t *)"UefiHttpBoot/1.0"; + ... + /* request token */ + request_token.event = NULL; + request_token.status = GRUB_EFI_NOT_READY; + request_token.message = &request_message; + + request_callback_done = 0; + status = efi_call_5 (b->create_event, + GRUB_EFI_EVT_NOTIFY_SIGNAL, + GRUB_EFI_TPL_CALLBACK, + grub_efi_http_request_callback, + NULL, + &request_token.event); + + ... 
  • it seems does support url querystring well.
  • it does not handle large data well. I will report this to GRUB2 developers. Turns out that the there are a lot of TCP retransmission and windows size adjustment.
added 18 characters in body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18

I was using GRUB for UEFI PXE boot or UEFI HTTP boot of a Linux Live OS (made by Ubuntu Focal or Bionic or Jammy). I used the same grub.cfg for both methods. It worked well under UEFI PXE boot, but failed during UEFI HTTP boot.

I was using GRUB for UEFI PXE boot or UEFI HTTP boot of a Linux Live OS (made by Ubuntu Bionic). I used the same grub.cfg for both methods. It worked well under UEFI PXE boot, but failed during UEFI HTTP boot.

I was using GRUB for UEFI PXE boot or UEFI HTTP boot of a Linux Live OS (made by Ubuntu Focal or Bionic or Jammy). I used the same grub.cfg for both methods. It worked well under UEFI PXE boot, but failed during UEFI HTTP boot.

create code block and Corrected a sentence
Source Link
Loading
added 99 characters in body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18
Loading
added 313 characters in body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18
Loading
added 171 characters in body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18
Loading
added 1321 characters in body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18
Loading
added 264 characters in body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18
Loading
added 264 characters in body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18
Loading
added 491 characters in body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18
Loading
deleted 1 character in body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18
Loading
added 358 characters in body
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18
Loading
Source Link
osexp2000
  • 632
  • 1
  • 5
  • 18
Loading