As I understood, this recompiled binary bootx64.efi will only work on tftp server with an IPaddress mentioned in grub.cfg file. Is there a way to make it general? Why are we assigning a static Ip address through grub.cfg?
(2015-12-31 11:43)silver310 Wrote: SOLVED, finally.
So after 3 days I finally found a solution/workaround, I'll explain everything so other people might use this.
Basically it all comes down to GRUB2, I created a standalone bootx64.efi image with a single menu entry for the desired installation image, in this case RHEL 6.7
To make the standalone bootx64.efi:
install required packages
Code:
sudo yum install grub2-efi*
grub2 uses tftp to download images, while i use http with ipxe, so I had to create a new folder structure in my tftp root folder (until now it only had ipxe for legacy and efi)
Code:
cd /tftpboot
mkdir -p grub2-efi/rhel67server/boot/grub/
cd grub2-efi/rhel67server
now the config file:
Code:
vim boot/grub/grub.cfg
set timeout=0
menuentry 'RHEL 6.7 Server' --class os {
insmod net
insmod efinet
insmod tftp
insmod gzio
insmod part_gpt
insmod efi_gop
insmod efi_uga
# tftp server
set net_default_server=192.168.0.1
# dhcp did not work, no idea why
# net_bootp
# assign a static IP
net_add_addr eno0 efinet0 192.168.0.100
echo 'Loading vmlinuz ...'
linux (tftp)/grub2-efi/rhel67server/vmlinuz repo="http://192.168.0.1/images/iso_images/RHEL_6.7_server" root=/dev/null
echo 'Loading initial ramdisk ...'
initrd (tftp)/grub2-efi/rhel67server/initrd.img
}
without "root=/dev/null" the installation couldn't find any hard-drives (no idea why)
now, while in /tftpboot/grub2-efi/rhel67server/ run the following command:
Code:
grub2-mkstandalone -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi --fonts="unicode" -o bootx64.efi boot/grub/grub.cfg
you'll see a new file "bootx64.efi", copy to the same directory the kernel and initrd files of the wanted installation.
Finally in ipxe I just chain to the newly created file:
Code:
:rhel67-efi
echo Starting RHEL 6.7 Server x64 (EFI)
chain ${tftp-server}/grub2-efi/rhel67server/bootx64.efi || goto rhel67-efi
And that's it, work perfectly fine, hope this helps someone else, I'm going to add some older versions of RHEL and hopefully it'll work for them as well.
Only issue is that grub uses tftp and it's a lot slower, loading the same files (vmlinuz, initrd.img) via http takes less then a second, while via tftp it can take up to 15-20 seconds, is it possible from grub to use http instead of tftp?