I am attempting to use iPXE to load the installers for various Linux Distributions onto UEFI enabled servers. The server's are able to boot correctly in BIOS mode, but fail when UEFI is enabled. When they fail, it is immediately after successfully downloading both the kernel and initrd. Nothing is printed after the ok message for the ftp download of the initrd and it hangs forever. This happens whether attempting to boot the installer for Ubuntu 16.04, Fedora 24, or CentOS 7.2.
This same setup works correctly when attempting to booth these same installers using the UEFI mode in a KVM/Qemu virtual machine.
Also, experiments with using PXE Grub on real hardware to boot the same kernels have been successful, but it relies on TFTP which is much slower.
Here's my script for installing Ubuntu 16.04:
#!ipxe
kernel ftp://server/pxeboot/ubuntu-installer/amd64/linux initrd=initramfs
initrd --name initramfs ftp://server/pxeboot/ubuntu-installer/amd64/initrd.gz
boot
Add a echo something before boot so you know the initrd download succeeds, or an imgstat might be interesting.
Something that I can think of is if secure boot is enabled (a few implementations I have used of efi allowed ipxe to boot, but not to boot anything from within ipxe)
Building with make DEBUG=efi_image should give you some more output on what it does directly before executing your efi kernel.
I've discovered that a simple sleep 1 before the boot line is all it takes for most installers to boot correctly. Remove any sleep statement and it hangs as it did previously just when executing boot. If there is an imgstat or echo, it does print, but still hangs after if there's no sleep.
There's still an odd issue where CentOS fails to find the mount the initrd rootfs and panics when booting on hardware, yet works in a UEFI-enabled virtual machine. However, Ubuntu and Fedora fully load into the installer with the above fix.
Here's the output with imgstat and EFI debug enabled for Fedora:
tftp://10.1.1.1/ipxe/linux/fc24.bios... ok
EFIIMAGE 0xcc054688 could not load: Error 0x7f048183 (
http://ipxe.org/7f048183)
http://ftp.10.1.1.1/fedora/isolinux/vmlinuz... ok
http://ftp.10.1.1.1/fedora/isolinux/initrd.img... ok
EFIIMAGE 0xcc054988 could not load: Error 0x7f048183 (
http://ipxe.org/7f048183)
vmlinuz : 6277656 bytes [EFI] [SELECTED] "initrd=initramfs"
initramfs : 48206188 bytes
Sleeping...
And here's the script I used to boot it:
#!ipxe
kernel
http://ftp.10.1.1.1/fedora/isolinux/vmlinuz initrd=initramfs
initrd --name initramfs
http://ftp.10.1.1.1/fedora/isolinux/initrd.img
imgstat
echo Sleeping...
sleep 60
echo Boot
boot
The issue with kernel not finding intird might be the pre 3.16 kernel bug see
this post
For the other issue, which ipxe binary are you using, and are you using the latest git master?
In the case of CentOS 7.x if you download the initrd FIRST then the kernel, things generally work a little better because of memory mapping.
Code:
initrd --name initramfs ftp://10.1.1.1/fedora/isolinux/initrd.img
kernel ftp://10.1.1.1/fedora/isolinux/vmlinuz initrd=initramfs
imgstat
echo Sleeping...
sleep 60
echo Boot
boot
When I first found the issue, I was still sitting on a mid-June version of the software, but after rebuilding with debugging and still seeing the issue, I pulled the latest from master and am using the August 31 commit 827dd1 as confirmed on the boot message printed by iPXE. It still requires I place a sleep 1 before the boot statement for it to boot on hardware. I am testing on a Dell PowerEdge R710, specifically. I'm using bin-x86_64-efi/snponly.efi
Swapping the order of initrd and kernel did fix the issue with CentOS.
(2016-09-12 17:58)langlorx Wrote: [ -> ]When I first found the issue, I was still sitting on a mid-June version of the software, but after rebuilding with debugging and still seeing the issue, I pulled the latest from master and am using the August 31 commit 827dd1 as confirmed on the boot message printed by iPXE. It still requires I place a sleep 1 before the boot statement for it to boot on hardware. I am testing on a Dell PowerEdge R710, specifically. I'm using bin-x86_64-efi/snponly.efi
Swapping the order of initrd and kernel did fix the issue with CentOS.
Glad that worked for you.
If you use a different protocol, like http:// or nfs:// do you still need the sleep statement? It would be interesting to see the FTP server's logs as well (with and without the sleep statement).