Created
January 18, 2018 15:38
-
-
Save kvaps/4a61233e4427740c636a0cbd885e54cd to your computer and use it in GitHub Desktop.
Grub config for EFI and PXE boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set timeout=3 | |
menuentry 'Linux diskless' --class os { | |
insmod efi_gop | |
insmod efi_uga | |
# set server from option 66 (tftp-server-name) if not exist, use next_server | |
if ! net_get_dhcp_option net_default_server ${net_default_interface} 66 string; then | |
echo ' using next_server option instead.' | |
set net_default_server=${pxe_default_server} | |
fi | |
echo '------------------------------------------------------------------------------' | |
echo -n 'Interface: '; net_ls_addr | |
echo "HTTP Server: ${net_default_server}" | |
echo '------------------------------------------------------------------------------' | |
echo | |
echo ' mm' | |
echo ' /^( )^\' | |
echo ' \,(..),/' | |
echo ' V~~V' | |
echo | |
echo "Loading Linux from http://${net_default_server}/vmlinz ..." | |
linux (http)/vmlinuz console=tty1 console=ttyS0,9600n8 selinux=0 bond=bond0:eno1,eno1d1:mode=active-backup root=live:http://${net_default_server}/cc.squash rootovl=1 ro rd.live.image | |
echo "Loading initial ramdisk from http://${net_default_server}/initramfs ..." | |
initrd (http)/initramfs | |
} |
@ovidiucp, here is the final version used in production for 2 and more years:
https://github.com/kvaps/ltsp/blob/grub/ltsp/server/grub/grub.cfg
If you using Ubuntu, you might be also interesting in LTSP project, I'm using it to organize network bootable servers farm for the Kubernetes https://github.com/kvaps/kubefarm
Wow, thnks
Wow, thanks for documenting this! When booting UEFI PXE, TFTP times out when downloading the latest initrd file for Ubuntu 20.04 so HTTP is the only way to go. A google search reveals surprisingly little information on how to fix the problem. This gist helped me figure out how to go around the TFTP limitation.
chmod +r /yourpxe-bootpath/yourpxe-initrd.img
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wow, thanks for documenting this! When booting UEFI PXE, TFTP times out when downloading the latest initrd file for Ubuntu 20.04 so HTTP is the only way to go. A google search reveals surprisingly little information on how to fix the problem. This gist helped me figure out how to go around the TFTP limitation.