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?
Alkis Georgopoulos
2019-12-15 17:30:01 UTC
Permalink
Hi, I filed an updated version of the patch as a merge request:

https://salsa.debian.org/waldi/ipxe/merge_requests/1

The one additionally saves the default entry, so that the GRUB iPXE
entry is consistent with all the other entries.
It was a 2-line diff upon the previous one, in the same spot, so I
thought I'd include that too.
Rafael David Tinoco
2020-01-14 01:30:02 UTC
Permalink
Hello maintainer(s),

I'm in the process of applying the following patches to ipxe source
package in Ubuntu and I would like to check if it is possible for you
to consider applying the same fixes in Debian.

There is currently 1 merge request in Salsa but it does not contain
all fixes I'm attaching here. Please, let me know if you would like me
to create another merge request with:

----
commit fd60330
Author: Rafael David Tinoco <***@ubuntu.com>
Date: Tue Jan 14 00:32:57 2020

Identify ipxe grub menu entry in an easier way (LP: #1858374)

commit c93d8f5 (alkisg/lp1811496)
Author: Alkis Georgopoulos <***@gmail.com>
Date: Mon Dec 16 05:45:02 2019

Save default entry when iPXE is selected

commit c1fa7a8
Author: Alkis Georgopoulos <***@gmail.com>
Date: Sun Dec 15 09:17:52 2019

Use ipxe.efi under UEFI (LP: #1811496)
----

Or if you are satisfied with this debdiff.

Thank you very much in advance.

Rafael D. Tinoco
***@ubuntu.com

Loading...