Skip to content

Commit

Permalink
iPXE simplified back to a single entry
Browse files Browse the repository at this point in the history
Easier to keep the .efi files inside the same iso tree.
Add a note about what firmware to use with KVM.
Fix the double empty lines after distro list.
  • Loading branch information
thias committed May 28, 2023
1 parent 5a0ef75 commit 9c99b11
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 54 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ an IDE or SATA disk (for some reason, as USB disk didn't work for me on Fedora
17), that way you can easily and quickly test changes.
Make sure you unmount the disk from the host OS before you start the KVM
virtual machine that uses it.
For UEFI testing, you'll need to use one of the `/usr/share/edk2/ovmf/*.fd`
firmwares.


Troubleshooting
Expand Down
31 changes: 9 additions & 22 deletions grub2/grub.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ loadfont unicode
insmod png
set theme=${prefix}/themes/invader/theme.txt

set efipath=/EFI/BOOT
set isopath=/boot/iso
probe --set rootuuid --fs-uuid $root
# Required to have these available in other configfile files
export efipath
export isopath
export rootuuid
export theme
Expand Down Expand Up @@ -160,6 +158,15 @@ for isofile in ${isopath}/grml/grml*.iso; do
fi
done

for isofile in ${isopath}/ipxe/ipxe*.iso ${isopath}/ipxe/ipxe*.efi; do
if [ -e "$isofile" ]; then
menuentry "iPXE >" --class net {
configfile "${prefix}/inc-ipxe.cfg"
}
break
fi
done

for isofile in ${isopath}/kali/kali-*.iso; do
if [ -e "$isofile" ]; then
menuentry "Kali >" --class kali {
Expand Down Expand Up @@ -310,26 +317,6 @@ for isofile in ${isopath}/xubuntu/xubuntu-*.iso; do
fi
done

for isofile in ${isopath}/ipxe/ipxe*.iso; do
if [ -e "$isofile" ]; then
menuentry "iPXE >" --class net {
configfile "${prefix}/inc-ipxe.cfg"
}
break
fi
done

if [ "${grub_platform}" = "efi" ]; then
for efifile in ${efipath}/ipxe/ipxe*.efi; do
if [ -e "$efifile" ]; then
menuentry "iPXE (EFI) >" --class net {
configfile "${prefix}/inc-ipxe-efi.cfg"
}
break
fi
done
fi

menuentry ' ' { # Empty line
true
}
Expand Down
17 changes: 0 additions & 17 deletions grub2/inc-ipxe-efi.cfg

This file was deleted.

48 changes: 33 additions & 15 deletions grub2/inc-ipxe.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
# iPXE
for isofile in $isopath/ipxe/ipxe*.iso; do
if [ ! -e "$isofile" ]; then break; fi
regexp \
--set 1:isoname \
--set 2:version \
"^${isopath}/ipxe/(ipxe(.*)?\.iso)\$" "${isofile}"
menuentry "iPXE ${version}" "${isofile}" "${isoname}" --class net {
set isofile=$2
set isoname=$3
echo "Using ${isoname}..."
loop $isofile
linux (loop)/ipxe.lkrn
}
done
# iPXE .iso "DOS magic is invalid." on EFI, so use special .efi
if [ "${grub_platform}" != "efi" ]; then
for isofile in $isopath/ipxe/ipxe*.iso; do
if [ ! -e "$isofile" ]; then break; fi
regexp \
--set 1:isoname \
--set 2:version \
"^${isopath}/ipxe/(ipxe(.*)?\.iso)\$" "${isofile}"
menuentry "iPXE (iso) ${version}" "${isofile}" "${isoname}" --class net {
set isofile=$2
set isoname=$3
echo "Using ${isoname}..."
loop $isofile
linux (loop)/ipxe.lkrn
}
done
else
for efifile in $isopath/ipxe/ipxe*.efi; do
if [ ! -e "$efifile" ]; then break; fi
regexp \
--set 1:efiname \
--set 2:version \
"^${isopath}/ipxe/(ipxe(.*)?\.efi)\$" "${efifile}"
menuentry "iPXE (efi) ${version}" "${efifile}" "${efiname}" --class net {
set efifile=$2
set efiname=$3
echo "Using ${efiname}..."
insmod part_gpt
insmod chain
chainloader $isopath/ipxe/$efiname
}
done
fi

0 comments on commit 9c99b11

Please sign in to comment.