diff --git a/build_library/grub.cfg b/build_library/grub.cfg index 0e3b2ce0f0..a2df9f8d29 100644 --- a/build_library/grub.cfg +++ b/build_library/grub.cfg @@ -30,6 +30,25 @@ if [ "$grub_platform" = "efi" ]; then fi fi +if [ "$net_default_server" != "" ]; then + smbios --type 1 --get-uuid 8 --set uuid + smbios --type 1 --get-string 7 --set serial + set mac=$net_default_mac + # Re-DHCP as grub to get the API endpoint + net_bootp $net_default_interface + # This is awful, but grub doesn't support a nice way to do this + for i in "$net_efinet0_dhcp_boot_file" "$net_efinet1_dhcp_boot_file" "$net_efinet2_dhcp_boot_file" "$net_efinet3_dhcp_boot_file" "$net_efinet4_dhcp_boot_file" "$net_efinet5_dhcp_boot_file" "$net_efinet6_dhcp_boot_file" "$net_efinet7_dhcp_boot_file" "$net_efinet8_dhcp_boot_file" "$net_efinet9_dhcp_boot_file"; do + if [ "$i" != "" ]; then + set endpoint="$i" + break + fi + done + if [ "$endpoint" != "" ]; then + set url="${endpoint}?uuid=$uuid&serial=$serial&mac=$mac" + configfile $url + fi +fi + # Search for the OEM partition, load additional configuration if found. if [ "$secure_boot" = "0" ]; then search --no-floppy --set oem --part-label OEM --hint "$root" diff --git a/build_library/grub_install.sh b/build_library/grub_install.sh index b84a35d6c0..4af866439d 100755 --- a/build_library/grub_install.sh +++ b/build_library/grub_install.sh @@ -43,7 +43,7 @@ case "${FLAGS_target}" in CORE_NAME="core.img" ;; x86_64-efi) - CORE_MODULES+=( serial linuxefi efi_gop getenv ) + CORE_MODULES+=( serial linuxefi efi_gop getenv smbios efinet http ) CORE_NAME="core.efi" ;; x86_64-xen)