Discussion:
Bug#927783: Load ipxe.efi under UEFI, not ipxe.lkrn
(too old to reply)
Alkis Georgopoulos
2019-04-23 07:30:02 UTC
Permalink
Source: ipxe
Version: 1.0.0+git-20190125.36a4c85-1
Severity: normal

Dear maintainer,

https://packages.debian.org/buster/all/ipxe/filelist ships the following
files (among others):

/boot/ipxe.efi
/boot/ipxe.lkrn
/etc/grub.d/20_ipxe

But, when booting under UEFI, /etc/grub.d/20_ipxe tries to load
ipxe.lkrn instead of the correct ipxe.efi, and crashes.

Here's a proposed patch that addresses the issue:

diff ./a/etc/grub.d/20_ipxe ./b/etc/grub.d/20_ipxe
22c22,29
< linux16 $IPXEPATH
---
if [ "\$grub_platform" = "efi" ]; then
chainloader ${IPXEPATH%.lkrn}.efi
else
linux16 $IPXEPATH
if [ -f ${IPXEPATH%.lkrn}.ipxe ]; then
initrd16 ${IPXEPATH%.lkrn}.ipxe
fi
fi
This dynamically checks if the platform is efi or not, and loads the
correct ipxe.{efi|lkrn},
and additionally, in the BIOS case, it allows the user to provide an
ipxe script in /boot/ipxe.ipxe, which is loaded as initrd.
This functionality isn't yet supported by upstream iPXE under UEFI.
Vagrant Cascadian
2019-11-07 23:40:01 UTC
Permalink
Control: tags 927783 patch
Post by Alkis Georgopoulos
But, when booting under UEFI, /etc/grub.d/20_ipxe tries to load
ipxe.lkrn instead of the correct ipxe.efi, and crashes.
...
Post by Alkis Georgopoulos
This dynamically checks if the platform is efi or not, and loads the
correct ipxe.{efi|lkrn},
and additionally, in the BIOS case, it allows the user to provide an
ipxe script in /boot/ipxe.ipxe, which is loaded as initrd.
This functionality isn't yet supported by upstream iPXE under UEFI.
Updated patch against the packaging rather than the installed files:

diff --git a/debian/tree/ipxe/etc/grub.d/20_ipxe b/debian/tree/ipxe/etc/grub.d/20_ipxe
index 8be37c8..d72a3ec 100755
--- a/debian/tree/ipxe/etc/grub.d/20_ipxe
+++ b/debian/tree/ipxe/etc/grub.d/20_ipxe
@@ -19,7 +19,14 @@ if test -e "$IPXE" ; then
cat << EOF
menuentry "Network boot (iPXE)" --users "" --class network {
${prepare_boot_cache}
- linux16 $IPXEPATH
+ if [ "\$grub_platform" = "efi" ]; then
+ chainloader ${IPXEPATH%.lkrn}.efi
+ else
+ linux16 $IPXEPATH
+ if [ -f ${IPXEPATH%.lkrn}.ipxe ]; then
+ initrd16 ${IPXEPATH%.lkrn}.ipxe
+ fi
+ fi
}
EOF
fi


live well,
vagrant
Christian Ehrhardt
2019-11-08 08:40:01 UTC
Permalink
Hi,
is there any update on this?
The patch LGTM even thou I have to admit that I didn't try to work
with a patched system yet.
I wondered if this was just falling through the cracks or if there is
something that speaks against it?

Loading...