mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 06:31:18 +02:00
Add UEFI netboot support
If grub's been netbooted, pull the uuid and serial number out of smbios and hit the API server to get the appropriate configuration.
This commit is contained in:
parent
db5d937aab
commit
1f7c749b2d
@ -30,6 +30,25 @@ if [ "$grub_platform" = "efi" ]; then
|
|||||||
fi
|
fi
|
||||||
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.
|
# Search for the OEM partition, load additional configuration if found.
|
||||||
if [ "$secure_boot" = "0" ]; then
|
if [ "$secure_boot" = "0" ]; then
|
||||||
search --no-floppy --set oem --part-label OEM --hint "$root"
|
search --no-floppy --set oem --part-label OEM --hint "$root"
|
||||||
|
@ -43,7 +43,7 @@ case "${FLAGS_target}" in
|
|||||||
CORE_NAME="core.img"
|
CORE_NAME="core.img"
|
||||||
;;
|
;;
|
||||||
x86_64-efi)
|
x86_64-efi)
|
||||||
CORE_MODULES+=( serial linuxefi efi_gop getenv )
|
CORE_MODULES+=( serial linuxefi efi_gop getenv smbios efinet http )
|
||||||
CORE_NAME="core.efi"
|
CORE_NAME="core.efi"
|
||||||
;;
|
;;
|
||||||
x86_64-xen)
|
x86_64-xen)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user